0
votes

Below is a rather long introduction to the question, which is an analysis of the ISO/IEC norm 23009-1:2019 ("Information technology — Dynamic adaptive streaming over HTTP (DASH) — Part 1: Media presentation description and segment formats").

Introduction

ISO/IEC 23009-1:2019, 5.3.9.4.4, Table 20 specifies how to substitute the $Time$ identifier when constructing segment URLs of a DASH stream:

This identifier is substituted with the value of the MPD start time of the Segment being accessed. For the Segment Timeline, this means that this identifier is substituted with the value of the SegmentTimeline@t attribute for the Segment being accessed. Either $Number$or $Time$ may be used but not both at the same time.

However, when SegmentTemplate@presentationTimeOffset is non-zero, the two methods above are mutually exclusive.

The first method ("This identifier is substituted with the value of the MPD start time of the Segment being accessed") is also repeated in 5.3.9.5.3:

If the Representation contains or inherits a SegmentTemplate element with $Time$ then the URL of the media segment at position k is determined by replacing the $Time$ identifier by MPD start time of this segment, as described below.

The norm defines the MPD start time in 5.3.9.6.1:

The value of the @t attribute minus the value of the @presentationTimeOffset specifies the MPD start time of the first Segment in the series

Also A.3.3 seems to confirm the first method more formally:

If the Representation contains or inherits a SegmentTemplate element with $Time$ then the URL of the Media Segment i, MediaSegment.URL[i], is obtained by replacing the $Time$ identifier by MediaSegment[i].startTime in the SegmentTemplate@media string, as described in subclause 5.3.9.5.3.

since MediaSegment[i].startTime is defined earlier as:

— MediaSegment[N].startTime=t[s]−o

(although the unit of MediaSegment[N].startTime is seconds, which is clearly incorrect, as the value of the substitution should be expressed in timescale units to avoid confusion caused by rounding)

But the second method, specified as equivalent to the first one ("[...] this means that this identifier is substituted with the value of the SegmentTimeline@t attribute [...]"), directly contradicts the first.

Also at the end of 5.3.9.6.1 we find that:

— The Segment URL for a Media Segment is obtained by replacing the $Time$ identifier by the earliest presentation time obtained from the SegmentTimeline.

which seems to be in line with the second method, as the term earliest presentation time is defined in 3.1.13 in terms of the media segments, and without any relation to the MPD document.

Question

According to ISO/IEC 23009-1:2019, what is the correct value to substitute for $Time$? Is it SegmentTimeline.S@t or SegmentTimeline.S@t - SegmentTemplate@presentationTimeOffset?

History of ISO/IEC 23009-1

It looks like the idea of addressing segments using $Time$ template placeholder not by their earliest presentation time, but rather by earliest presentation time adjusted with PTO has evolved over time.

If we go back to ISO/IEC 23009-1:2014, we can see that the description of $Time$ in 5.3.9.4.4, Table 16 (Table 20 in 2019 norm), the term "MPD start time" is not used:

This identifier is substituted with the value of the SegmentTimeline@t attribute for the Segment being accessed. [...]

This seems to have not been confusing. We can also see in 5.3.9.5.3, that:

— If the Representation contains or inherits a SegmentTemplate element with $Time$ then the URL of the media segment at position k is determined by replacing the $Time$ identifier by the time address associated to this Segment. The time address is determined as follows:

[...]

if the SegmentTimeline element is present, then the time address shall be determined by replacing the $Time$ identifier with the earliest presentation time of the k-th segment as documented in the Segment timeline in 5.3.9.6.

which seems to have conveyed the same intentions as parts of 2019 norm. Also the part from the 2019 norm:

The Segment URL for a Media Segment is obtained by replacing the $Time$ identifier by the earliest presentation time obtained from the SegmentTimeline.

is present in the 2014 norm.

However, the 2014 norm did already contain the text:

If the Representation contains or inherits a SegmentTemplate element with $Time$ then the URL of the Media Segment i, MediaSegment.URL[i], is obtained by replacing the $Time$ identifier by MediaSegment[i].startTime in the SegmentTemplate@media string.

while having the same pseudo-code definition of MediaSegment[i].startTime as the 2019 norm, which is rather confusing and contradictory to the above statements. Nonetheless, I find the 2014 norm less confusing, as the above quote is the only one I found suggesting that PTO should be considered while calculating segment URL.

If we go back in time even more, the 2012 norm seems to cause no confusion regarding the substitution of $Time$, as it only refers to it twice, once claiming that earliest presentation time should be used, and the other time, that @t should be used and the 2 references can be considered equivalent. Also the presence of presentationTimeOffset in this version of the norm is almost negligible, and it is hard to understand its relevance without changes introduced in later versions.

1

1 Answers

1
votes

According to ISO/IEC 23009-1:2019, what is the correct value to substitute for $Time$? Is it SegmentTimeline.S@t or SegmentTimeline.S@t - SegmentTemplate@presentationTimeOffset?

The correct value is SegmentTimeline.S@t.

presentationTimeOffset is used to offset the timestamps inside the media so the samples are placed in the correct position on the media timeline.