Search code examples
htmlstreamingh.264rtpogg

Html5 MP4 file size unknown streaming. Best approach?


Is it possible to create mp4 file/container with out the size.

I am using media foundation to convert some file into h264/acc and wrap it around mp4. What happen is that as file finishes up the encoder adds the size of the file.

I need to start streaming as soon as the encoder starts encoding the data.

And client is going to do a progressive download.

Is this feasible. Of course I am using html5 So rtp/rtsp is out the question.

Or is Ogg/Theora a better way to do this ? Do we need to know the file size or can we just stream it ? I know each browser has different decoders.


Solution

  • The issue here is that you will not be able to get a playable mp4 without the atom being completely written. [Exact size and location of all the chunks]. So the answer to your first question is no. You cannot do it with mp4. A transport stream is the best way to do it. I have not tried Ogg/theora so don't know about that but a ts can be streamed right away.

    If you need a solution that works across all browsers it is a bit of a pain.