Topic: Create thumbnails every X frames/seconds/minutes with ffmpeg
Since I struggled to find some infos for this, I wanted to sum up my findings here:
ffmpeg -y -threads 8 -i "test.m4v" -an -sn -vsync 0 -vf select="not(mod(n\,14386))" -s 854x480 -vcodec mjpeg -pix_fmt yuvj420p -b:v 2000 -bt 20M "test_%d.jpg"
overwrite output, if already exists
X = number of threads used during decoding
-i "path to input"
specifies the input
disables the audio
disables a/v sync
only outputs every Xth frame, so if you want to create a thumbnail select every Y minute set X = Y*60*fps e.g. 10*60*23.967 = 14380
sets the resolution for the output; this should only be needed if your input is anamorph
sets the output format, typically mjpeg or png
sets the output color space typically yuvj420p or rgb24
-b:v X -bt Y
sets the target bitrate and the bitrate tollerance X = 2000 and Y = 20M seem to be good values
"path to output ending with _%d.extension"
specifies the output file, where _%d is used so the output will look like fileName_0, fileName_2,...
.extension should be .jpg or .png
If you want to:
Create a single thumbnail every X frames/seconds/minutes, but skip the first X seconds, simply add -ss X to the above example.
Create a X thumbnails starting from specific time, remove the -vf select="not(mod(n\,X))" part and insert -vframes X -ss timeInSeconds instead, e.g. -vframes 1 -ss 10 would create a single thumbnail after 10 seconds.