I have previously successfully made mpeg-dash manifests using the following ffmpeg command:
ffmpeg -i input.webm -c:v copy -c:a copy -f dash -seg_duration 15 manifest.mpd
Where input.webm
is a VP9
and opus
encoded video file, so no re-encoding is needed. Therefore I just copy both streams.
Now I am trying to add an adaption set to this manifest for those devices that do not support VP9 and/or opus, using the following command (linebreaks added for legibility):
ffmpeg -i input.webm
-map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0
-c:v:0 copy
-c:a:0 copy
-c:v:1 libx264 -b:v:1 1000k
-c:a:1 aac -b:a:1 128k
-adaptation_sets "id=0,streams=v id=1,streams=a" -f dash -seg_duration 15 manifest.mpd
ffmpeg seems to agree with me and spits out what I would expect, namely the same files as in the previous command and additional files that resemble something like mp4 and aac chunks. But my website with dash.js does not accept this manifest, the video does no longer play. Also dash.js does not produce any errors in the browser console. What did I do wrong?
manifest:
<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:mpeg:dash:schema:mpd:2011"
xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
profiles="urn:mpeg:dash:profile:isoff-live:2011"
type="static"
mediaPresentationDuration="PT46.7S"
maxSegmentDuration="PT15.0S"
minBufferTime="PT40.0S">
<ProgramInformation>
</ProgramInformation>
<ServiceDescription id="0">
</ServiceDescription>
<Period id="0" start="PT0.0S">
<AdaptationSet id="0" contentType="video" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true" frameRate="25/1" maxWidth="1920" maxHeight="1080" par="16:9">
<Representation id="0" mimeType="video/webm" codecs="vp09.00.40.08" bandwidth="713" width="1920" height="1080" scanType="unknown" sar="1:1">
<SegmentTemplate timescale="1000" initialization="init-stream$RepresentationID$.webm" media="chunk-stream$RepresentationID$-$Number%05d$.webm" startNumber="1">
<SegmentTimeline>
<S t="92" d="19200" r="1" />
<S d="8320" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation id="2" mimeType="video/mp4" codecs="avc1.640028" bandwidth="1000000" width="1920" height="1080" sar="1:1">
<SegmentTemplate timescale="12800" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
<SegmentTimeline>
<S t="1024" d="244736" />
<S d="256000" />
<S d="97280" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet id="1" contentType="audio" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true">
<Representation id="1" mimeType="audio/webm" codecs="opus" bandwidth="96" audioSamplingRate="48000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
<SegmentTemplate timescale="1000" initialization="init-stream$RepresentationID$.webm" media="chunk-stream$RepresentationID$-$Number%05d$.webm" startNumber="1">
<SegmentTimeline>
<S t="80" d="15001" />
<S d="15000" r="1" />
<S d="1757" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation id="3" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audioSamplingRate="48000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
<SegmentTemplate timescale="48000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
<SegmentTimeline>
<S t="3152" d="720920" />
<S d="720896" r="1" />
<S d="81920" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
</MPD>