Skip to main content

Topic: MP4 container format specification (Read 37634 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • saratoga
  • [*][*][*][*][*]
MP4 container format specification
I've been working on making an mp4 parser for AAC files more memory efficient for targets with very little RAM.  Unfortunately, just looking at source code for various parsers its somewhat difficult for me to see how the container actually works.

I've tried google but have found surprisingly little in the way of a detailed specification.  Could someone recommend one to me?

  • davelasker
  • [*][*][*]
MP4 container format specification
Reply #1
I've tried google but have found surprisingly little in the way of a detailed specification.  Could someone recommend one to me?
Does this help? http://developer.apple.com/documentation/Q..._section_1.html

Dave

  • saratoga
  • [*][*][*][*][*]
MP4 container format specification
Reply #2

I've tried google but have found surprisingly little in the way of a detailed specification.  Could someone recommend one to me?
Does this help? http://developer.apple.com/documentation/Q..._section_1.html

Dave


That looks good, and apparently its very close to how mp4 works. 

I'm still not really understanding how one walks through a chunk full of samples though.  Is there header or similar on each chunk or sample that tells you about it, or do you have to parse that from the "sample table atom"?

  • davelasker
  • [*][*][*]
MP4 container format specification
Reply #3
I'm still not really understanding how one walks through a chunk full of samples though.  Is there header or similar on each chunk or sample that tells you about it, or do you have to parse that from the "sample table atom"?
I am the author of aacgain and I had to answer your question to write it. I couldn't find the answer in any publicly available documentation, so I did it by using mpeg4ip/mp4v2 library. There is also some example code in faad2 that you could use.

Hope that helps...

Dave

  • saratoga
  • [*][*][*][*][*]
MP4 container format specification
Reply #4
I'm still not really understanding how one walks through a chunk full of samples though.  Is there header or similar on each chunk or sample that tells you about it, or do you have to parse that from the "sample table atom"?
I am the author of aacgain and I had to answer your question to write it. I couldn't find the answer in any publicly available documentation, so I did it by using mpeg4ip/mp4v2 library. There is also some example code in faad2 that you could use.

Hope that helps...

Dave


Not really.  I already have a working library, and I see how the code does it.  I'm trying to understand the process better so that I can figure out how to safely cut corners . . .

  • Yirkha
  • [*][*][*][*][*]
  • FB2K Moderator
MP4 container format specification
Reply #5
Wouldn't the original ISO/IEC 14496-12 (ISO Base Media File Format) or other standard document help you? Some of them are freely available for personal use in PDF here.
Full-quoting makes you scroll past the same junk over and over.

MP4 container format specification
Reply #6
Wouldn't the original ISO/IEC 14496-12 (ISO Base Media File Format) or other standard document help you? Some of them are freely available for personal use in PDF here.



i also face these problem - but going through the standard doesnt help a lot

i think that the most problematic problem is that you cant tell id_syn_ele of the differant channles before you actually get them from the stream.
which of the streams are coupling channles? and which are not?
do the coupling channles always come in the start of the stream?

this causes me to save all the data of all channles and then process instead of getting the coupling channles first, save them and work on each data channle seperately.

i havent seen any answer to this in the standard or in
the free codes.

  • Lear
  • [*][*][*]
  • Developer
MP4 container format specification
Reply #7
The QuickTime documentation from Apple is what I used when I worked on the MP4 parser in Rockbox. There are no headers or similar in the mdat box that I'm aware of, so you have to rely on the stsc, stco, stsz and stts boxes (atoms) to locate individual frames, map frames to time, etc.

If you are working on MP4 seeking in Rockbox, I have some ideas on how it could be improved (to reduce memory usage) in case you're interested.