I want to create an MP4 that supports seeking and streaming. DASH appears to be what I want except that the segment seek points are stored in an external file (the MPD) which doesn't work for my application; I need seek metadata to be contained in the MP4.

The next closest thing seems to be fragmented MP4s with the mfra box. I think this would work but it doesn't seem well supported (mplayer and totem fail to seek, recent ffplay works). Although the primary application is streaming (with the ability to seek) I would be reluctant to give up the ability to play the video from file on "standard" players.

Is there any way I can make an MP4 that is streamable, seekable and plays within standard video players?

If I forgo the ability to play on standard video players is mfra the best way to go?

edit: By streaming I mean HTTP progressive download.

migrated from stackoverflow.com May 21 '13 at 8:28

This question came from our site for professional and enthusiast programmers.


Seeking into any MP4 file over HTTP can be done more or less simply.

If the file is not fragmented, all the seek information is located in the 'moov' box, so there is no problem. This is what mp4box.js demonstrates. If the data is badly organized, one would have to do multiple HTTP byte-range requests. It is easier if the header boxes are first (ftyp, moov ...) and if the media data is interleaved. MP4Box can be used to generate such files:

MP4Box -add file.mp4 output.mp4

If the file is fragmented, indeed the seek information is spread out along the file and the 'mfra' box could be used, but it is not well supported and not reliable.

Segmentation (as used in DASH) can also be used to make HTTP seekable files, if done carefully. If you segment your file, forcing a single segment file, all the data will be in a single file (not in multiple segment files). If you add the 'sidx' box, you will have the indexing information in the file (no need for the MPD). To have both, you can segment your file using the DASH ondemand profile with MP4Box:

MP4Box -dash 1000 -profile ondemand file.mp4 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.