ffmpeg capture video thumbnail

1. Capture the thumbnail of the frame starting from a certain time

for item in `find . -name '*.mp4' -o -name '*.ts' -o -name '*.mkv' -o -name '*.mpg' -o -name '*.mts'`

do 
    ffmpeg -i $item -ss 00:01:00 -vframes 1 -s 140x80 ${item%.*}.jpeg

done


2. Capture all keyframe thumbnails of the video

for item in `find . -name '*.mp4' -o -name '*.ts' -o -name '*.mkv' -o -name '*.mpg' -o -name '*.mts'`
do 
    ffmpeg -i $item -vf select='eq(pict_type\,I)' -vsync 2 -s 280x160 -f image2 thumbnails-%02d.jpeg

done

3. Capture a key frame thumbnail

for item in `find . -name '*.mp4' -o -name '*.ts' -o -name '*.mkv' -o -name '*.mpg' -o -name '*.mts'`
do 
    ffmpeg -y -i $item -ss 115 -t 10 -vf "select=eq(pict_type\\,I)" -vframes 1 -f image2 -s 280x160 ${item%.*}.jpeg
done

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325649865&siteId=291194637