Log in

View Full Version : Advanced Quicktime Header Question


ApPojken
14th August 2006, 14:23
I am currently working on extracting information from headers for a number of different formats and I am currently stuck in the quicktime header.
I have managed to extract the trackID, duration, framesize and codec but can not figure out where the frame rate and aspect ratio is located.

The mp4 can contain VBR frame rate which could mean that this is embedded in the stream but the aspect ratio will not change. Any QT-expert out there that knows where I find it? (In binary hex code)

Cheers!

ApPojken
18th August 2006, 13:08
Ok. I solved the logic for the frame rate but retrieving the aspect ratio is still an open question.

mediator
20th August 2006, 12:23
look out for Stsd.VisualSampleEntry.horizresolution and Stsd.VisualSampleEntry.vertresolution. This is the place to store the pixel aspect ratio in the container. However, since this is redundant information, the saver way to obtain aspect ratio is always to refer to the elementary stream configuration (decoder configuration). If you want to do that, you would need some AVC Sequence Header Parsing code or some ASP VOL Header parsing code to extract the ultimate values.
In any case it is good to have the respective specs at hand (ISO 14496-12 -> where to find aspect ratio information in the container, ISO 14496-15 -> how to find AVC decoder information, ISO 14496-10 -> how to parse AVC decoder information, ISO 14496-2 -> how to parse ASP decoder information)

smok3
20th August 2006, 12:29
iam pretty sure qt doesnt support aspect ratio info at all, at least not at the container level (but i could be wrong).

ApPojken
21st August 2006, 09:39
I found it. Had to reverse engineer the whole file to find it. There is an atom called "pasp" that is suppose to be short for Pixel Aspect Ratio. However, this is not the place. In fact you can modify that to anything and nothing happens. The atom that does change it is called "clef" (sub atom to 'trak'). Not sure what that is short for yet. It is not really an aspect ratio flag more a way to set the "display" resolution of the file...