title: Using ffmpeg to generate dash manifest and it cannot be played by dash.js
body: <p>I'm using ffmpeg to encode incoming stream via rtmp protocol, the code as following:</p>
  
  <pre><code>ffmpeg -re -i rtmp://localhost:1935${StreamPath} -use_timeline 1 /
  -use_template 1 -window_size 10 -min_seg_duration 5000 -f dash out.mpd
  </code></pre>
  
  <p>The manifest looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;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="PT1M36.4S"
      minBufferTime="PT8.3S"&gt;
      &lt;ProgramInformation&gt;
      &lt;/ProgramInformation&gt;
      &lt;Period start="PT0.0S"&gt;
          &lt;AdaptationSet contentType="video" segmentAlignment="true" bitstreamSwitching="true" frameRate="30/1"&gt;
          &lt;Representation id="0" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="30/1"&gt;
              &lt;SegmentTemplate timescale="15360" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="4"&gt;
                  &lt;SegmentTimeline&gt;
                      &lt;S t="384000" d="128000" /&gt;
                      &lt;S d="71680" /&gt;
                      &lt;S d="128000" r="4" /&gt;
                      &lt;S d="56832" /&gt;
                      &lt;S d="128000" /&gt;
                      &lt;S d="72704" /&gt;
                  &lt;/SegmentTimeline&gt;
              &lt;/SegmentTemplate&gt;
          &lt;/Representation&gt;
      &lt;/AdaptationSet&gt;
      &lt;AdaptationSet contentType="audio" segmentAlignment="true" bitstreamSwitching="true"&gt;
          &lt;Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audioSamplingRate="44100"&gt;
              &lt;AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" /&gt;
              &lt;SegmentTemplate timescale="44100" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="4"&gt;
                  &lt;SegmentTimeline&gt;
                      &lt;S t="1099755" d="367616" /&gt;
                      &lt;S d="205824" /&gt;
                      &lt;S d="367616" r="4" /&gt;
                      &lt;S d="162816" /&gt;
                      &lt;S d="367616" /&gt;
                      &lt;S d="207872" /&gt;
                  &lt;/SegmentTimeline&gt;
              &lt;/SegmentTemplate&gt;
          &lt;/Representation&gt;
      &lt;/AdaptationSet&gt;
  &lt;/Period&gt;
  </code></pre>
  
  <p></p>
  
  <p>When I try to play it on dash.js player, a error occured:</p>
  
  <pre><code>[112] Parsing complete: ( xml2json: 3.50ms, objectiron: 1.76ms, total: 0.00526s) Debug.js:127 
  [116] SegmentTimeline detected using calculated Live Edge Time Debug.js:127 
  [118] MediaSource attached to element.  Waiting on open... Debug.js:127 
  [119] Manifest has been refreshed at Tue Jan 02 2018 01:57:35 GMT+0800 [1514829455.1] Debug.js:127 
  [155] MediaSource is open! Debug.js:127 
  [156] Duration successfully set to: 96.4 Debug.js:127 
  [157] Added 0 inline events Debug.js:127 
  [158] video codec: video/mp4;codecs="avc1.640028" Stream.js:225 
  Uncaught TypeError: Cannot read property 'type' of null
      at z (Stream.js:225)
      at C (Stream.js:285)
      at D (Stream.js:373)
      at E (Stream.js:398)
      at Object.d [as activate] (Stream.js:107)
      at y (StreamController.js:363)
      at MediaSource.c (StreamController.js:342)
  </code></pre>
  
  <p>then it fails to playback...</p>
  
  <p>Is it because I didn't set the parameters right on ffmpeg or this is a bug in dash.js? </p>
  
  <p>I really stuck here!</p>