Each representation’s segments are found in one of three ways:
SegmentBase (one file, with an index), SegmentList (an
explicit list) or SegmentTemplate (addresses built from a pattern). The
element may be written on the period, the adaptation set or the representation; a
lower level inherits from a higher one and overrides what it sets. Relative addresses
are resolved against the nearest BaseURLs.
SegmentBase
These attributes are also on SegmentList and
SegmentTemplate.
| Attribute | Type | Meaning |
|---|---|---|
timescale | whole number | Units per second for every time value here (default 1). |
presentationTimeOffset | whole number | The media time, in timescale units, that corresponds to the start of the period; subtracted from media timestamps. |
presentationDuration | whole number | How long the representation lasts in the period, in timescale units. |
eptDelta, pdDelta | integers | Corrections to the earliest presentation time and the presentation duration (later editions). |
timeShiftBufferDepth | duration | A time-shift depth for this representation. |
indexRange | byte range first-last | Where the segment index (the sidx box) is in the file. |
indexRangeExact | boolean, default false | Whether indexRange is exactly the index, or may hold more. |
availabilityTimeOffset | seconds | Segments are available this much earlier than normal. |
availabilityTimeComplete | boolean | false: a segment may still be incomplete when it first becomes available (low latency). |
| Child | Meaning |
|---|---|
Initialization | The initialisation segment: sourceURL and range. Without sourceURL, the range is in the media file itself. |
RepresentationIndex | A separate index segment, in the same form. |
FailoverContent | Times when the content is replacement content, with valid (default true) and FCS children, each a start time t (required) and duration d. |
SegmentList and SegmentTemplate: shared parts
| Attribute | Type | Meaning |
|---|---|---|
duration | whole number | The length of every segment in timescale units, when they are all the same (except perhaps the last). |
startNumber | whole number | The number of the first segment in the period (default 1). |
endNumber | whole number | The number of the last segment. |
endSubNumber, k, tolerance (default 50.0) | numbers | Later additions for segment sequences and timing tolerance; see the standard. |
Children: SegmentTimeline (below) and BitstreamSwitching, a
segment to send when switching representation.
SegmentList
A list of SegmentURL elements, one per segment, in order.
SegmentURL attribute | Meaning |
|---|---|
media | The segment’s address. |
mediaRange | Its byte range within that address. |
index, indexRange | Its index segment, and the index’s byte range. |
SegmentTemplate
| Attribute | Meaning |
|---|---|
media | The pattern for media segment addresses. |
initialization | The pattern for the initialisation segment. |
index | The pattern for index segments. |
bitstreamSwitching | The pattern for the bitstream switching segment. |
| Identifier | Replaced by |
|---|---|
$RepresentationID$ | The representation’s id |
$Number$ | The segment number, counting from startNumber |
$Time$ | The segment’s start time in timescale units, from the timeline |
$Bandwidth$ | The representation’s bandwidth |
$SubNumber$ | The number of a segment within a segment sequence (later editions) |
$$ | A single $ |
$Number$, $Time$, $Bandwidth$ and
$SubNumber$ may carry a width, as in C’s printf:
$Number%05d$ gives 00042. A template uses either
$Number$ or $Time$, not both.
SegmentTimeline
When segments differ in length, a timeline lists them as runs of S
elements.
S attribute | Type | Meaning |
|---|---|---|
t | whole number | Start time in timescale units. If absent, the end of the previous run. |
n | whole number | The number of the first segment in the run. |
d | whole number | Duration of each segment in the run. |
r | integer, default 0 | How many more segments of the same duration follow. -1 repeats until the next S or the end of the period. |
k | whole number, default 1 | Segments per segment sequence (later editions). |
p, pE (default 0) | whole numbers | A Pattern of durations to use, by id, and the entry to start at (sixth edition). |
ssp | whole number | Refers to segment sequence properties (sixth edition). |
A Pattern (attribute id, required) holds P
elements with d, r (default 0), k (default 1)
and ssp: a repeating sequence of durations, such as audio segments that
alternate in length.
Worked example
<BaseURL>https://cdn.example.com/vod/</BaseURL>
…
<SegmentTemplate timescale="90000"
initialization="$RepresentationID$/init.mp4"
media="$RepresentationID$/$Time$.m4s">
<SegmentTimeline>
<S t="0" d="180180" r="2"/>
<S d="90090"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="v720" bandwidth="3000000"/>
v720/0.m4s, v720/180180.m4s,
v720/360360.m4s and v720/540540.m4s, all under
https://cdn.example.com/vod/.