mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avfilter/setpts: also preserve duration when not stripping fps
It makes sense to treat the presence of a frame duration and the presence of frame rate metadata identically - because both convey effectively the same amount of information. Inf121d95andfa110c3respectively, this information was stripped by default, originally to work-around bugs when changing the PTS information of a stream being fed to some encoders. (See https://trac.ffmpeg.org/ticket/10886) Later, commit959b799crestored the ability to preserve the frame rate medatata via the `strip_fps` option, but this option did not extend to also include the frame duration. This commit resolves the scenario by making `frame_rate` and `duration` handled in a consistent manner, so that the frame rate information is generally preserved unless explicitly stripped by the user. While it does regress the exact invocation presented in the trac ticket unless using `strip_fps=yes`, I consider this an acceptable trade-off, especially in light of the fact that the `fps` filter also exists and is arguably the better tool for the task at hand.
This commit is contained in:
@@ -31911,9 +31911,9 @@ This filter accepts the following options:
|
||||
The expression which is evaluated for each frame to construct its timestamp.
|
||||
|
||||
@item strip_fps (@emph{video only})
|
||||
Boolean option which determines if the original framerate metadata is unset.
|
||||
If set to true, be advised that a sane frame rate should be explicitly
|
||||
specified if output is sent to a constant frame rate muxer.
|
||||
Boolean option which determines if the original framerate and frame duration
|
||||
metadata is unset. If set to true, be advised that a sane frame rate should be
|
||||
explicitly specified if output is sent to a constant frame rate muxer.
|
||||
Default is @code{false}.
|
||||
|
||||
@end table
|
||||
|
||||
Reference in New Issue
Block a user