title: Dash.js not playing mpd files made with ffmpeg
body: <p>I'm using ffmpeg to create chunks and manifest of a webm file which I want to live stream with Dash.js. Unfortunately Dash.js won't play the mpd file, no matter which way I create the chunks and manifest. However, the sample mpd URL from Dash.js is working.</p>
  <h3>Commands</h3>
  <pre><code>ffmpeg -re -r 25 -i Dash/strm.webm
  -map 0:v:0
  -pix_fmt yuv420p
  -c:v libvpx
  -s 640x480 -keyint_min 60 -g 60 -speed 6 -tile-columns 4 -frame-parallel 1 -threads 8 -static-thresh 0 -max-intra-rate 300 -deadline realtime -lag-in-frames 0 -error-resilient 1
  -b:v 3000k
  -f webm_chunk
  -header &quot;Dash/glass_360.hdr&quot;
  -chunk_start_index 1 Dash/glass_360_%d.chk
  -map 0:a:0
  -c:a libvorbis
  -b:a 128k -ar 44100
  -f webm_chunk
  -audio_chunk_duration 2000
  -header Dash/glass_171.hdr
  -chunk_start_index 1 Dash/glass_171_%d.chk
  
  
  //Manifest
  ffmpeg
  -f webm_dash_manifest -live 1
  -i Dash/glass_360.hdr
  -f webm_dash_manifest -live 1
  -i Dash/glass_171.hdr
  -c copy
  -map 0 -map 1
  -f webm_dash_manifest -live 1
  -adaptation_sets &quot;id=0,streams=0 id=1,streams=1&quot;
  -chunk_start_index 1
  -chunk_duration_ms 2000
  -time_shift_buffer_depth 7200
  -minimum_update_period 7200 Dash/glass_video_manifest.mpd
  </code></pre>
  <h3>Manifest output</h3>
  <pre><code>ffmpeg version git-2020-05-27-8b5ffae Copyright (c) 2000-2020 the FFmpeg developers
    built with gcc 9.3.1 (GCC) 20200523
    configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
    libavutil      56. 49.100 / 56. 49.100
    libavcodec     58. 87.101 / 58. 87.101
    libavformat    58. 43.100 / 58. 43.100
    libavdevice    58.  9.103 / 58.  9.103
    libavfilter     7. 83.100 /  7. 83.100
    libswscale      5.  6.101 /  5.  6.101
    libswresample   3.  6.100 /  3.  6.100
    libpostproc    55.  6.100 / 55.  6.100
  Input #0, webm_dash_manifest, from 'Dash/glass_360.hdr':
    Metadata:
      ENCODER         : Lavf58.43.100
    Duration: N/A, bitrate: N/A
      Stream #0:0(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)
      Metadata:
        ALPHA_MODE      : 1
        ENCODER         : Lavc58.87.101 libvpx
        webm_dash_manifest_file_name: glass_360.hdr
        webm_dash_manifest_track_number: 1
  Input #1, webm_dash_manifest, from 'Dash/glass_171.hdr':
    Metadata:
      ENCODER         : Lavf58.43.100
    Duration: N/A, bitrate: N/A
      Stream #1:0(eng): Audio: vorbis, 44100 Hz, mono, fltp (default)
      Metadata:
        ENCODER         : Lavc58.87.101 libvorbis
        webm_dash_manifest_file_name: glass_171.hdr
        webm_dash_manifest_track_number: 1
  Output #0, webm_dash_manifest, to 'Dash/glass_video_manifest.mpd':
    Metadata:
      encoder         : Lavf58.43.100
      Stream #0:0(eng): Video: vp8, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 1k tbr, 1k tbn, 1k tbc (default)
      Metadata:
        ALPHA_MODE      : 1
        ENCODER         : Lavc58.87.101 libvpx
        webm_dash_manifest_file_name: glass_360.hdr
        webm_dash_manifest_track_number: 1
      Stream #0:1(eng): Audio: vorbis, 44100 Hz, mono, fltp (default)
      Metadata:
        ENCODER         : Lavc58.87.101 libvorbis
        webm_dash_manifest_file_name: glass_171.hdr
        webm_dash_manifest_track_number: 1
  Stream mapping:
    Stream #0:0 -&gt; #0:0 (copy)
    Stream #1:0 -&gt; #0:1 (copy)
  Press [q] to stop, [?] for help
  frame=    0 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x
  video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: unknown
  </code></pre>
  <p><strong>Manifest file</strong> <br /> (<em>glass_video_manifest.mpd</em>)<br />
  I tried to delete the <code>ContetntComponent</code> like suggested in other questions, but it didn't work.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;MPD
    xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    xmlns=&quot;urn:mpeg:DASH:schema:MPD:2011&quot;
    xsi:schemaLocation=&quot;urn:mpeg:DASH:schema:MPD:2011&quot;
    type=&quot;dynamic&quot;
    minBufferTime=&quot;PT1S&quot;
    profiles=&quot;urn:mpeg:dash:profile:isoff-live:2011&quot;
    availabilityStartTime=&quot;2021-04-01T18:20:08Z&quot;
    timeShiftBufferDepth=&quot;PT7200S&quot;
    minimumUpdatePeriod=&quot;PT7200S&quot;&gt;
  &lt;Period id=&quot;0&quot; start=&quot;PT0S&quot; &gt;
  &lt;AdaptationSet id=&quot;0&quot; mimeType=&quot;video/webm&quot; codecs=&quot;vp8&quot; lang=&quot;eng&quot; bitstreamSwitching=&quot;true&quot; subsegmentAlignment=&quot;true&quot; subsegmentStartsWithSAP=&quot;1&quot;&gt;
  &lt;ContentComponent id=&quot;1&quot; type=&quot;video&quot;/&gt;
  &lt;SegmentTemplate timescale=&quot;1000&quot; duration=&quot;2000&quot; media=&quot;glass_$RepresentationID$_$Number$.chk&quot; startNumber=&quot;1&quot; initialization=&quot;glass_$RepresentationID$.hdr&quot;/&gt;
  &lt;Representation id=&quot;360&quot; bandwidth=&quot;1000000&quot; width=&quot;640&quot; height=&quot;480&quot; codecs=&quot;vp8&quot; mimeType=&quot;video/webm&quot; startsWithSAP=&quot;1&quot;&gt;&lt;/Representation&gt;
  &lt;/AdaptationSet&gt;
  &lt;AdaptationSet id=&quot;1&quot; mimeType=&quot;audio/webm&quot; codecs=&quot;vorbis&quot; lang=&quot;eng&quot; bitstreamSwitching=&quot;true&quot; subsegmentAlignment=&quot;true&quot; subsegmentStartsWithSAP=&quot;1&quot;&gt;
  &lt;ContentComponent id=&quot;1&quot; type=&quot;audio&quot;/&gt;
  &lt;SegmentTemplate timescale=&quot;1000&quot; duration=&quot;2000&quot; media=&quot;glass_$RepresentationID$_$Number$.chk&quot; startNumber=&quot;1&quot; initialization=&quot;glass_$RepresentationID$.hdr&quot;/&gt;
  &lt;Representation id=&quot;171&quot; bandwidth=&quot;128000&quot; audioSamplingRate=&quot;44100&quot; codecs=&quot;vorbis&quot; mimeType=&quot;audio/webm&quot; startsWithSAP=&quot;1&quot;&gt;&lt;/Representation&gt;
  &lt;/AdaptationSet&gt;
  &lt;/Period&gt;
  &lt;/MPD&gt;
  </code></pre>
  <h3>Dash.js-Player</h3>
  <pre><code>&lt;script&gt;
  
  (function(){
    // var url = &quot;https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd&quot;;
    var url = &quot;http://localhost:8081/videos/Dash/glass_live_manifest.mpd&quot;;
    var player = dashjs.MediaPlayer().create();
                  
    // config
    targetLatency = 2.0;        // Lowering this value will lower latency but may decrease the player's ability to build a stable buffer.
    minDrift = 0.05;            // Minimum latency deviation allowed before activating catch-up mechanism.
    catchupPlaybackRate = 0.5;  // Maximum catch-up rate, as a percentage, for low latency live streams.
    stableBuffer = 2;           // The time that the internal buffer target will be set to post startup/seeks (NOT top quality).
    bufferAtTopQuality = 2;     // The time that the internal buffer target will be set to once playing the top quality.
  
     player.updateSettings({
        'streaming': {
            'liveDelay': 2,
            'liveCatchUpMinDrift': 0.05,
            'liveCatchUpPlaybackRate': 0.5,
            'stableBufferTime': 2,
            'bufferTimeAtTopQuality': 2,
            'bufferTimeAtTopQualityLongForm': 2,
            'bufferToKeep': 2,
            'bufferAheadToKeep': 2,
            'lowLatencyEnabled': true,
            'fastSwitchEnabled': true,
            'abr': {
                 'limitBitrateByPortal': true
            },
         }
     });
  
     console.log(player.getSettings());
  
     setInterval(() =&gt; {
        console.log('Live latency= ', player.getCurrentLiveLatency());
        console.log('Buffer length= ', player.getBufferLength('video'));
       }, 3000);
  
       player.initialize(document.querySelector(&quot;#videoPlayer&quot;), url, true);
  
     })();
  &lt;/script&gt;
  </code></pre>
  <h3>Chrome</h3>
  <pre><code>{debug: {…}, streaming: {…}}
  dash.all.min.js:2 XHR finished loading: GET &quot;http://localhost:8081/videos/Dash/glass_live_manifest.mpd&quot;.
  load @ dash.all.min.js:2
  C @ dash.all.min.js:2
  load @ dash.all.min.js:2
  load @ dash.all.min.js:2
  load @ dash.all.min.js:2
  load @ dash.all.min.js:2
  se @ dash.all.min.js:2
  te @ dash.all.min.js:2
  initialize @ dash.all.min.js:2
  (anonymous) @ Dash:92
  (anonymous) @ Dash:94
  DevTools failed to load SourceMap: Could not parse content for http://localhost:8081/js/dash.all.min.js.map: Cannot read property 'length' of undefined
  Dash:88 Live latency=  NaN
  Dash:89 Buffer length=  NaN
  Dash:88 Live latency=  NaN
  Dash:89 Buffer length=  NaN
  Dash:88 Live latency=  NaN
  Dash:89 Buffer length=  NaN
  Dash:88 Live latency=  NaN
  Dash:89 Buffer length=  NaN
  Dash:88 Live latency=  NaN
  Dash:89 Buffer length=  NaN
  </code></pre>
  <h1>UPDATE</h1>
  <p>Well, it seems like the problem in general was that the mpd's wouldn't play from that /dash folder. So i took a look into the code and found a bad routing. Anyways, the mpd would't start with the given command I used, probably becasue it creates a <code>dynamic</code> manifest, like Markus Schumann says. So I'm going with a new one which seems to be working for now, but not very well.</p>
  <pre><code>ffmpeg -y -re -i strm.webm 
  -c:v libx264 -x264opts &quot;keyint=24:min-keyint=24:no-scenecut&quot; 
  -r 24 -c:a aac -b:a 128k -bf 1 -b_strategy 0 -sc_threshold 0 -pix_fmt yuv420p 
  -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -b:v:0 250k  
  -filter:v:0 &quot;scale=-2:240&quot; -profile:v:0 baseline -b:v:1 750k  
  -filter:v:1 &quot;scale=-2:480&quot; -profile:v:1 main -b:v:2 1500k 
  -filter:v:2 &quot;scale=-2:720&quot; -profile:v:2 high 
  -use_timeline 1 -use_template 1 -window_size 5 -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; 
  -f dash glass_video_manifest.mpd
  </code></pre>