[FFmpeg-user] How can I force a 360kHz time base?

Jim DeLaHunt list+ffmpeg-user at jdlh.com
Sat Feb 27 03:32:41 EET 2021


On 2021-02-26 16:53, Mark Filipak (ffmpeg) wrote:

> …What I'm suggesting is that ffmpeg convert to a single, 360000Hz time 
> base for all videos, for all time. Then, rounding errors would be 
> *zero*. PTSs would be exact. …


As I told you back on 23. February, ffmpeg uses a timebase that is a 
rational number, and is an attribute of the video stream, and can take 
various values. The timebase could be 1/360000, or 1/24, or 1001/24000. 
This already allows integer Presentation TImestamp (PTS) values to 
represent time values with zero rounding errors. You dismissed that as 
"The Matrix", but this is in fact the data structure which FFmpeg 
already uses.

Of course, to achieve zero rounding errors, the input video, and the 
user writing the FFmpeg command line, and FFmpeg itself, must all make 
wise choices so that the timebase is set to a rational number which 
suits the data.

I don't think it is wise for FFmpeg to switch from its present flexible 
data structure to a constant, 1/360000 value for timebase. The examples 
you present do not make the case for such a change.

If you can establish that FFmpeg is imposing a 1/1000 timebase on a 
video with a 1001/24000 timebase, leading to rounding errors, that is 
evidence of a bug in FFmpeg's timebase calculation or something. It is 
not evidence of the timebase data structure being inadequate.




More information about the ffmpeg-user mailing list