Changes between Version 1 and Version 2 of ChangingFrameRate


Ignore:
Timestamp:
Oct 13, 2018, 9:15:22 AM (5 weeks ago)
Author:
Gyan
Comment:

some elaboration added; SU expln is for fps filter, not -r - also fps has been reworked since, consider updating the link; -r accepts stream specifiers, so statement deleted

Legend:

Unmodified
Added
Removed
Modified
  • ChangingFrameRate

    v1 v2  
    1212This is useful when working with, for example, high-framerate input video that needs to be temporally scaled down for devices that do not support high FPS. 
    1313 
    14 When the frame rate is changed, ffmpeg will drop or duplicate frames as necessary to achieve the targeted output frame rate. A detailed explanation of how ffmpeg decides to drop/duplicate frames is [https://superuser.com/a/843363/48078 given in this post]. 
     14When the frame rate is changed, ffmpeg will drop or duplicate frames as necessary to achieve the targeted output frame rate. A detailed explanation of how the fps filter in ffmpeg decides to drop/duplicate frames is [https://superuser.com/a/843363/48078 given in this post]. 
    1515 
    1616{{{ 
     
    28282. With the [http://ffmpeg.org/ffmpeg-filters.html#fps fps filter] 
    2929 
    30 There are minor differences in implementation of those two;  particularly, `-r` as an output option applies to all streams, whereas `fps` can be set for each stream individually within complex filter chains. In the following we will focus on using the `fps` filter, as it is more configurable. 
     30There are differences in implementation of those two; `-r` takes effect after all filtering but before encoding of the video stream has taken place. Its logic depends on the video sync method set (`-vsync`). For an output format like MP4, which defaults to constant frame rate (CFR), `-r` will generate a CFR stream. For variable frame rate formats, like Matroska, the `-r` value acts as a ceiling, so that a lower frame rate input stream will pass through, and a higher frame rate stream, will have frames dropped, in order to match the target rate. The `-r` value also acts as an indication to the encoder of how long each frame is, and can affect the ratecontrol decisions made by the encoder. 
     31 
     32`fps`, as a filter, needs to be inserted in a filtergraph, and will always generate a CFR stream. It offers five rounding modes that affect which source frames are dropped or duplicated in order to achieve the target framerate. See the [http://ffmpeg.org/ffmpeg-filters.html#fps documentation] of the fps filter for details. 
     33 
     34In the following we will focus on using the `fps` filter, as it is more configurable. 
    3135 
    3236== Example ==