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
I think all major browser support mp4. http://caniuse.com/#feat=mpeg4. You can stream it using just a good old http server.
MPEG-DASH
is required only if you require fancy stuff like adaptive bitrate streaming, multi language, drm and so.If you insist on using
MPEG-DASH
you can simply segment your mp4 files using a mp4box on the server side (you have to do it only once). The result is not mulitple mp4 files but rather a single mp4 files that is organized in a more suitable for streaming way.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
You could serve dash player with single mp4 file. However you need to put index information in sidx box in this mp4 file. you could bento4 to do it. Actually for ondemand case, it's normally to use one single file to stream. You could also download this file locally. Dash streaming will not require more storage size if you only have one bitrate. and there are many javascript player are supporting dash like shakashaka player, dashif player ...
Maybe this would help you: