[FFmpeg-user] Meaning of input frame rate

Lou lou at lrcd.com
Fri Aug 23 20:09:07 CEST 2013


On Fri, Aug 23, 2013, at 08:15 AM, Dzung Nguyen wrote:
> What's the meaning of input frame rate. For example, what does this
> command
> do?
> 
> ffmpeg -loop 1 -r 1 -i image.png -q:v 0 -r 29.97 out.mpg

This will use an input frame rate of 1 frame per second. The output will
be 29.97 frames per second. ffmpeg will duplicate frames to reach your
desired output frame rate. In the opposite case, if your input -r was a
larger value than your output -r, then ffmpeg would drop frames to reach
your output frame rate. You can see the number of dropped or duped
frames at the end of your console output:

frame=  150 fps=0.0 q=0.0 Lsize=    1604kB time=00:00:04.97
bitrate=2643.0kbits/s dup=25 drop=0

The result will show each input image for a second, but your output will
still be 29.97.

Since there is no -t, -vframes, or any other option to limit the
duration or number of output frames in this command the encoding will
continue indefinitely. 

"-q:v" values of 0-2 all appear to produce the same results with this
encoder, mpeg1video, and my sample (I did not refer to any code):

$ ffmpeg -loop 1 -i 001.png -q:v 0 -t 5 -c:v mpeg1video -f md5 -
...
MD5=71fdaa434d28777735a85d4aa383d88c

$ ffmpeg -loop 1 -i 001.png -q:v 2 -t 5 -c:v mpeg1video -f md5 -
...
MD5=71fdaa434d28777735a85d4aa383d88c
 
> Instead of
> 
> ffmpeg -loop 1 -r 29.97 -i image.png -q:v 0 -r 29.97

This will use an input frame rate of 29.97 frames per second. The output
-r 29.97 is not needed since the output should inherit the input frame
rate, so declaring the same -r for both input and output is superfluous
in this case. No frames will be dropped or duplicated because there is
no difference between your input and output frame rates.

Use "-r ntsc" or "-r 30000/1001" for NTSC video frame rate.


More information about the ffmpeg-user mailing list