Search code examples
h.264

Strange H.264 NAL headers


I'm trying to process an MP4 which contains video NAL that are using a strange code in the header, and no start code prefix. It looks like that (by frame number):

01:00-00-37-3F-65-B8-4F-DF
02:00-00-00-02-09-30-00-00
03:00-00-00-02-09-30-00-00
04:00-00-00-02-09-30-00-00
05:00-00-00-02-09-30-00-00
[etc]    

Then each 60 frames, it looks like this:

61:00-00-00-02-09-10-00-00

So the inter-frame rate seems to be set to 60.

First frame (01) could also begin like this as I cannot really parse it:

01:00-00-00-00-00-00-00-10-00-00-37-3F-65-B8-4F-DF

What are these headers, and is there a section in the H.264 standard in which I could refer? They are sometime followed by audio (sync-ed).

[EDIT]

Also, further infos: this is produced in WP8, which is using DM355 encoder.


Solution

  • MP4 does not use AnnexB. Hence no start codes. The first 4 bytes of each NALU is the size of the NALU in big endian format.

    so for example. 00-00-00-02-09-10-00-00

    This is 2 byte NALU of type 9. 9 is an Access Unit delimiter

    To get the SPS/PPS you must read the extradata from the avcC atom.