0

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.

Evren Bingøl
  • 1,306
  • 1
  • 20
  • 32

3 Answers3

2

Would it be possible to lie about the size in the mp4's headers?

mp4ie
  • 21
  • 2
1

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.

av501
  • 6,645
  • 2
  • 23
  • 34
  • thanks thats what I thought. classic MDAT atom issue. Fragmented mp4 could work but I think it is gonna be available in windows 8. – Evren Bingøl Aug 30 '12 at 19:08
0

I don't think I understand what you are doing but I stream mp4 and it works fine in modern browsers. Only IE9 struggles with it and won't play as you would expect. Ogg files work fine, too.

I've found that mp4 encoded with any converter works fine in any modern browser, too, but I needed to use handbrake to get them to work in IE9. Still haven't figured out why and no one at Microsoft knows either cause I've asked this question just about everywhere without response.

Rob
  • 14,746
  • 28
  • 47
  • 65
  • How do you stream the mp4? If you already have a complete mp4 file it will work. However if it is currently being generated on the fly, it will not because the "header" is completely written at the end. So I would be curious to understand if you are doing so with a mp4 that is being generated live that you are streaming it. What do you use to generate the mp4? – av501 Aug 26 '12 at 22:57
  • no it is not a complete. Transcoding is happening on the fly. So yeah mp4 won't work for real-time encoding. Since you need to set a field in the mp4 atom(mdat) and that filed is the size and such which you can only find out after the encoding is completed. (Fragmented could work.) – Evren Bingøl Aug 30 '12 at 19:13