How to get Timestamp scale information without using mkvinfo

Is it possible to get Timestamp scale of an mkv file without mkvinfo?
I know I can get it like this mkvinfo FILE.mkv --ui-language en, but I need to be able to parse the result (it would need to be in xml or json) in python.

From what I know, it is not possible to set the format in mkvinfo, so I was wondering if there is a way with mkvmerge to get this info. I tried mkvmerge.exe FILE.mkv -J, but it doesn’t have it.

Not at the moment, no. I can add it into mkvmerge’s identification output, though. Please open an issue for it over on Gitlab; otherwise chances are I might forget about it again. Thanks.

FYI: I’ve just added this particular feature. The factor will be output in JSON identification mode as the container property timestamp_scale in v82. Until then you can use the latest continuous builds (Windows, Linux).

Thanks!
It has been introduced in: Matroska reader: add timestamp scale factor in JSON identification output (a4381f9b) · Commits · Moritz Bunkus / MKVToolNix · GitLab
It is available since the version 82.0 !

@mbunkus Oh, I just realised that there is a TimestampScale and TrackTimestampScale. See Specification Notes

You added TimestampScale in the JSON identification mode (reported as `timestamp_scale), but would it be possible to also add the TrackTimestampScale?

My initial goal is to know what is the precision of the timestamps (seconds, milliseconds, etc). If I understand correctly, I need to use the multiplication value between TimestampScale and TrackTimestampScale to know the precision.
Ex: If TimestampScale=1000 and TrackTimestampScale=1.0, the timestamps precision are in nanoseconds.

TrackTimestampScale has been deprecated. No software out there supports or uses it. There’s no use in outputting it as a property. Just assume it’s always 1.

1 Like