Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques ffmpeg extracts wrong image

  • ffmpeg extracts wrong image

    Posted by Mika Gands on September 13, 2012 at 3:59 pm

    Hi,
    I am converting a HQ mp4 to flv with the following cmd.

    ffmpeg -re -i test.mp4 -acodec copy -vcodec copy -f flv test.flv

    I am extracting the frame for 00:01:00 by the below cmd.

    ffmpeg -ss 00:01:00 -an -i test.flv test.jpg

    The resulting test.jpg is actually the image @ 00:02:50

    So What I am doing wrong here?

    Mika Gands replied 13 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Michael Rampe

    September 16, 2012 at 9:42 pm

    Hi Pandi,

    The behavior of the -ss option varies depending on where it is put in the command line.

    If it is placed before the input (as in your case) it will begin decoding from this time. The result with many codecs is that is delivers the first I frame it encounters as it cannot decode the frames before that. This method is very fast but not frame accurate.

    If it is placed after the input like:
    ffmpeg -an -i test.flv -ss 00:01:00 test.jpg
    …it will decode all of the frames and deliver a frame accurate result. As this requires decoding all frames, it is slower and this is compounded by how far you are seeking into the material. (ie. setting to 59.59:00 will be very slow as it has to decode a full hour of frames just to get the one you want.)

    Michael

  • Mika Gands

    September 17, 2012 at 3:18 pm

    Hi Michael,

    Thank you very much for your reply. The information which you gave is very useful to me.

    Thanks,
    Pandi

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