[FFmpeg-devel] [PATCH] avformat/matroskaenc: Allow changing the time stamp precision via option

Michael Fabian 'Xaymar' Dirks michael.dirks at xaymar.com
Thu May 20 21:45:17 EEST 2021


On 2021-05-20 20:14, Nicolas George wrote:
> Michael Fabian 'Xaymar' Dirks (12021-05-20):
>> The default precision for Matroska is 1ms not 1µs. 1µs is plenty
>> enough, but 1ms is not.
> I am not even convinced that most problems with 1ms are not caused by
> bad math, but I am willing to see proof.

Well, it's a combination of many things really, not bad math itself. 1ms works perfectly for the frame rates of 1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 125, 200, 250, 500, and 1000. For any other rate, you will have to look at the actual timestamp of N clusters and M blocks, where N and M are undefined. N and M are undefined because there is no solution that works for every rate, other than having a per-track rational time base (https://github.com/ietf-wg-cellar/matroska-specification/pull/425).

If there were zero dropped/skipped frames in the encoding process (we have a packet for every frame), then it can be worked around by looking ahead for 1 second, but that is a lot to ask from an application just to know the actual rate. Matroska is far from perfect as it is right now, so more vocal input on the IETF standardization process for Matroska/WebM might be helpful.

-- 
Sincerely | Mit freundlichen Grüßen

Michael Fabian 'Xaymar' Dirks
Software Designer & Engineer




More information about the ffmpeg-devel mailing list