avcC
主要是 AVCDecoderConfigurationRecord
, 这个见 5.3.3.1.2AVCSampleEntry
, 继承 VisualSampleEntry
VisualSampleEntry
结构见 14496-12_2015 12.1.3.2class VisualSampleEntry(codingname) extends SampleEntry (codingname){ unsigned int(16) pre_defined = 0; const unsigned int(16) reserved = 0; unsigned int(32)[3] pre_defined = 0; unsigned int(16) width; unsigned int(16) height; template unsigned int(32) horizresolution = 0x00480000; // 72 dpi template unsigned int(32) vertresolution = 0x00480000; // 72 dpi const unsigned int(32) reserved = 0; template unsigned int(16) frame_count = 1; string[32] compressorname; template unsigned int(16) depth = 0x0018; int(16) pre_defined = -1; // other boxes from derived specifications CleanApertureBox clap; // optional PixelAspectRatioBox pasp; // optional } aligned(8) abstract class SampleEntry (unsigned int(32) format) extends Box(format){ const unsigned int(8)[6] reserved = 0; unsigned int(16) data_reference_index; }
Compressorname
in the base class VisualSampleEntry indicates the name of the compressor used with the value “\013HEVC Coding” being recommended (\013 is 11, the length of the string in bytes).
HEVCDecoderConfigurationRecord
结构:aligned(8) class HEVCDecoderConfigurationRecord { unsigned int(8) configurationVersion = 1; unsigned int(2) general_profile_space; unsigned int(1) general_tier_flag; unsigned int(5) general_profile_idc; unsigned int(32) general_profile_compatibility_flags; unsigned int(48) general_constraint_indicator_flags; unsigned int(8) general_level_idc; bit(4) reserved = ‘1111’b; unsigned int(12) min_spatial_segmentation_idc; bit(6) reserved = ‘111111’b; unsigned int(2) parallelismType; bit(6) reserved = ‘111111’b; unsigned int(2) chromaFormat; bit(5) reserved = ‘11111’b; unsigned int(3) bitDepthLumaMinus8; bit(5) reserved = ‘11111’b; unsigned int(3) bitDepthChromaMinus8; bit(16) avgFrameRate; bit(2) constantFrameRate; bit(3) numTemporalLayers; bit(1) temporalIdNested; unsigned int(2) lengthSizeMinusOne; unsigned int(8) numOfArrays; for (j=0; j < numOfArrays; j++) { bit(1) array_completeness; unsigned int(1) reserved = 0; unsigned int(6) NAL_unit_type; unsigned int(16) numNalus; for (i=0; i< numNalus; i++) { unsigned int(16) nalUnitLength; bit(8*nalUnitLength) nalUnit; } } }