Search code examples
reverse-engineeringisompeg-4

Structure of MPEG-4 "©xyz" box


I am trying to parse out ISO/IEC 14496-12 based files (essentially MPEG-4 movies). There are a few boxes are not in the standards (or on the MP4 Registration Authority lists), but are in real-world files. They mostly pretty simple to trace to QuickTime or similar, where the implementation is just not updated.

I'm struggling with the GPS location box (©xyz).

Here is an example:

0x00, 0x00, 0x00, 0x1e, 0xa9, 0x78, 0x79, 0x7a,
0x00, 0x12, 0x15, 0xc7, 0x2b, 0x34, 0x31, 0x2e,
0x33, 0x37, 0x35, 0x38, 0x2b, 0x30, 0x30, 0x32,
0x2e, 0x31, 0x34, 0x39, 0x32, 0x2f

The first eight bytes are the box length and box name. No problem with that.

The next four bytes are the unknowns: 0x00, 0x12, 0x15, 0xc7.

The remaining bytes are text "+41.3758+002.1492/" which is the expected latitude and longitude (Barcelona) per ISO 6709 (albeit not the 2023 version).

Of the unknowns, I can interpret the first two bytes as a 16 bit (unsigned) integer which matches the number of characters in the text. That is guesswork though.

The next two are a mystery - could perhaps be constants since I see the same 0x15 0xc7 values when generated from a different device in Australia.

What is the defined structure for this box, and is there a published specification that defines that structure?


Solution

  • As Fraser noted in his answer, 0x15 0xc7 indeed stands for the language code "English". However, it is actually documented. These 16 Bits correspond to Quicktime's Language List Atom, and looking into the table you'll find that 5575 (0x15 0xc7) equals "Packed ISO code for ‘eng’ (English)".

    Fraser linked the source code for the MPEG4Extractor of the AV Framework. Though useful, note that the Quicktime File Format Documentation emphasizes:

    The QuickTime File Format is the basis of the MPEG-4 standard and the JPEG-2000 standard, developed by the International Organization for Standardization (ISO). Although these file types have similar structures and contain many functionally identical elements, they are distinct file types.

    So be careful, and always check the docs.