MPEGGroup / CMAF

Official MPEG repository to discuss public issues on CMAF (ISO/IEC 23000-19)
2 stars 0 forks source link

AVC Configuration Record #10

Closed haudiobe closed 3 years ago

haudiobe commented 4 years ago

In M54520, content was generated with FFMPEG. The content was verified with the conformance software for the second edition of CMAF.

One observed error is documented in clause 3.3.1: "Validate_AVCConfigRecord: Not enough bits left in the bitstream for further attribute validation"

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( AVCProfileIndication  ==  100  ||  AVCProfileIndication  ==  110  ||
       AVCProfileIndication  ==  122  ||  AVCProfileIndication  ==  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 content was encoded with AVC high profile (100) and for this case there is expected extra bits in the second part of the code, but this is missing the content. That is why it gives “Not enough bits left” to read the extra information. The reason that this is missing is that ffmpeg seems to not add this by default.

Question for discussion: Is it an FFMPEG problem or is it an overrestrictive specification in part 15? Please comment

jeanlf commented 4 years ago

The spec is clear, you must have this info in the avcc box for these profiles - that's an FFMPEG problem - use gpac :)

RufaelDev commented 4 years ago

I would rather fix this in ffmpeg though if possible ;-) as it is referred to as reference implementation these days ….

sdp198 commented 4 years ago

I'd agree it's an ffmpeg bug. The code was probably written without access to the spec.

It wouldn't be possible to relax, as it's not a restriction it's part of the bitstream format. If you remove it from teh specification you would break everything else.

jamrial commented 4 years ago

This was fixed in https://github.com/FFmpeg/FFmpeg/commit/16fa513392adbdd786776d12258f39ad81149a19 and https://github.com/FFmpeg/FFmpeg/commit/18507b48825da45055f7ba1f933aa64cf90de253 which are present in ffmpeg 4.3

haudiobe commented 4 years ago

@jamrial thanks - we will check this!

cconcolato commented 3 years ago

The CMAF group agreed to close the issue.