title: Live streaming dash content using mp4box
body: <p>I'm trying to live stream <strong>H.264</strong> content to <strong>HTML5</strong> using the media source extensions API.</p>
  
  <p>The following method works pretty well:</p>
  
  <p><code>ffmpeg -i rtsp://10.50.1.29/media/video1 -vcodec copy -f mp4 -reset_timestamps 1 -movflags frag_keyframe+empty_moov -loglevel quiet out.mp4</code></p>
  
  <p>and then:
  <code>mp4box -dash 1000 -frag 1000 -frag-rap out.mp4</code></p>
  
  <p>I can take the <strong>MP4Box</strong> output (<code>out_dashinit.mp4</code>) and send it through Web Sockets, chunk by chunk, to a JavaScript client that feeds it to the media source API.</p>
  
  <p>However, this is not a good method for live content.</p>
  
  <p>What I'm trying to do now, is to create a single pipeline in order to do it in realtime and with the minimum possible latency.
  With FFmpeg it's possible to redirect the output to <code>stdout</code> instead of <code>out.mp4</code> and grab the content.
  I couldn't figure out if it's possible to combine MP4Box into the pipeline.</p>
  
  <ol>
  <li>Can MP4Box take the input data from a source which is not a file?</li>
  <li>Can MP4Box grab such a content progressively (either from a file or other source) while it is arriving in realtime? i.e. wait a little if stream stops for 1 sec and resume automatically.</li>
  <li>Same question but for the output: can it output to something which is not a file (such as <code>stdout</code>) and can it do so progressively so that whenever output data is ready, I will be able to take it and transfer it to the web client, essentially generating a never-ending dashed MP4.</li>
  </ol>