I've created a series of video segments using dashenc.c from ffmpeg's libav on my windows machine. The mpd file is templated, so it's fairly simple and it passes validation. The video plays, but only if I put ffplay in the same folder as all the files and use:
ffplay -i manifest.mpd
If I try to play from some other directory, or even the same directory using:
ffplay -i c:\tmp\manifest.mpd
or
ffplay -i c:/tmp/manifest.mpd
The attempt fails, producing this error:
[dash @ 0000016ce0d69900] Failed to open an initialization section in playlist 0
[dash @ 0000016ce0d69900] Error when loading first fragment, playlist 0
C:/tmp/manifest.mpd: Invalid argument
The mpd file:
<?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="dynamic"
minimumUpdatePeriod="PT500S"
suggestedPresentationDelay="PT4S"
availabilityStartTime="2020-03-23T14:54:16Z"
publishTime="2020-03-23T14:54:25Z"
timeShiftBufferDepth="PT4811H53M52.3S"
minBufferTime="PT9.6S">
<ProgramInformation>
</ProgramInformation>
<Period id="0" start="PT0.0S">
<AdaptationSet id="0" contentType="video" segmentAlignment="true" bitstreamSwitching="true">
<Representation id="0" mimeType="video/mp4" codecs="avc1.42001e" bandwidth="5953124" width="720" height="480">
<SegmentTemplate timescale="1000000" duration="5000000" availabilityTimeOffset="4.967" initialization="init-stream$RepresentationID$.m4s" media="media-stream$RepresentationID$-$Number%06d$.m4s" startNumber="1">
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
</MPD>
Adding in a BaseUrl element didn't help; my guess is I'm formatting it wrong. Any ideas what I might do to fix this?
It would seem the problem is that ffplay expects a URL for its input argument. Internally, the combination of a Windows absolute file path for the .mpd file and relative pathing for segments was not a consideration, and while you can manually adjust the .mpd file outside of ffmpeg to make this acceptable to dashdec.c, you cannot make dashenc.c create it in a way that dashdec.c will work with it (except maybe in the case of producing a single .mp4 file, which will allow you to create a single BaseUrl tag). In order to properly view the .mpd, it must be served on a URL e.g. by a web server.