View Full Version : Question about Flags in avi,mp4 and mkv headers
Inc
23rd October 2005, 22:26
Hi, 3 Q's I have:
1. Where (at which byte offset) is the AR flag stored in an avifile container? The common avistreaminfo() or AvifileInfo() via WinAPI doesnt serve it (imho).
2. Where do I get some infos about the mp4 file header where all needed specs are stored like width, height, fps, AR etc etc
3. Same to mkv files.
I'd apreciate all suggestions
Thanx
mediator
28th October 2005, 14:19
1. Where (at which byte offset) is the AR flag stored in an avifile container? The common avistreaminfo() or AvifileInfo() via WinAPI doesnt serve it (imho).
There is no fixed byte offset. For ASP, aspect ratio info is stored together with VOL header in every key-frame (I-VOP). For AVC AVI Container is a very bad thing and I would discourage from using it for that.
2. Where do I get some infos about the mp4 file header where all needed specs are stored like width, height, fps, AR etc etc
Same as before applies. For ASP the information can be found in the ESDS-Atom (ESDS=Elementary Stream Descriptor)
For AVC it is found in the AVCC-Atom (AVCC=AVC Config).
You will need either libraries that do the parsing of the containers for you are you will need to study AVI (see MSDN), MP4 (ISO/IEC 14496-1) and MKV fileformats and do it on your own.
To make your way to the Aspect Ration flags you will need additionally to parse the decoder configuration, which means you need to interpret AVC/ASP bitstream (at least small part of it)
Same to mkv files
Probably similar to the answer of 1)
Have Fun :p :p :p
Haali
29th October 2005, 14:05
Hi, 3 Q's I have:
1. Where (at which byte offset) is the AR flag stored in an avifile container? The common avistreaminfo() or AvifileInfo() via WinAPI doesnt serve it (imho).
2. Where do I get some infos about the mp4 file header where all needed specs are stored like width, height, fps, AR etc etc
AVI and MP4 containers do not store AR at all. You have to parse the codec bitstreams to get AR info.
3. Same to mkv files.
Matroska does not use a fixed structure, so you need to have a minimal ebml parser to extract AR. More info is available at matroska.org.
Inc
30th October 2005, 22:02
Thanks a lot for your hints. :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.