Menu

Live streaming dash content using mp4box

Help
2015-06-03
2015-06-16
  • Gal Bar Mashiah

    Gal Bar Mashiah - 2015-06-03

    Hello, I'm trying to live stream h264 content to html5 using the media source extensions api.
    The following method works pretty well:

    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

    and then: mp4box -dash 1000 -frag 1000 -frag-rap out.mp4

    I can take the mp4box output (out_dashinit.mp4) and send it through web sockets, chunk by chunk, to a javascript client that feeds it to the media source api.
    However, this is not a good method for live content.

    What I'm trying to do now, is to create a single pipeline in order to do it realtime and with the minimum possible latency.
    With ffmpeg it's possible to redirect the output to stdout instead of to out.mp4 and grab the content.

    I couldn't figure out if it's possible to combine mp4box into the pipeline.

    1. Can mp4box take the input data from a source which is not a file?
    2. 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.
    3. same questions but for the output: can it output to something which is not a file (such as stdout) and can it do so progressivly 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.