Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques ffmpeg frame rate and jpg to movie

  • ffmpeg frame rate and jpg to movie

    Posted by Daniel Paluska on November 23, 2011 at 8:13 pm

    so i have successfully made stacks of images into movies with ffmpeg.
    ffmpeg -i frame%04d.jpg out.mp4

    now i often like timelapse movies to be a little lower framerate so if i instead do
    ffmpeg -i frame%04d.jpg -r 10 out.mp4
    should i not expect my movie to be 2.5 times as long? since -r 25 is the default frame rate setting?

    but i’m not finding this to be the case and wondering why. it seems ffmpeg drops frames when i reduce hte output framerate. i might expect that for movie conversion but i wouldn’t expect that for converting a stack of frames.
    actually i’ve been using this someftware for a couple years on various different machines and this is the first time i noticed this so i’m not sure if it is version specific or codec specific?

    anybody else have experience with this?

    thanks,
    dan

    Nilesh Patel replied 13 years, 11 months ago 3 Members · 3 Replies
  • 3 Replies
  • Reuben Martin

    November 28, 2011 at 3:35 am

    What few people realize is that the order of the options is very important for ffmpeg.

    From ffmpeg’s point of view, your are saying “I have a frame sequence at 25fps that I want resampled into 10 fps for the same runtime.”

    You need to place the “-r” option before the “-i” option so that ffmpeg understands that the 10fps is the rate of the input, not the resampled rate for the output.

    example:
    ffmpeg -r 10 -i frame%04d.jpg out.mp4

    Please note, this command is very ambiguous. It does not specify the video or audio codec, and the MP4 standard supports several different codecs for both audio and video. ffmpeg will just select which ever video and audio codecs are programmed as default for MP4 which may or may not be what you want.

    You would want something more like this:

    ffmpeg -i source.xxx -vcodec foobar -acodec foobar -f mp4 output.mp4

  • Reuben Martin

    November 29, 2011 at 12:25 am

    Some of the code was munged in the post due to discarding HTML characters.

    That last code example should read something like:

    ffmpeg [input_options_here] -i source.xxx [output_options_here] -vcodec foobar [vcodec_options_here] -acodec foobar [acodec_options_here] -f mp4 output.mp4

  • Nilesh Patel

    September 5, 2012 at 8:01 am

    Hello,

    Any One please tell me why am not able to generate video from images for framerate below then 20.

    1. MPG
    a. I want to generate Video with frame rate 12 but it support till 20

    b. My Command : D:ffmpeg.exe -y -f image2 -r 20 -i D:Study1%d.jpg -s 512×512 -b 2400k D:Videoson_3_Sep_2012_add_framerate_20.mpg

    On Other hand for MP4, I can go low frame rate as I required. For this I use below command

    C:ffmpeg.exe -y -f image2 -r 12 -i D:Study1%d.jpg D:Videoson_3_Sep_2012_add_framerate_12.mp4

    From many days I am trying form same, please stuck me out

    Thanks in Advance

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