|
3 | 3 | ## Introduction ## {#mpd-patch_introduction} |
4 | 4 |
|
5 | 5 | This feature description is an update to DASH-IF IOP Guidelines v4.3 [[!IOP43]]. |
6 | | -It adds an additional features. |
| 6 | +It adds an additional feature, the MPD Patch, a way provide a differential |
| 7 | +update to a previous dynamic MPD. |
7 | 8 |
|
8 | 9 | ## Scenarios ## {#mpd-patch_scenarios} |
9 | 10 |
|
| 11 | +The typical use case for MPD patch is for dynamic manifests with long |
| 12 | +SegmentTimeline elements due to non-constant segment duration prohibiting |
| 13 | +efficient compression using repeat count. |
| 14 | +This happens when the media frame rate is not commensurable with |
| 15 | +the segment duration. |
| 16 | + |
| 17 | +For example, a 2s average segment duration is not compatible with AAC |
| 18 | +48kHz audio, since it corresponds to 93.75 frames leading to a cycle |
| 19 | +of 4 segments (8s) and the corresponding SegmentTimline pattern: |
| 20 | + |
| 21 | +```xml |
| 22 | +<SegmentTimeline> |
| 23 | + <S t="83498463744000" d="96256" r="2"></S> |
| 24 | + <S d="95232"></S> |
| 25 | + <S d="96256" r="2"></S> |
| 26 | + <S d="95232"></S> |
| 27 | + <!-- continued pattern --> |
| 28 | +</SegmentTimeline> |
| 29 | +``` |
| 30 | + |
| 31 | +For a long sliding window, this results in a huge MPD. With MPD Patch |
| 32 | +one can instead request a delta document, a Patch, describing the changes |
| 33 | +relative to a `publishTime`. |
10 | 34 |
|
11 | 35 | ## Content Offering Requirements and Recommendations ## {#mpd-patch_content-offering} |
12 | 36 |
|
| 37 | +MPD Patch is essentially only useful in the case of `SegmentTemplate with |
| 38 | +SegmentTimeline`. It is especially useful when the segment durations are |
| 39 | +varying leading to long `SegmentTimeline` nodes. It may also help in the |
| 40 | +case of multiple periods of a dynamic MPD. |
| 41 | + |
| 42 | +MPD Patch should NOT be used for for `SegmentTemplate with $Number$` since |
| 43 | +such MPDs typically rarely change, meaning that their content including the |
| 44 | +`publishTime` is the same over a longer period of time. |
| 45 | + |
| 46 | +The `PatchLocation` element in the MPD contains an optional `ttl` attribute |
| 47 | +providing the availability end time relative to the `publishTime`. |
| 48 | +It is recommended to use this value, and set it to relatively small number |
| 49 | +like 1 minute. |
| 50 | + |
| 51 | +The node serving the MPD Patch requests can cache the first response |
| 52 | +with an updated `publishTime` respect to the referred one, provided |
| 53 | +that the time difference is less than the `ttl` value. |
| 54 | + |
| 55 | +A client can therefore NOT assume that the Patch response is providing |
| 56 | +information about the latest publishTime. It follows that he client may need |
| 57 | +to make more MPD Patch requests to arrive at the live edge. |
| 58 | + |
| 59 | +The server response to a too early request for an MPD Patch, |
| 60 | +i.e. before there is a new publishTime, should be the same as when |
| 61 | +asking for a segment before its availability time. That could be |
| 62 | +`404 Not Found` or `425 Too Early`. |
13 | 63 |
|
14 | 64 | ## Client Implementation Requirements and Guidelines ## {#mpd-patch_client} |
15 | 65 |
|
| 66 | +Clients should ignore the `<PatchLocation>` element if not understood. |
| 67 | +If used, they should make a request for an Patch at the same instant |
| 68 | +that they would ask for an updated MPD. |
16 | 69 |
|
| 70 | +If they get a `4XX` response to the Patch request, they should either |
| 71 | +wait and redo the request, or switch to fetching a full MPD. |
17 | 72 |
|
18 | 73 | ## Examples ## {#mpd-patch_examples} |
19 | 74 |
|
20 | | -NOTE_ Add some MPD examples |
| 75 | +Below is an example with a `<PatchLocation>` element and |
| 76 | +`publishTime="2024-04-16T07:34:38Z`. |
| 77 | + |
| 78 | +```xml |
| 79 | +<?xml version="1.0" encoding="UTF-8"?> |
| 80 | +<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 81 | + xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" id="auto-patch-id" |
| 82 | + profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-simple" |
| 83 | + type="dynamic" availabilityStartTime="1970-01-01T00:00:00Z" publishTime="2024-04-16T07:34:38Z" minimumUpdatePeriod="PT2S" |
| 84 | + minBufferTime="PT2S" timeShiftBufferDepth="PT1M" maxSegmentDuration="PT2S"> |
| 85 | + <ProgramInformation moreInformationURL="https://github.com/dash-Industry-Forum/livesim-content"> |
| 86 | + <Title>Basic MPD with 640x480@30 video at 300kbp and 48kbps audio</Title> |
| 87 | + <Source>VoD source for DASH-IF livesim2</Source> |
| 88 | + </ProgramInformation> |
| 89 | + <PatchLocation ttl="60">/patch/livesim2/patch_60/segtimeline_1/testpic_2s/Manifest.mpp?publishTime=2024-04-16T07%3A34%3A38Z</PatchLocation> |
| 90 | + <Period id="P0" start="PT0S"> |
| 91 | + <AdaptationSet id="2" lang="en" contentType="audio" segmentAlignment="true" mimeType="audio/mp4" startWithSAP="1"> |
| 92 | + <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"></Role> |
| 93 | + <SegmentTemplate media="$RepresentationID$/$Time$.m4s" initialization="$RepresentationID$/init.mp4" timescale="48000"> |
| 94 | + <SegmentTimeline> |
| 95 | + <S t="82236135168000" d="96256" r="2"></S> |
| 96 | + <S d="95232"></S> |
| 97 | + <S d="96256" r="2"></S> |
| 98 | + <S d="95232"></S> |
| 99 | + <S d="96256" r="2"></S> |
| 100 | + <S d="95232"></S> |
| 101 | + <S d="96256" r="2"></S> |
| 102 | + <S d="95232"></S> |
| 103 | + <S d="96256" r="2"></S> |
| 104 | + <S d="95232"></S> |
| 105 | + <S d="96256" r="2"></S> |
| 106 | + <S d="95232"></S> |
| 107 | + <S d="96256" r="2"></S> |
| 108 | + <S d="95232"></S> |
| 109 | + <S d="96256" r="2"></S> |
| 110 | + </SegmentTimeline> |
| 111 | + </SegmentTemplate> |
| 112 | + <Representation id="A48" bandwidth="48000" audioSamplingRate="48000" codecs="mp4a.40.2"> |
| 113 | + <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></AudioChannelConfiguration> |
| 114 | + </Representation> |
| 115 | + </AdaptationSet> |
| 116 | + <AdaptationSet id="1" contentType="video" par="16:9" minWidth="640" maxWidth="640" minHeight="360" maxHeight="360" maxFrameRate="60/2" segmentAlignment="true" mimeType="video/mp4" startWithSAP="1"> |
| 117 | + <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"></Role> |
| 118 | + <SegmentTemplate media="$RepresentationID$/$Time$.m4s" initialization="$RepresentationID$/init.mp4" timescale="90000"> |
| 119 | + <SegmentTimeline> |
| 120 | + <S t="154192753440000" d="180000" r="30"></S> |
| 121 | + </SegmentTimeline> |
| 122 | + </SegmentTemplate> |
| 123 | + <Representation id="V300" bandwidth="300000" width="640" height="360" sar="1:1" frameRate="60/2" codecs="avc1.64001e"></Representation> |
| 124 | + </AdaptationSet> |
| 125 | + </Period> |
| 126 | + <UTCTiming schemeIdUri="urn:mpeg:dash:utc:http-xsdate:2014" value="https://time.akamai.com/?iso&ms"></UTCTiming> |
| 127 | +</MPD> |
| 128 | +``` |
| 129 | + |
| 130 | +The segments have an average duration of 2s, so a request 5s after the publishTime |
| 131 | +results in the following PATCH document with a more complex change |
| 132 | +to the audio part than to the video part. |
| 133 | + |
| 134 | +```xml |
| 135 | +<?xml version="1.0" encoding="UTF-8"?> |
| 136 | +<Patch xmlns="urn:mpeg:dash:schema:mpd-patch:2020" |
| 137 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 138 | + xsi:schemaLocation="urn:mpeg:dash:schema:mpd-patch:2020 DASH-MPD-PATCH.xsd" mpdId="auto-patch-id" originalPublishTime="2024-04-16T07:34:38Z" publishTime="2024-04-16T07:34:42Z"> |
| 139 | + <replace sel="/MPD/@publishTime">2024-04-16T07:34:42Z</replace> |
| 140 | + <replace sel="/MPD/PatchLocation[1]"> |
| 141 | + <PatchLocation ttl="60">/patch/livesim2/patch_60/segtimeline_1/testpic_2s/Manifest.mpp?publishTime=2024-04-16T07%3A34%3A42Z</PatchLocation> |
| 142 | + </replace> |
| 143 | + <remove sel="/MPD/Period[@id='P0']/AdaptationSet[@id='2']/SegmentTemplate/SegmentTimeline/S[1]"/> |
| 144 | + <add sel="/MPD/Period[@id='P0']/AdaptationSet[@id='2']/SegmentTemplate/SegmentTimeline" pos="prepend"> |
| 145 | + <S t="82236135360512" d="96256"/> |
| 146 | + </add> |
| 147 | + <add sel="/MPD/Period[@id='P0']/AdaptationSet[@id='2']/SegmentTemplate/SegmentTimeline/S[15]" pos="after"> |
| 148 | + <S d="95232"/> |
| 149 | + </add> |
| 150 | + <add sel="/MPD/Period[@id='P0']/AdaptationSet[@id='2']/SegmentTemplate/SegmentTimeline/S[16]" pos="after"> |
| 151 | + <S d="96256"/> |
| 152 | + </add> |
| 153 | + <remove sel="/MPD/Period[@id='P0']/AdaptationSet[@id='1']/SegmentTemplate/SegmentTimeline/S[1]"/> |
| 154 | + <add sel="/MPD/Period[@id='P0']/AdaptationSet[@id='1']/SegmentTemplate/SegmentTimeline" pos="prepend"> |
| 155 | + <S t="154192753800000" d="180000" r="30"/> |
| 156 | + </add> |
| 157 | +</Patch> |
| 158 | +``` |
21 | 159 |
|
22 | 160 | ## Reference Tools ## {#mpd-patch_reference-tools} |
23 | 161 |
|
24 | | -NOTE_ provide status for the following functionalities |
25 | | - * Dash.js |
26 | | - * Live Sim |
27 | | - * Test Vectors |
| 162 | +NOTE: provide status for the following functionalities |
| 163 | + |
| 164 | + * dash.js supports MPD Patch for `SegmentTemplate with SegmentTimeline`. |
| 165 | + It has been tested towards [livesim2][livesim2] including cases with |
| 166 | + multiple periods. If a 4XX response is received, it will switches to |
| 167 | + ordinary full MPD requests (Daniel to confirm) |
| 168 | + * [livesim2][livesim2] supports MPD DASH. There is [Wiki article][livesim2-wiki] |
| 169 | + describing how it works |
| 170 | + * Test Vectors. One can get test vectors from the |
| 171 | + [DASH-IF instance of livesim2][livesim2-instance], e.g. |
| 172 | + [https://livesim2.dashif.org/livesim2/patch_60/segtimeline_1/testpic_2s/Manifest.mpd][livesim2-entry]. |
| 173 | + Use the [urlgen][urlgen] page to generate other test vectors. |
28 | 174 | * JCCP |
29 | 175 |
|
30 | 176 | ## Additional Information ## {#mpd-patch_additional-information} |
31 | 177 |
|
32 | | - |
33 | | - |
| 178 | +[livesim2]: https://github.com/Dash-Industry-Forum/livesim2 |
| 179 | +[livesim2-wiki]: https://github.com/Dash-Industry-Forum/livesim2/wiki/MPD-Patch |
| 180 | +[livesim2-instance]: https://livesim2.dashif.org |
| 181 | +[livesim2-entry]:https://livesim2.dashif.org/livesim2/patch_60/segtimeline_1/testpic_2s/Manifest.mpd |
| 182 | +[urlgen]: https://livesim2.dashif.org/urlgen |
0 commit comments