Dolby Atmos in Dolby Digital Plus
Learn how to play Dolby Atmos in Dolby Digital Plus.
We'll use the following Manifest file:
<?xml version="1.0" ?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT5.00S" mediaPresentationDuration="PT30.040S" type="static">
<!-- Created with Bento4 mp4-dash.py, VERSION=2.0.0-637 -->
<Period>
<!-- Video -->
<AdaptationSet id="1" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" maxWidth="1920" maxHeight="1080">
<Label lang="en">Video</Label>
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
<SegmentTemplate timescale="1000" duration="5000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4s" startNumber="1"/>
<Representation id="video/avc1" codecs="avc1.4D4029" width="1920" height="1080" scanType="progressive" frameRate="25" bandwidth="638625"/>
</AdaptationSet>
<!-- Audio -->
<AdaptationSet id="4" mimeType="audio/mp4" startWithSAP="1" segmentAlignment="true" lang="en" selectionPriority="99">
<Label lang="en">Dolby Atmos - English</Label>
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
<SegmentTemplate timescale="1000" duration="5000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4s" startNumber="1"/>
<Representation id="audio/en/ec-3/2" codecs="ec-3" bandwidth="641179" audioSamplingRate="48000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="6"/>
<SupplementalProperty schemeIdUri="tag:dolby.com,2018:dash:EC3_ExtensionType:2018" value="JOC"/>
<SupplementalProperty schemeIdUri="tag:dolby.com,2018:dash:EC3_ExtensionComplexityIndex:2018" value="12"/>
</Representation>
</AdaptationSet>
<AdaptationSet id="3" mimeType="audio/mp4" startWithSAP="1" segmentAlignment="true" lang="en" selectionPriority="98">
<Label lang="en">Dolby Digital Plus - 5.1 - English</Label>
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
<SegmentTemplate timescale="1000" duration="5000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4s" startNumber="1"/>
<Representation id="audio/en/ec-3/1" codecs="ec-3" bandwidth="385179" audioSamplingRate="48000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="6"/>
</Representation>
</AdaptationSet>
<AdaptationSet id="2" mimeType="audio/mp4" startWithSAP="1" segmentAlignment="true" lang="en" selectionPriority="97">
<Label lang="en">AAC - Stereo - English</Label>
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
<SegmentTemplate timescale="1000" duration="5000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4s" startNumber="1"/>
<Representation id="audio/en/mp4a/1" codecs="mp4a.40.2" bandwidth="63929" audioSamplingRate="48000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
</Representation>
</AdaptationSet>
</Period>
</MPD>
- The first audio AdaptationSet contains Dolby Atmos. This is signalled by the combination codecs='ec-3' with a SupplementalPropertyDescriptor with schemeIdUri='tag:dolby.com,2018:dash:EC3_ExtensionType:2018' and value='JOC'.
- The Dolby Atmos AdaptationSet has the highest selectionPriority. This means that it will be chosen by default if filtering for language and accessibility features still leaves more than one option available.
To remove AdaptationSets in a Manifest, dash.js provides the registerCustomCapabilitiesFilter() method:
var player = dashjs.MediaPlayer().create();
...
player.registerCustomCapabilitiesFilter(disableAtmos_filter);
The provided callback function (called disableAtmos_filter() in the
example above) is called with a Representation and must return
a boolean. To have the representation filtered away (such that it is not played), the
function needs to returns false.
var disableAtmos_filter = function (repr) {
var reprIsAtmos = false;
if (repr.mimeType === "audio/mp4") {
if (repr.codecs === "ec-3") {
if (repr.SupplementalProperty_asArray) {
repr.SupplementalProperty_asArray.forEach( supplProp => {
if (supplProp.schemeIdUri === "tag:dolby.com,2018:dash:EC3_ExtensionType:2018" && supplProp.value === "JOC") {
reprIsAtmos = true;
}
})
}
console.log("EC-3 Representation contains JOC: " + reprIsAtmos);
}
}
return !reprIsAtmos;
}