Skip to content

Commit

Permalink
fix(MP4): Add compatible brand dby1 for Dolby content. (shaka-project…
Browse files Browse the repository at this point in the history
  • Loading branch information
sr1990 authored Jul 19, 2023
1 parent d6f28d4 commit 520926c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</ContentProtection>
<Representation id="0" bandwidth="820260" codecs="dvh1.05.01" mimeType="video/mp4" sar="1:1">
<BaseURL>sparks_dovi_5-video.mp4</BaseURL>
<SegmentBase indexRange="1366-1445" timescale="60000">
<Initialization range="0-1365"/>
<SegmentBase indexRange="1370-1449" timescale="60000">
<Initialization range="0-1369"/>
</SegmentBase>
</Representation>
</AdaptationSet>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:3
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="sparks_dovi_5-video.mp4",BYTERANGE="1366@0"
#EXT-X-MAP:URI="sparks_dovi_5-video.mp4",BYTERANGE="1370@0"
#EXT-X-KEY:METHOD=SAMPLE-AES-CTR,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",KEYFORMAT="identity"
#EXTINF:2.002,
#EXT-X-BYTERANGE:185521@1446
#EXT-X-BYTERANGE:185521@1450
sparks_dovi_5-video.mp4
#EXTINF:2.002,
#EXT-X-BYTERANGE:197565
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</ContentProtection>
<Representation id="0" bandwidth="818598" codecs="hvc1.2.4.L90.90" mimeType="video/mp4" sar="1:1">
<BaseURL>sparks_dovi_8-video.mp4</BaseURL>
<SegmentBase indexRange="1366-1445" timescale="60000">
<Initialization range="0-1365"/>
<SegmentBase indexRange="1370-1449" timescale="60000">
<Initialization range="0-1369"/>
</SegmentBase>
</Representation>
</AdaptationSet>
Expand All @@ -21,8 +21,8 @@
</ContentProtection>
<Representation id="1" bandwidth="818598" codecs="dvh1.08.01" mimeType="video/mp4" sar="1:1">
<BaseURL>sparks_dovi_8-video.mp4</BaseURL>
<SegmentBase indexRange="1366-1445" timescale="60000">
<Initialization range="0-1365"/>
<SegmentBase indexRange="1370-1449" timescale="60000">
<Initialization range="0-1369"/>
</SegmentBase>
</Representation>
</AdaptationSet>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:3
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="sparks_dovi_8-video.mp4",BYTERANGE="1366@0"
#EXT-X-MAP:URI="sparks_dovi_8-video.mp4",BYTERANGE="1370@0"
#EXT-X-KEY:METHOD=SAMPLE-AES-CTR,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",KEYFORMAT="identity"
#EXTINF:2.002,
#EXT-X-BYTERANGE:172013@1446
#EXT-X-BYTERANGE:172013@1450
sparks_dovi_8-video.mp4
#EXTINF:2.002,
#EXT-X-BYTERANGE:189474
Expand Down
1 change: 1 addition & 0 deletions packager/media/base/fourccs.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum FourCC : uint32_t {
FOURCC_dac3 = 0x64616333,
FOURCC_dac4 = 0x64616334,
FOURCC_dash = 0x64617368,
FOURCC_dby1 = 0x64627931,
FOURCC_ddts = 0x64647473,
FOURCC_dec3 = 0x64656333,
FOURCC_dfLa = 0x64664c61,
Expand Down
4 changes: 4 additions & 0 deletions packager/media/formats/mp4/mp4_muxer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ Status MP4Muxer::DelayInitializeMuxer() {
->h26x_stream_format());
if (codec_fourcc != FOURCC_NULL)
ftyp->compatible_brands.push_back(codec_fourcc);

// https://professional.dolby.com/siteassets/content-creation/dolby-vision-for-content-creators/dolby_vision_bitstreams_within_the_iso_base_media_file_format_dec2017.pdf
if (streams()[0].get()->codec_string().find("dvh") != std::string::npos)
ftyp->compatible_brands.push_back(FOURCC_dby1);
}

// CMAF allows only one track/stream per file.
Expand Down

0 comments on commit 520926c

Please sign in to comment.