[Mp4-tech] MP4 file parser

Dave Singer singer apple.com
Tue Aug 24 10:32:01 EDT 2004


At 6:25 AM +0000 8/24/04, MRUKANT POPAT wrote:
>hi Dave & community,
>
>Thanx for your reply.
>
>The 14496-1 spec says following about stsc atom:-The table is compactly coded.
>Each entry gives the index of the first chunk of a run of chunks with the same
>characteristics; by subtracting one entry here from the previous one, you can
>compute how many chunks are in this run. You can convert this to a 
>sample count
>by multiplying by the appropriate samples-per-chunk.
>
>query 1:-What does it mean by similar
>characteristics among chunks. How is it decided.
>
>query 2:-I am sending mp4dump of an mpeg-4 file. The stsc atom inside it
>compactly codes the table in stsc atom, in the sense each entry 
>gives the index
>of the first chunk of a run of chunks with the same characteristics. 
>Now looking
>at this file I concluded that->  1) There are three groups of chunk
>   2) First group (say g1) having only 1 chunk
>   3) Second group(say g2) having 352-1=351 chunks
>   4) Third group (say g3) having 353-352=1 chunk. Thus total number 
>of chunks is 1+351+1=353
>   5) Now number of samples in all chunks can be found by samples-per-chunk in
>     stsc, so,   
>     5.1) In g1 number of samples is 1*1=1
>     5.2) In g2 number of samples is 351*2=702
>     5.3) In g3 number of samples is 1*1=1
>     5.4) Thus, total number of samples in file is 1+702+1=704
>
>     query 2.1:- But the stsz atom which gives size of all the 
>samples, lists only 655 sample size. whereas according to me it 
>should list 704 samples.
>                 WHAT COULD BE THE REASON FOR THIS?
>                 Also the stco atom which gives offset of all the 
>chunks, lists 654 chunk offsets. whereas according to me it should 
>list 353 chunks. AM I RIGHT. IF WRONG, WHERE AM I WRONG?
>          
>          
>regards,
>MRUKANT

I think you already have the answer, but to be sure:  this says:
       type stsc
        version = 0 (0x00)
        flags = 0 (0x000000)
        entryCount = 3 (0x00000003)
         firstChunk = 1 (0x00000001)
         samplesPerChunk = 1 (0x00000001)
         sampleDescriptionIndex = 1 (0x00000001)
         firstChunk = 352 (0x00000160)
         samplesPerChunk = 2 (0x00000002)
         sampleDescriptionIndex = 1 (0x00000001)
         firstChunk = 353 (0x00000161)
         samplesPerChunk = 1 (0x00000001)
         sampleDescriptionIndex = 1 (0x00000001)
which is that chunks 1 through 351 have 1 sample each, 352 has 2 
samples, and 353 to the end have 1 sample.  Since the stco says that 
there are 654 chunks;
       type stco
        version = 0 (0x00)
        flags = 0 (0x000000)
        entryCount = 654 (0x0000028e)
         chunkOffset = 34704 (0x00008790)
         chunkOffset = 50356 (0x0000c4b4)
this is consistent, as one chunk has two samples, and thus there are 
655 samples, which agrees with the stts, for example.
>
>On Mon, 23 Aug 2023 Dave Singer wrote :
>>At 6:52 AM +0000 8/21/04, MRUKANT POPAT wrote:
>>>hi all,
>>>I have some queries on MPEG-4 file parser.
>>>I have read chapter 13 of 14496-1 which describes MPEG-4 file format.
>>>I also came across 14496-12 (ISO Base Media file format).
>>>I have certain queries after reading both documents, which I hope you
>>>guys can help me solve.
>>>
>>>query1:- I have understood that ISO Base Media file format is superset
>>>for all media file formats. Am I right? If not how does it differ from
>>>other media file format?
>>
>>This is such a general question I am not sure how to answer it.
>>
>>>
>>>query2:- If I implement parser for MPEG-4 files, does it have to look
>>>for atoms mentioned in 14496-12 (ISO Base Media file format) or the
>>>atoms mentioned in chapter 13 of 14496-1.
>>
>>If you are looking at a full spec. in chapter 13, that pre-dates 
>>the making of part 12.  I['d suggest lookign instead at parts 12 
>>and 14. Yes, you should look at all atoms mentioned in parts 12 and 
>>14.
>>
>>>
>>>regards,
>>>MRUKANT
>>>
>>>
>>>
>>><http://clients.rediff.com/signature/track_sig.asp>
>>>
>>>_______________________________________________
>  >>NOTE: Please use clear subject lines for your posts. Include 
>[audio, [video], [systems], [general] or another apppropriate 
>identifier to indicate the type of question you have.
>>>
>>>Note: Conduct on the mailing list is subject to the Antitrust 
>>>guidelines found at 
>>>http://www.mpegif.org/public/documents/vault/mp-out-30042-Antitrust.php
>>
>>
>>-- David Singer
>>Apple Computer/QuickTime
>
>
>
><http://clients.rediff.com/signature/track_sig.asp>
>
>Attachment converted: DaveG49:mp4dumpop.txt (TEXT/ttxt) (0001CFD4)

-- 
David Singer
Apple Computer/QuickTime
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/mp4-tech/attachments/20040824/84d2c311/attachment.html


More information about the Mp4-tech mailing list