MPEG-DASH video stream with just single mp4 file

Behrouz.M picture Behrouz.M · Feb 6, 2016 · Viewed 19.2k times · Source

I'm researching for a week to find a simple and platform independent method to stream a mp4 file to any browser. In case of browser incompatibility progressive stream(direct download) method will be used. My scenario is like this:

  • single mp4 file (not segmented and multiplexed(Audio+Video) )
  • HTTP Byte-Range serving supported
  • progressive stream (direct file download) supported in case of browser incompatibility

After studying Apple HLS, Adobe Flash Stream, Microsoft Smooth, RTSP and MPEG-DASH it seems that MPEG-DASH is the proper solution. But the problem is MPEG-DASH forcing me to split mp4 file to separate segmented files which leads to duplicate consuming space to store the mp4 file because I have to support progressive stream in case of browser incompatibility. Then storing single mp4 file with segmented mp4 files is unavoidable.

The question is: is there any way to serve a single mp4 file as http stream & progressive stream in any browser ?

MPEG-DASH protocols says it supports multiplexed files but the problem is dash.js does not support it. Is there any other javascript player which supports multiplexed and single mp4 files with byte-range requests ?

Any other solution which commits my scenario conditions is welcomed. Thanks.

REFERENCES: BitCodin.com 1 BitCodin.com 2

Answer

Will Law picture Will Law · Feb 7, 2016

Yes there is a solution. dash.js only plays fragmented mp4s that have been packaged. However, this project from Cyril at Telecom Paristech will do what you want:

https://github.com/gpac/mp4box.js/

This is a js version of mp4box. What it can do is on-the-fly conversion of your non-fragmented mp4 in to media fragments which can then be fed to a MSE sourceBuffer. They have a sample player that does this which you can copy:

http://download.tsi.telecom-paristech.fr/gpac/mp4box.js/

Cheers Will