[Matroska-users] Understanding timecode in clusters / simpleblocks

Austin Einter austin.einter at gmail.com
Sat Oct 21 05:05:34 CEST 2017


I have got a mkv file (with h.264 frames).
I just converted it to xml format (given below) using some open source.

I was able to understand most of the part, except timecode in clusters and
simpleblocks. Can you please help me to understand it.

*<Cluster>*
*  <Timecode>0</Timecode>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>0.0</timecode>*
*    <keyframe/>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>0.167</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>0.083</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>0.042</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>0.125</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>0.292</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>0.208</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>0.25</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*

*.*
*. -----------------> Number of simple blocks goes here *
*.*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>4.833</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*</Cluster>*


*-----------------> First cluster ends here*

*<Cluster>*
*  <Timecode>5042</Timecode>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>5.042</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>4.958</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>4.917</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>5.0</timecode>*
*    <data>*
*    </data>*
*.*
*. -----------------> Number of simple blocks goes here*
*.*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>9.917</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>10.0</timecode>*
*    <data>*
*    </data>*
*  </SimpleBlock>*
*</Cluster>*
*<Cluster>*
*  <Timecode>10208</Timecode>*
*  <SimpleBlock>*
*    <track>1</track>*
*    <timecode>10.208</timecode>*
*    <data>*
*.*
*.  -----------------> Number of simple blocks goes here *
*.*


Now you can see in

   1. 1st cluster timecode is 0
   2. 1st cluster / 1st simpleblock timecode is 0.0
   3. 1st cluster / 2nd simpleblock timecode is 0.167
   4. 1st cluster / 3rd simpleblock timecode is 0.083

and so on...

How these timecode values are calculated?

Thanks
Austin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.matroska.org/pipermail/matroska-users/attachments/20171021/d1436a9e/attachment.html>


More information about the Matroska-users mailing list