Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/packager/hls_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ struct HlsParams {
std::optional<double> start_time_offset;
/// Create EXT-X-SESSION-KEY in master playlist
bool create_session_keys;
/// Don't map codecs to preferred codec value
bool strict_codecs_signaling;
};

} // namespace shaka
Expand Down
7 changes: 7 additions & 0 deletions packager/app/hls_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ ABSL_FLAG(bool,
false,
"Playback of Offline HLS assets shall use EXT-X-SESSION-KEY "
"to declare all eligible content keys in the master playlist.");
ABSL_FLAG(bool,
strict_codecs_signaling,
false,
"Don't map codecs to a preferred codec value, but strictly "
"preserve the fourcc in the media. This may cause playback "
"issues on some Apple devices, but strictly complies with the "
"HLS specification.");
1 change: 1 addition & 0 deletions packager/app/hls_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ ABSL_DECLARE_FLAG(std::string, hls_playlist_type);
ABSL_DECLARE_FLAG(int32_t, hls_media_sequence_number);
ABSL_DECLARE_FLAG(std::optional<double>, hls_start_time_offset);
ABSL_DECLARE_FLAG(bool, create_session_keys);
ABSL_DECLARE_FLAG(bool, strict_codecs_signaling);

#endif // PACKAGER_APP_HLS_FLAGS_H_
2 changes: 2 additions & 0 deletions packager/app/packager_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@ std::optional<PackagingParams> GetPackagingParams() {
absl::GetFlag(FLAGS_hls_media_sequence_number);
hls_params.start_time_offset = absl::GetFlag(FLAGS_hls_start_time_offset);
hls_params.create_session_keys = absl::GetFlag(FLAGS_create_session_keys);
hls_params.strict_codecs_signaling =
absl::GetFlag(FLAGS_strict_codecs_signaling);

TestParams& test_params = packaging_params.test_params;
test_params.dump_stream_info = absl::GetFlag(FLAGS_dump_stream_info);
Expand Down
176 changes: 175 additions & 1 deletion packager/app/test/packager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ def _GetFlags(self,
dash_force_segment_list=False,
force_cl_index=None,
start_segment_number=None,
use_dovi_supplemental_codecs=None):
use_dovi_supplemental_codecs=None,
strict_codecs_signaling=None):
flags = ['--single_threaded']

if not strip_parameter_set_nalus:
Expand Down Expand Up @@ -550,6 +551,9 @@ def _GetFlags(self,
if use_dovi_supplemental_codecs:
flags.append('--use_dovi_supplemental_codecs')

if strict_codecs_signaling:
flags.append('--strict_codecs_signaling')

if output_media_info:
flags.append('--output_media_info')
if output_dash:
Expand Down Expand Up @@ -1536,6 +1540,176 @@ def testDolbyVisionProfile10UsingSupplementalCodecs(self):
self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-profile-10-supplemental-codecs')

def testDolbyVisionDvh1P81(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvh1_081_1920x1080.mp4')
]
flags = self._GetFlags(output_dash=True, output_hls=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvh1-p81')

def testDolbyVisionDvh1P84(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvh1_084_1920x1080.mp4')
]
flags = self._GetFlags(output_dash=True, output_hls=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvh1-p84')

def testDolbyVisionDvheP81(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvhe_081_1920x1080.mp4')
]
flags = self._GetFlags(output_dash=True, output_hls=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvhe-p81')

def testDolbyVisionDvheP84(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvhe_084_1920x1080.mp4')
]
flags = self._GetFlags(output_dash=True, output_hls=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvhe-p84')

def testDolbyVisionDvh1P81UsingSupplementalCodecs(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvh1_081_1920x1080.mp4')
]
flags = self._GetFlags(output_dash=True,
output_hls=True,
use_dovi_supplemental_codecs=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvh1-p81-with-supplemental-codecs')

def testDolbyVisionDvh1P84UsingSupplementalCodecs(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvh1_084_1920x1080.mp4')
]
flags = self._GetFlags(output_dash=True,
output_hls=True,
use_dovi_supplemental_codecs=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvh1-p84-with-supplemental-codecs')

def testDolbyVisionDvheP81UsingSupplementalCodecs(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvhe_081_1920x1080.mp4')
]
flags = self._GetFlags(output_dash=True,
output_hls=True,
use_dovi_supplemental_codecs=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvhe-p81-with-supplemental-codecs')

def testDolbyVisionDvheP84UsingSupplementalCodecs(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvhe_084_1920x1080.mp4')
]
flags = self._GetFlags(output_dash=True,
output_hls=True,
use_dovi_supplemental_codecs=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvhe-p84-with-supplemental-codecs')


def testDolbyVisionDvh1P81WithEncryption(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvh1_081_1920x1080.mp4')
]
flags = self._GetFlags(encryption=True, output_dash=True, output_hls=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvh1-p81-with-encryption')

def testDolbyVisionDvh1P84WithEncryption(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvh1_084_1920x1080.mp4')
]
flags = self._GetFlags(encryption=True, output_dash=True, output_hls=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvh1-p84-with-encryption')

def testDolbyVisionDvheP81WithEncryption(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvhe_081_1920x1080.mp4')
]

flags = self._GetFlags(encryption=True, output_dash=True, output_hls=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvhe-p81-with-encryption')

def testDolbyVisionDvheP84WithEncryption(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvhe_084_1920x1080.mp4')
]
flags = self._GetFlags(encryption=True, output_dash=True, output_hls=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvhe-p84-with-encryption')

def testDolbyVisionDvh1P81WithStrictCodecsSignaling(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvh1_081_1920x1080.mp4')
]
flags = self._GetFlags(output_hls=True, strict_codecs_signaling=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvh1-p81-with-strict-codecs-signaling')

def testDolbyVisionDvh1P84WithStrictCodecsSignaling(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvh1_084_1920x1080.mp4')
]
flags = self._GetFlags(output_hls=True, strict_codecs_signaling=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvh1-p84-with-strict-codecs-signaling')

def testDolbyVisionDvheP81WithStrictCodecsSignaling(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvhe_081_1920x1080.mp4')
]
flags = self._GetFlags(output_hls=True, strict_codecs_signaling=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvhe-p81-with-strict-codecs-signaling')

def testDolbyVisionDvheP84WithStrictCodecsSignaling(self):
streams = [
self._GetStream('video',
test_file='color_pattern_24_dvhe_084_1920x1080.mp4')
]
flags = self._GetFlags(output_hls=True, strict_codecs_signaling=True)

self.assertPackageSuccess(streams, flags)
self._CheckTestResults('dolby-vision-dvhe-p84-with-strict-codecs-signaling')

def testVp8Mp4WithEncryption(self):
streams = [
self._GetStream('video',
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#EXTM3U
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>

#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-STREAM-INF:BANDWIDTH=163596,AVERAGE-BANDWIDTH=162709,CODECS="hvc1.2.4.L120.b0",RESOLUTION=1920x1080,FRAME-RATE=24.000,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE
stream_0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=163596,AVERAGE-BANDWIDTH=162709,CODECS="dvh1.08.03",RESOLUTION=1920x1080,FRAME-RATE=24.000,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE
stream_0.m3u8
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>-->
<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" xmlns:cenc="urn:mpeg:cenc:2013" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT10S">
<Period id="0">
<AdaptationSet id="0" contentType="video" width="1920" height="1080" frameRate="24000/1000" subsegmentAlignment="true" par="16:9">
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:MatrixCoefficients" value="9"/>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:ColourPrimaries" value="9"/>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:TransferCharacteristics" value="16"/>
<ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="31323334-3536-3738-3930-313233343536"/>
<ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b">
<cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAExMjM0NTY3ODkwMTIzNDU2AAAAAA==</cenc:pssh>
</ContentProtection>
<Representation id="0" bandwidth="163596" codecs="hvc1.2.4.L120.b0" mimeType="video/mp4" sar="1:1">
<BaseURL>color_pattern_24_dvh1_081_1920x1080-video.mp4</BaseURL>
<SegmentBase indexRange="1356-1447" timescale="24000">
<Initialization range="0-1355"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet id="1" contentType="video" width="1920" height="1080" frameRate="24000/1000" subsegmentAlignment="true" par="16:9">
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:MatrixCoefficients" value="9"/>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:ColourPrimaries" value="9"/>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:TransferCharacteristics" value="16"/>
<ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="31323334-3536-3738-3930-313233343536"/>
<ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b">
<cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAExMjM0NTY3ODkwMTIzNDU2AAAAAA==</cenc:pssh>
</ContentProtection>
<Representation id="0" bandwidth="163596" codecs="dvh1.08.03" mimeType="video/mp4" sar="1:1">
<BaseURL>color_pattern_24_dvh1_081_1920x1080-video.mp4</BaseURL>
<SegmentBase indexRange="1356-1447" timescale="24000">
<Initialization range="0-1355"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="color_pattern_24_dvh1_081_1920x1080-video.mp4",BYTERANGE="1356@0"
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790@1448
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:40899
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:40899
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:40899
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:40899
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXT-X-ENDLIST
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#EXTM3U
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>

#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-STREAM-INF:BANDWIDTH=159160,AVERAGE-BANDWIDTH=159160,CODECS="hvc1.2.4.L120.b0",RESOLUTION=1920x1080,FRAME-RATE=24.000,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE
stream_0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=159160,AVERAGE-BANDWIDTH=159160,CODECS="dvh1.08.03",RESOLUTION=1920x1080,FRAME-RATE=24.000,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE
stream_0.m3u8
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="color_pattern_24_dvh1_081_1920x1080-video.mp4",BYTERANGE="963@0"
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790@1055
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXT-X-ENDLIST
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#EXTM3U
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>

#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-STREAM-INF:BANDWIDTH=159160,AVERAGE-BANDWIDTH=159160,CODECS="hvc1.2.4.L120.b0",SUPPLEMENTAL-CODECS="dvh1.08.03/db1p",RESOLUTION=1920x1080,FRAME-RATE=24.000,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE
stream_0.m3u8
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>-->
<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" xmlns:scte214="urn:scte:dash:scte214-extensions" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT10S">
<Period id="0">
<AdaptationSet id="0" contentType="video" width="1920" height="1080" frameRate="24000/1000" subsegmentAlignment="true" par="16:9">
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:MatrixCoefficients" value="9"/>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:ColourPrimaries" value="9"/>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:TransferCharacteristics" value="16"/>
<Representation id="0" bandwidth="159160" codecs="hvc1.2.4.L120.b0" mimeType="video/mp4" scte214:supplementalCodecs="dvh1.08.03" scte214:supplementalProfiles="db1p" sar="1:1">
<BaseURL>color_pattern_24_dvh1_081_1920x1080-video.mp4</BaseURL>
<SegmentBase indexRange="967-1058" timescale="24000">
<Initialization range="0-966"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="color_pattern_24_dvh1_081_1920x1080-video.mp4",BYTERANGE="967@0"
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790@1059
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXTINF:2.000,
#EXT-X-BYTERANGE:39790
color_pattern_24_dvh1_081_1920x1080-video.mp4
#EXT-X-ENDLIST
Binary file not shown.
9 changes: 9 additions & 0 deletions packager/app/test/testdata/dolby-vision-dvh1-p81/output.m3u8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#EXTM3U
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>

#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-STREAM-INF:BANDWIDTH=159160,AVERAGE-BANDWIDTH=159160,CODECS="hvc1.2.4.L120.b0",RESOLUTION=1920x1080,FRAME-RATE=24.000,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE
stream_0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=159160,AVERAGE-BANDWIDTH=159160,CODECS="dvh1.08.03",RESOLUTION=1920x1080,FRAME-RATE=24.000,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE
stream_0.m3u8
Loading
Loading