[Matroska-devel] Re: Timestamp precision in matroska files

Steve Lhomme steve.lhomme at free.fr
Fri Jan 9 10:44:51 CET 2004

Moritz Bunkus wrote:

> Heya,
>>Well, before we go on further in the discussion, I'd like some cases 
>>where it is true that we need a more accurate Block timecode.
> Huh? You've said it yourself. If you want sample accurate timecodes
> you'll have to increase accuracy. With the 16bit sint the clusters

No I said if we want sample accuracy, we have to find another solution 
than timecodes. Because they are simply not compatible for this matter. 
Not in the integer world.

Now it seems I find to put a simple example myself :
Imagine sample 998 of an audio stream at 44100 kHz. The timecode for 
this sample is 998/44100 = 22.63038549 ms or 22,630,385.49 ns
Now you'll have to explain me how any timecode precision, even of 1ns 
could be accurate for this sample !

> will become VERY small then because they can only be approx. 64000
> scale units big. This means e.g. a bit over a second for 48000 Hz audio
> if we use the sample rate as the timecode scale.

As said above, the solution is *not* in timecodes tweaking.

>>We can use a flag in the Block to specify that the size of the timecode 
>>is "not as it used to be". We'll have the same compatibility problems 
>>that when we introduced new lacing schemes. No need to use a new
> It sucked back then, it'll suck again ;) Anyway, if we're going to do it
> we should be doing it right.

IMO that's not needed. Not for sample-accurate seeking, at least.


TrackTimecodeScale is a float, around 1.0. So any timecode right now is 
a float anyway (so the precision will never be perfect, as a sample 
count). And the sampling frequency is a float too. So expecting an 
integer precision from any of these numbers is simply impossible.

More information about the Matroska-devel mailing list