Search code examples
videomp4h.264

Why does the AVC Decoder Config Record ISO 14496-15:2004 5.2.4.1.1 use arrays of multiple Sequence and Parameter Sets?


Why does the AVC Decoder Config Record ISO 14496-15:2004 5.2.4.1.1 use arrays of multiple Sequence and Parameter Sets?

It seems logical that you may have multiple different configurations in one track but how is the configuration for a specific period of time referenced in this index? Is there something in the H.264 spec which defines this or is it specific to the MP4 container?


Solution

  • The Sample Description Index (one based) is used to choose the correct AVC Decoder Config Record. For any given sample you look up the index in your MP4 file 'stbl' -> 'stsc' -> entry[].sample_description_index. Based on the sample_description_index you choose the AVC Decoder Config Record. An AVC Decoder Config Record can contain multiple PPS and SPS. The slice header of a video coding unit inside the AVC stream contains the pic_parameter_set_id that references the correct PPS. The PPS contains seq_parameter_set_id referencing the correct SPS.