IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
MP4 container format specification, Trying to write a low memory parser
saratoga
post Jan 10 2009, 22:41
Post #1





Group: Members
Posts: 4963
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?
Go to the top of the page
+Quote Post
davelasker
post Jan 11 2009, 01:40
Post #2





Group: Members
Posts: 123
Joined: 1-August 04
From: San Francisco
Member No.: 15951



QUOTE (Mike Giacomelli @ Jan 10 2009, 14:41) *
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
Go to the top of the page
+Quote Post
saratoga
post Jan 11 2009, 02:43
Post #3





Group: Members
Posts: 4963
Joined: 2-September 02
Member No.: 3264



QUOTE (davelasker @ Jan 10 2009, 19:40) *
QUOTE (Mike Giacomelli @ Jan 10 2009, 14:41) *

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"?
Go to the top of the page
+Quote Post
davelasker
post Jan 11 2009, 03:20
Post #4





Group: Members
Posts: 123
Joined: 1-August 04
From: San Francisco
Member No.: 15951



QUOTE (Mike Giacomelli @ Jan 10 2009, 18:43) *
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
Go to the top of the page
+Quote Post
saratoga
post Jan 11 2009, 03:25
Post #5





Group: Members
Posts: 4963
Joined: 2-September 02
Member No.: 3264



QUOTE (davelasker @ Jan 10 2009, 21:20) *
QUOTE (Mike Giacomelli @ Jan 10 2009, 18:43) *
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 . . .
Go to the top of the page
+Quote Post
Yirkha
post 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.
Go to the top of the page
+Quote Post
spinchicken
post Jan 14 2009, 09:36
Post #7





Group: Members
Posts: 27
Joined: 21-June 08
Member No.: 54677



QUOTE (Yirkha @ Jan 10 2009, 21:02) *
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.
Go to the top of the page
+Quote Post
Lear
post Jan 14 2009, 12:00
Post #8


VorbisGain developer


Group: Developer
Posts: 140
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. smile.gif
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th September 2014 - 19:15