Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Reading Source File Frame Rate

  • Reading Source File Frame Rate

    Posted by Manuel Frust on April 15, 2011 at 7:09 am

    Hi,

    I’m not a programmer, but I am assisting my programmers.

    When using FFmpeg to convert files uploaded to my server to various formats, I’d like to keep the original frame rate rather than imposing one.

    Without going into too much detail, there’s a good reason I upload various formats, and require ffmpeg to convert them to other formats “on the fly”.

    Sometimes I may choose to convert a 12fps video, at other times a 29.97fps video.

    As you can imagine, having all videos converted by ffmpeg playback at any one size fits all speed is not desirable for several reasons.

    Is there a line of code that would allow ffmpeg to read the original frame rate from the source file and then use that when converting to various formats?

    Any help would be much appreciated!

    Manuel Frust replied 15 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Michael Rampe

    April 27, 2011 at 4:03 am

    [Manuel Frust] “Is there a line of code that would allow ffmpeg to read the original frame rate from the source file and then use that when converting to various formats?”

    FFmpeg does this by default if you do not specify a rate (-r). It is not always foolproof so doing a header read with $ ffmpeg -i inputfile will give you the framerate. You might also want to have a look into ffprobe which has similar functions.

    Michael

  • Manuel Frust

    May 2, 2011 at 7:59 pm

    Hi Michael,

    Thank you very much!

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