[FFmpeg-devel] MP4 Muxer. AvcC record is not complete for High profile.

Arthur Grant arthur.grant1969 at gmail.com
Mon Aug 31 09:24:11 CEST 2015


File avc.c ff_isom_write_avcc()
The implementation is:
--------------
            avio_w8(pb, 1); /* version */
            avio_w8(pb, sps[1]); /* profile */
            avio_w8(pb, sps[2]); /* profile compat */
            avio_w8(pb, sps[3]); /* level */
            avio_w8(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal
size length - 1 (11) */
            avio_w8(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of
sps (00001) */

            avio_wb16(pb, sps_size);
            avio_write(pb, sps, sps_size);
            avio_w8(pb, 1); /* number of pps */
            avio_wb16(pb, pps_size);
            avio_write(pb, pps, pps_size);
--------------


But the spec ISO/IEC 14496-15, 5.3.3.1.2  says:
--------------
    aligned(8) class AVCDecoderConfigurationRecord
    {
        unsigned int(8) configurationVersion = 1;
        unsigned int(8) AVCProfileIndication;
        unsigned int(8) profile_compatibility;
        unsigned int(8) AVCLevelIndication;
        bit(6) reserved = ‘111111’b;
        unsigned int(2) lengthSizeMinusOne;
        bit(3) reserved = ‘111’b;
        unsigned int(5) numOfSequenceParameterSets;
        for (i = 0; i< numOfSequenceParameterSets; i++)
        {
            unsigned int(16) sequenceParameterSetLength;
            bit(8 * sequenceParameterSetLength) sequenceParameterSetNALUnit;
        }
        unsigned int(8) numOfPictureParameterSets;
        for (i = 0; i< numOfPictureParameterSets; i++)
        {
            unsigned int(16) pictureParameterSetLength;
            bit(8 * pictureParameterSetLength) pictureParameterSetNALUnit;
        }

        if (profile_idc == 100 || profile_idc == 110 ||
        profile_idc == 122 || profile_idc == 144)
        {
            bit(6) reserved = ‘111111’b;
            unsigned int(2) chroma_format;
            bit(5) reserved = ‘11111’b;
            unsigned int(3) bit_depth_luma_minus8;
            bit(5) reserved = ‘11111’b;
            unsigned int(3) bit_depth_chroma_minus8;
            unsigned int(8) numOfSequenceParameterSetExt;
            for (i = 0; i< numOfSequenceParameterSetExt; i++)
            {
                unsigned int(16) sequenceParameterSetExtLength;
                bit(8 * sequenceParameterSetExtLength)
sequenceParameterSetExtNALUnit;
            }
        }
    }
--------------

The part "if (profile_idc == 100) ..." is missing.


More information about the ffmpeg-devel mailing list