Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#92 closed enhancement (fixed)

Extract all key frames from a video using ffmpeg tool

Reported by: benoit Owned by: michael
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 Changed 5 years ago by saste

  • Resolution set to fixed
  • Status changed from new to closed

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 Changed 5 years ago by lovelove

cross-reference: #442 (scene change detection)

comment:3 Changed 5 years ago by lovelove

[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.