When the relationship between media time, MOQT Location and wallclock time follows a regular, predictable pattern, a media timeline template MAY be used instead of an explicit media timeline track. The template approach is best suited for content with fixed-duration segments, such as VOD assets or live broadcasts with constant segment durations. For content with variable segment durations, the explicit media timeline track (Section 7.1) MUST be used instead.
7.4.1. Template Format
A media timeline template is expressed as an inline track attribute using the Section 5.2.15 field. The template is a JSON Array containing six mandatory values in the following fixed order:
-
startMediaTime - The media presentation timestamp of the first entry, as defined for media timeline entries in Section 7.1.1.
-
deltaMediaTime - The constant interval between media presentation timestamps, expressed as a JSON Number in milliseconds.
-
startLocation - The MOQT Location of the first entry, as defined for media timeline entries in Section 7.1.1.
-
deltaLocation - The constant interval between MOQT Locations, expressed as a JSON Array of two Numbers where the first number is the Group ID delta and the second number is the Object ID delta.
-
startWallclock - The wallclock time of the first entry, as defined for media timeline entries in Section 7.1.1. For VOD assets, or if the wallclock time is not known, the value SHOULD be 0.
-
deltaWallclock - The constant interval between wallclock times, expressed as a JSON Number in milliseconds. For VOD assets, or if the wallclock time is not known, the value SHOULD be 0.
All six values are mandatory and MUST appear in the specified order.
Clients compute entry values using the following formulas, where n is the zero-based entry index:
mediaTime[n] = startMediaTime + (n * deltaMediaTime)
location[n] = [startLocation[0] + (n * deltaLocation[0]),
startLocation[1] + (n * deltaLocation[1])]
wallclock[n] = startWallclock + (n * deltaWallclock)
An example template value is shown below:
[0, 2002, [0, 0], [1, 0], 1759924158381, 2002]
This template indicates that the first entry has media time 0ms, location [0,0], and wallclock time 1759924158381. Each subsequent entry increments media time by 2002ms, location by [1,0] (next group, same object), and wallclock by 2002ms.
7.4.2. Template Immutability
Unlike the explicit media timeline track, the media timeline template is intended to be immutable once publishing starts. Publishers MUST NOT change the template values for a track after the first Object has been published.