Skip to content

Commit 94db9c9

Browse files
authored
fix: adaptation set IDs were referenced by lowest representation ID (#1394)
After change to add forced command line ordering adaptation set IDs in places were referenced by their sort index (the minimum representation index they contained). Instead always refer to adaptation sets by their own ID, and use the index only as an optional sort key. Fixes #1393
1 parent 52647b9 commit 94db9c9

File tree

14 files changed

+47
-28
lines changed

14 files changed

+47
-28
lines changed

packager/app/test/packager_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,9 @@ def testLiveStaticProfileWithTimeInSegmentName(self):
17041704

17051705
def testAllowCodecSwitching(self):
17061706
streams = [
1707+
self._GetStream('video', test_file='bear-1280x720-hevc.mp4'),
17071708
self._GetStream('video', test_file='bear-640x360-hevc.mp4'),
1709+
self._GetStream('video', test_file='bear-640x360-vp9.mp4'),
17081710
self._GetStream('video', test_file='bear-640x360.mp4'),
17091711
self._GetStream('video', test_file='bear-1280x720.mp4'),
17101712
self._GetStream('audio', test_file='bear-640x360.mp4'),

packager/app/test/testdata/audio-video-with-codec-switching-and-forced-commandline_order/output.mpd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</Representation>
1313
</AdaptationSet>
1414
<AdaptationSet id="1" contentType="video" width="640" height="360" frameRate="30000/1001" subsegmentAlignment="true" par="16:9">
15-
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="2"/>
15+
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="0"/>
1616
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
1717
<Representation id="1" bandwidth="277411" codecs="hev1.1.6.L63.90" mimeType="video/mp4" sar="1:1">
1818
<BaseURL>bear-640x360-hevc-video.mp4</BaseURL>

packager/app/test/testdata/audio-video-with-codec-switching-encryption-trick-play/output.mpd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b">
88
<cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAExMjM0NTY3ODkwMTIzNDU2AAAAAA==</cenc:pssh>
99
</ContentProtection>
10-
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="1"/>
10+
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="0"/>
1111
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
1212
<Representation id="0" bandwidth="281671" codecs="hev1.1.6.L63.90" mimeType="video/mp4" sar="1:1">
1313
<BaseURL>bear-640x360-hevc-video.mp4</BaseURL>
@@ -21,7 +21,7 @@
2121
<ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b">
2222
<cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAExMjM0NTY3ODkwMTIzNDU2AAAAAA==</cenc:pssh>
2323
</ContentProtection>
24-
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="0"/>
24+
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="2"/>
2525
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
2626
<Representation id="1" bandwidth="977743" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1" width="640" height="360">
2727
<BaseURL>bear-640x360-video.mp4</BaseURL>
@@ -41,7 +41,7 @@
4141
<ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b">
4242
<cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAExMjM0NTY3ODkwMTIzNDU2AAAAAA==</cenc:pssh>
4343
</ContentProtection>
44-
<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="1"/>
44+
<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="0"/>
4545
<Representation id="3" bandwidth="470530" codecs="avc1.64001f" mimeType="video/mp4" sar="1:1" maxPlayoutRate="30" codingDependency="false">
4646
<BaseURL>bear-1280x720-video-trick_play_factor_1.mp4</BaseURL>
4747
<SegmentBase indexRange="1136-1203" timescale="30000">

packager/app/test/testdata/audio-video-with-codec-switching/output.mpd

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,50 @@
22
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>-->
33
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.8028S">
44
<Period id="0">
5-
<AdaptationSet id="0" contentType="video" width="640" height="360" frameRate="30000/1001" subsegmentAlignment="true" par="16:9">
6-
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="1"/>
5+
<AdaptationSet id="0" contentType="video" maxWidth="1280" maxHeight="720" frameRate="30000/1001" par="16:9">
6+
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="1,2"/>
77
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
8-
<Representation id="0" bandwidth="277411" codecs="hev1.1.6.L63.90" mimeType="video/mp4" sar="1:1">
8+
<Representation id="0" bandwidth="564516" codecs="hev1.1.6.L93.90" mimeType="video/mp4" sar="1:1" width="1280" height="720">
9+
<BaseURL>bear-1280x720-hevc-video.mp4</BaseURL>
10+
<SegmentBase indexRange="3283-3350" timescale="30000">
11+
<Initialization range="0-3282"/>
12+
</SegmentBase>
13+
</Representation>
14+
<Representation id="1" bandwidth="277411" codecs="hev1.1.6.L63.90" mimeType="video/mp4" sar="1:1" width="640" height="360">
915
<BaseURL>bear-640x360-hevc-video.mp4</BaseURL>
1016
<SegmentBase indexRange="1910-1977" timescale="30000">
1117
<Initialization range="0-1909"/>
1218
</SegmentBase>
1319
</Representation>
1420
</AdaptationSet>
15-
<AdaptationSet id="1" contentType="video" maxWidth="1280" maxHeight="720" frameRate="30000/1001" subsegmentAlignment="true" par="16:9">
16-
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="0"/>
21+
<AdaptationSet id="1" contentType="video" width="640" height="360" frameRate="30000/1001" subsegmentAlignment="true" par="16:9">
22+
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="0,1"/>
23+
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
24+
<Representation id="2" bandwidth="631481" codecs="vp09.00.21.08.00.02.02.02.00" mimeType="video/mp4" sar="1:1">
25+
<BaseURL>bear-640x360-vp9-video.mp4</BaseURL>
26+
<SegmentBase indexRange="804-871" timescale="30000">
27+
<Initialization range="0-803"/>
28+
</SegmentBase>
29+
</Representation>
30+
</AdaptationSet>
31+
<AdaptationSet id="2" contentType="video" maxWidth="1280" maxHeight="720" frameRate="30000/1001" subsegmentAlignment="true" par="16:9">
32+
<SupplementalProperty schemeIdUri="urn:mpeg:dash:adaptation-set-switching:2016" value="0,2"/>
1733
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
18-
<Representation id="1" bandwidth="973483" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1" width="640" height="360">
34+
<Representation id="3" bandwidth="973483" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1" width="640" height="360">
1935
<BaseURL>bear-640x360-video.mp4</BaseURL>
2036
<SegmentBase indexRange="870-937" timescale="30000">
2137
<Initialization range="0-869"/>
2238
</SegmentBase>
2339
</Representation>
24-
<Representation id="2" bandwidth="2627285" codecs="avc1.64001f" mimeType="video/mp4" sar="1:1" width="1280" height="720">
40+
<Representation id="4" bandwidth="2627285" codecs="avc1.64001f" mimeType="video/mp4" sar="1:1" width="1280" height="720">
2541
<BaseURL>bear-1280x720-video.mp4</BaseURL>
2642
<SegmentBase indexRange="869-936" timescale="30000">
2743
<Initialization range="0-868"/>
2844
</SegmentBase>
2945
</Representation>
3046
</AdaptationSet>
31-
<AdaptationSet id="2" contentType="audio" subsegmentStartsWithSAP="1" subsegmentAlignment="true">
32-
<Representation id="3" bandwidth="133334" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="44100">
47+
<AdaptationSet id="3" contentType="audio" subsegmentStartsWithSAP="1" subsegmentAlignment="true">
48+
<Representation id="5" bandwidth="133334" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="44100">
3349
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
3450
<BaseURL>bear-640x360-audio.mp4</BaseURL>
3551
<SegmentBase indexRange="804-871" timescale="44100">

packager/app/test/testdata/audio-video-with-trick-play/output.mpd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</Representation>
2121
</AdaptationSet>
2222
<AdaptationSet id="2" contentType="video" width="640" height="360" frameRate="30000/30030" subsegmentAlignment="true" par="16:9">
23-
<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="1"/>
23+
<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="0"/>
2424
<Representation id="2" bandwidth="211545" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1" maxPlayoutRate="30" codingDependency="false">
2525
<BaseURL>bear-640x360-video-trick_play_factor_1.mp4</BaseURL>
2626
<SegmentBase indexRange="870-937" timescale="30000">

packager/app/test/testdata/encryption-and-trick-play/output.mpd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b">
3333
<cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAExMjM0NTY3ODkwMTIzNDU2AAAAAA==</cenc:pssh>
3434
</ContentProtection>
35-
<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="1"/>
35+
<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="0"/>
3636
<Representation id="2" bandwidth="212297" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1" maxPlayoutRate="30" codingDependency="false">
3737
<BaseURL>bear-640x360-video-trick_play_factor_1.mp4</BaseURL>
3838
<SegmentBase indexRange="1138-1205" timescale="30000">

packager/app/test/testdata/encryption-and-two-trick-plays/output.mpd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b">
3333
<cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAExMjM0NTY3ODkwMTIzNDU2AAAAAA==</cenc:pssh>
3434
</ContentProtection>
35-
<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="1"/>
35+
<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="0"/>
3636
<Representation id="2" bandwidth="212297" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1" frameRate="30000/30030" maxPlayoutRate="30" codingDependency="false">
3737
<BaseURL>bear-640x360-video-trick_play_factor_1.mp4</BaseURL>
3838
<SegmentBase indexRange="1138-1205" timescale="30000">
Binary file not shown.

0 commit comments

Comments
 (0)