[FFmpeg-devel] Is AV_TIME_BASE required to be a full millisecond?

Nicolas George george at nsup.org
Tue May 18 23:09:57 EEST 2021


Michael Fabian 'Xaymar' Dirks (12021-05-18):
> while tracking some time stamp issues unique to FFmpeg I noticed
> AV_Time_BASE(_Q) being present quite often, which appears to be a
> value to define time stamps in milliseconds. Tracking it back to its
> origin I could find very little to no information about why this value
> was chosen. All I know so far is that it was chosen for compatibility
> with very early versions of FFmpeg.

Microsecond timestamps are a good compromise that allows enough
precision for almost everything while having a wide enough range on
normal 64 bits arithmetic. Using nanosecond, for example, would let
timestamps overflow after six centuries, which is too close for comfort.

> Does FFmpeg require this value to be a full millisecond? Or is it
> possible to adjust this to microseconds and "fix" many of the time
> stamp issues that occur? While it seems to be possible to work-around
> this issue on a muxer/demuxer level, the underlying issue in FFmpeg
> would still be present. At the moment, most non-integer ms framerates
> and sample rates end up performing weird without post-processing.

Please tell what value you would recommend instead of a microsecond, and
explain precisely which weirdness it would allow to fix and how.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210518/6d6f7780/attachment.sig>


More information about the ffmpeg-devel mailing list