Extract key frame from video with ffmpeg I have a need to generate a thumbnail for videos for a web application and I am currently doing that with this command:

ffmpeg -ss &lt;seconds&gt; -i &lt;input file&gt; -vframes 1 -y &lt;output file&gt;

Pretty basic, and does the job. But, of course, sometimes the frames aren't very "interesting".

For example, sometimes the video has faded to black as the scene changes, or it could be something which is somewhat boring like credits rolling or similar.

I need some sort of algorithmic way to extract something interesting from the video and essentially filter out the boring bits.

Is there anything in FFmpeg that might be able to make this easier?

If not, then I will need to collect a number of frames and process them outside of FFmpeg; likely using PHP. As a side note, if anyone has any existing code that does this, it would be super helpful!

Many thanks
No ffmpeg code can identify interesting frames. At most, there are filters which detect representative frames and filters which identify frames with a scene change. So, at best, there's a thumbnail filter for this, sort of. It can't detect "interesting" frames but it detects representative frames. So, frames from the middle of fades should be out. 

Syntax is

ffmpeg -ss 50 -i in.avi -vf thumbnail=300 -vsync 0 thumbs%d.png


This will pick one representative frame from each batch of 300 consecutive frames.