MP4 container format specification, Trying to write a low memory parser |
![]() ![]() |
MP4 container format specification, Trying to write a low memory parser |
Jan 10 2009, 22:41
Post
#1
|
|
|
Group: Members Posts: 4135 Joined: 2-September 02 Member No.: 3264 |
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? |
|
|
|
Jan 11 2009, 01:40
Post
#2
|
|
![]() Group: Members Posts: 121 Joined: 1-August 04 From: San Francisco Member No.: 15951 |
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.htmlDave |
|
|
|
Jan 11 2009, 02:43
Post
#3
|
|
|
Group: Members Posts: 4135 Joined: 2-September 02 Member No.: 3264 |
I've tried google but have found surprisingly little in the way of a detailed specification. Could someone recommend one to me? 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"? |
|
|
|
Jan 11 2009, 03:20
Post
#4
|
|
![]() Group: Members Posts: 121 Joined: 1-August 04 From: San Francisco Member No.: 15951 |
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 |
|
|
|
Jan 11 2009, 03:25
Post
#5
|
|
|
Group: Members Posts: 4135 Joined: 2-September 02 Member No.: 3264 |
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 . . . |
|
|
|
Jan 11 2009, 04:02
Post
#6
|
|
![]() Group: FB2K Moderator Posts: 2359 Joined: 30-November 07 Member No.: 49158 |
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.
|
|
|
|
Jan 14 2009, 09:36
Post
#7
|
|
|
Group: Members Posts: 27 Joined: 21-June 08 Member No.: 54677 |
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. |
|
|
|
Jan 14 2009, 12:00
Post
#8
|
|
|
VorbisGain developer Group: Developer Posts: 137 Joined: 10-January 02 Member No.: 973 |
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. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 24th May 2013 - 14:50 |