[Matroska-users] Understanding timecode in clusters / simpleblocks

Steve Lhomme slhomme at matroska.org
Sun Oct 22 12:41:06 CEST 2017


This is decribed here:
https://tools.ietf.org/html/draft-lhomme-cellar-matroska-03#section-23

((Block timestamp * TrackTimecodescale) + Cluster timestamp) * TimecodeScale

TrackTimecodescale is deprecated and can be considered to be 1 (unless
you're very unlucky and encounter a file with a different value).

2017-10-21 5:05 GMT+02:00 Austin Einter <austin.einter at gmail.com>:
> 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
>
> 1st cluster timecode is 0
> 1st cluster / 1st simpleblock timecode is 0.0
> 1st cluster / 2nd simpleblock timecode is 0.167
> 1st cluster / 3rd simpleblock timecode is 0.083
>
> and so on...
>
> How these timecode values are calculated?
>
> Thanks
> Austin
>
>
>
>
>
>
> _______________________________________________
> Matroska-users mailing list
> Matroska-users at lists.matroska.org
> https://lists.matroska.org/cgi-bin/mailman/listinfo/matroska-users
> Read Matroska-Users on GMane:
> http://dir.gmane.org/gmane.comp.multimedia.matroska.user
>



-- 
Steve Lhomme
Matroska association Chairman


More information about the Matroska-users mailing list