[Matroska-devel] ReferenceTimecode tracks in Matroska proposal

Dave Rice dave at dericed.com
Sun Jan 10 23:57:21 CET 2016

Hi all,

Here is an early draft of Elements for managing ReferenceTimecode tracks. Matroska uses the term 'Timecode' to reference presentation timestamps, whereas other formats (QuickTime, MXF) use 'Timecode' to reference a time reference that is added to the timeline which is inpendent of the presentation (i.e. a QuickTime file with a timecode track that starts at one hour aka 1:00:00;00 would not cause a one hour delay before playback starts). In the context of Matroska I am using ReferenceTimecode (for now) to refer to QuickTime/MXF style timecode tracks.

Add to the TrackType definition to list "0x13: timecode,"

Add the following timecode Codec IDs.
Codec ID        | Name               | Description
T_QUICKTIME     | QuickTime Timecode | Timecode data as stored in QuickTime, e.q. tmcd. The CodecPrivate contains all additional data that is stored in the 'tcmd' (timecode) atom in the QuickTime file.
Others? LTC? VITC?

Proposed elements under TrackEntry:

Element Name: ReferenceTimecode
Level:        3
ID:           [EF]
Mandatory:    -
Multiple:     -
Default:      -
Type:         m
Description:  ReferenceTimecode settings

Element Name: ReferenceTimecodeForm
Level:        4
ID:           [EF][A1]
Mandatory:    mand.
Multiple:     -
Range:        0-2
Default:      0
Type:         u
Description:  Indicates the form of expression used to present the timecode (using HH for hours, MM for minutes, SS for seconds, mmm for milliseconds, ff for frames).
              0: HH:MM:SS.mmm
              1: HH:MM:SS:ff (non-drop frame)
              2: HH:MM:SS;ff (drop frame)

Element Name: ReferenceTimecode24HourMax
Level:        4
ID:           [EF][A2]
Mandatory:    mand.
Multiple:     -
Range:        0-1
Default:      0
Type:         u
Description:  Indicates if the timecode should revert to a zero-value at the time reference of 24 hours. Set to 1 if the ReferenceTimecode should use a maximum value of 24 hours and wrap values back to zero hours at that point.

For storage of ReferenceTimecode values in Blocks, I suggest storing a signed integer (ReferenceTimecode values may be negative). The stored signed integer would be the frame number (players supporting ReferenceTimecode should convert the frame number accordingly to a drop-frame or non-drop-frame display). So if ReferenceTimecodeForm=1, the Block stores 0x00BC, and the frame duration is NTSC, then the displayed value would be 00:00:06:08. The next value 00:00:06:09, etc.

I propose that one block per ReferenceTimecode not be required for simple incrementing ReferenceTimecode, but that the ReferenceTimecode value of the next video frame be considered to be either 1 greater than the previous value (if ReferenceTimecodeForm is 1 or 2) or increased by the duration of the corresponding video frame.

If the ReferenceTimecode is non-continuous then a new ReferenceTimecode value in a new Block with a new Timecode (Matroska meaning of Timecode) could be inserted at the point of the discontinuity.

Dave Rice

More information about the Matroska-devel mailing list