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

Christian HJ Wiesner chris at matroska.org
Fri Jan 9 13:35:43 CET 2004


Steve Lhomme wrote:

> 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 !

There is one flaw in this example :

The only purpose of the timestamp accuracy is to allow to determine a 
specific sample in a block by the timestamp attached to the start of the 
block.

1 / 44100 =  22,6 µs , means every single sample is 22,6 µs long , or    
Ts ( duration of each sample ) = 22,6 µs

So, the minimal required accuracy to determine a specific sample from a 
timestamp is  1/2 Ts = 11,3 µs

So, if your timestamp is accurate to 10 µs or less, you can say with 
100% certainty what sample you have to load, by using rounding. 
Remember, we dont need the starting timestamp of this one sample with a 
precision of 0,5 ns , all we need to know is, if we have a timestamp  
xxxx , what sample corresponds to it.

Christian




More information about the Matroska-devel mailing list