I use FFmpeg to extract thumbnails from specific locations of video files.
I found two approaches on the Internet for this:
With the -ss (search) option before the -i (input) option:
ffmpeg -y -ss $SEEK_POINT -i input.ogv -vcodec mjpeg -vframes 1 -an -s 120x90 -f rawvideo output.jpg
With the -ss (search) option after the -i (input) option:
ffmpeg -y -i input.ogv -vcodec mjpeg -ss $SEEK_POINT -vframes 1 -an -s 120x90 -f rawvideo output.jpg
The first method creates a bad thumbnail with gray spots, but it works very quickly. Error returned: [theora @ 0x8097240] vp3: first frame not a keyframe .
The second method always works, but shows an error due to which the extraction takes a lot of time. This time is not fixed and depends on the search point, as I noticed. Sometimes it takes a few seconds to extract a thumbnail, and sometimes a few minutes. I get the error Buffering several frames is not supported. Please consume all available frames before adding a new one. Buffering several frames is not supported. Please consume all available frames before adding a new one. on the next output:
Input
How can I extract thumbnails without any problems using FFmpeg from a custom video position regardless of input format?
source share