Framerate vs r vs Filter fps

14,524

-framerate is an input per-file option. It is meant for input formats which don't have a framerate or PTS defined, image sequences being an example.

-r can be either an input or output option. As an input option, it retimes input frames at that rate. As an output option, it will duplicate or drop frames to achieve the given rate (note that it won't duplicate frames if output format accepts variable frame rate). Output r is the 'encoding rate' as well. If it is not specified, it is inherited from the input rate, whether that's manually set or altered or an inherent property of the stream.

fps filter allows one to alter a stream's framerate while filtering by dropping or duplicating frames to achieve the given rate. It overrides the input stream rate. Its main use is to manipulate a stream before combining it with other streams, or before filtering it further.

-x265-params fps is a private property of the x265 encoder. Its main purpose is to signal a duration for each frame for the purposes of rate-control. Encoders like x264/5 devote more bits to frames that are shown for longer. It does not actually alter framerate or number of frames or frame duration.

Share:
14,524
Matt McManis
Author by

Matt McManis

Artist, Graphic Designer, Web Developer. Projects: Axiom FFmpeg UI Glow mpv Configurator

Updated on July 08, 2022

Comments

  • Matt McManis
    Matt McManis almost 2 years

    I'm trying to better understand FFmpeg framerate.

    Example: If I wanted to convert a 30 fps video to 23.976 fps.


    What are the differences between:

    Option
    -framerate 24000/1001

    Option
    -r 24000/1001

    Filter
    -vf "fps=24000/1001"

    x265 params
    -x265-params "fps=24000/1001"


    What I've read is:

    -framerate is image sequence fps (input video fps?)

    -vf "fps=" is encoding fps

    -r is output fps

    However I don't know if that is correct, or if it changes depending on what order you place them in the options.


    Questions

    1. -x265-params "fps=" Is it required use it's own fps param? Can it not use default options?

    2. Should multiple Options, Filters ,and Params be combined, or should you only use one?

    3. Input/Output Framerate

      https://ffmpeg.org/ffmpeg.html#toc-Video-Options

      -r[:stream_specifier] fps (input/output,per-stream)

      If in doubt use -framerate instead of the input option -r.

      Is -r input or output? How do you specify, by putting before or after the -i?