[FFmpeg-user] extract all key frames from a video

lovelove googol at wolke7.net
Wed Sep 7 17:34:49 CEST 2011

Stefano Sabatini wrote:
> On date Wednesday 2011-09-07 02:01:51 -0700, lovelove encoded:
>> Hi. I tried to use the new key-frame filter (
>> http://ffmpeg.org/trac/ffmpeg/ticket/92 Ticket #92 ) [...]
>> My command is:
>> *ffmpeg.exe -i inputfile.avi -vf select="eq(pict_type\,PICT_TYPE_I)" -s
>> 400x300 -f image2 outputfile.AVI-%03d.tif*
>> [...]
>> yes, the output images are key frames. But way too much. After 3
>> seconds, I already had 378 output images, of which only 3 were unique
>> (the
>> rest were duplicates).  
> -vsync 0 (-vsync -1 is the default)

That works, thank you so much!

I read up on the -vsync param. It says:
0 = Each frame is passed with its timestamp from the demuxer to the muxer
2 = Frames are passed through with their timestamp or dropped so as to
prevent 2 frames from having the same timestamp.

I tried both 0 and 2 in the quoted ffmpeg above and both seem to generate
the same output in this case. Do they really do the same in my case, or does
one of them have any advantage/disadvantage for me which I'm missing? Should
0 or 2 in theory be faster? In my tests there was no speed (performance)

Other issue: the output images are fine, however the console text output
mysteriously repeats again so many lines (just as I posted earlier on
today). Any idea why?

View this message in context: http://ffmpeg-users.933282.n4.nabble.com/extract-all-key-frames-from-a-video-tp3795626p3796429.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.

More information about the ffmpeg-user mailing list