Log in

View Full Version : How to identify frame type in a MP4 file?


BrianBin
30th October 2006, 22:12
As title described, In the MP4 file, if we ignore the bitstream data itself, can we get frame type information (I, P, B) from the moov box? and how?
Thanks

BrianBin
31st October 2006, 01:41
I think I should reply myself, others please check what I said..
1. We can judge an I frame from 'stss' atom
2. We can identify P and B from the 'ctts' atom, which the value is '0' for B frame, 'non-zero' for an I or P frame

mediator
31st October 2006, 10:17
I think it is possible to contruct cases for AVC where your rule is not true any more. E.g. think about B-Frames that always only reference two frames from the past. Such stream can be stored in a valid way to MP4 container without using ctts (ctts for all samples being zero)

bond
31st October 2006, 19:41
you can calculate the framerate by mdhd.timescale/stts.sampledelta where there will be only one sampledelta value in stts valid for all frames when the stream is constant framerate

on a variable framerate stream each frame can obviously have its own sampledelta