FORUMS: list search recent posts

Reading Source File Frame Rate

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Manuel Frust
Reading Source File Frame Rate
on Apr 15, 2011 at 7:09:35 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!


Return to posts index

Michael Rampe
Re: Reading Source File Frame Rate
on Apr 27, 2011 at 4:03:42 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


Return to posts index

Manuel Frust
Re: Reading Source File Frame Rate
on May 2, 2011 at 7:59:59 pm

Hi Michael,

Thank you very much!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]