Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Specify frames to be extracted

  • Specify frames to be extracted

    Posted by Laurent Nguyen on July 12, 2011 at 2:39 pm

    Dear forum,

    I am looking for a way to extract specific frame numbers from a movie, of course using ffmpeg. For the moment, the only thing I have found that is close to what I need is the following:

    ffmpeg -i movie.mov -ss 00:00:20 -vframes 33 im%5d.png

    With this command, I’m extracting 33 frames, with the first one starting at 00:20 seconds. However, I would like to specify the starting frame not by time but by frame number. In other words, I want to extract, say from frame #167 to #192 from my movie.

    Is there a simple way of doing this ? A virtual beer for the one who finds the answer.

    Thanks,

    Laurent

    Michael Rampe replied 15 years ago 2 Members · 1 Reply
  • 1 Reply
  • Michael Rampe

    July 12, 2011 at 11:59 pm

    [Laurent Nguyen] “However, I would like to specify the starting frame not by time but by frame number.”

    This function only accepts time as an input. It does however accept a decimal:

    `-ss position’
    Seek to given time position in seconds. hh:mm:ss[.xxx] syntax is also supported.

    So…. If you know your frame rate, you can calculate the right time to start.

    Frame 167 in a 25 fps stream = 167/25 = 6.68 seconds.

    Thus your command would be:

    -ss 00:00:06.68

    Michael

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy