Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#92 closed enhancement (fixed)

Extract all key frames from a video using ffmpeg tool

Reported by: Benoit Fouet Owned by: Michael Niedermayer
Priority: wish Component: ffmpeg
Version: git Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


I've been asked several times if we could make the ffmpeg command line tool able to extract all key frames from a video.
I don't think it's possible today, but may be a nice feature to have.

Change History (3)

comment:1 by Stefano Sabatini, 11 years ago

Resolution: fixed
Status: newclosed

Addressed in commit:

commit 07586b68a8a496e44c7c977599e1ec09d07fd57f
Author: Stefano Sabatini <>
Date:   Sat May 7 02:06:25 2011 +0200

    lavfi: add select filter
    Address trac issue #92.

You can use the filterchain:
-vf select="eq(pict_type\,PICT_TYPE_I)"

for selecting only the I-frames to send to the output.

Note that you'll have still to decode all frames, since we currently don't have a packet-level filtering mechanism.

comment:2 by lovelove, 11 years ago

cross-reference: #442 (scene change detection)

comment:3 by lovelove, 11 years ago

[As a reference for other users:] As kindly explained by Stefano Sabatini, the abovementioned -vf parameter needs to be coupled with the -vsync 0 parameter if one wants to "extract all key frames from a video" without duplicates, as is the idea behind this ticket.

Note: See TracTickets for help on using tickets.