[x264-devel] AVC Decoder Configuration Record
herbert westmacott
herbie.westmacott at gmail.com
Tue Dec 14 21:55:54 CET 2010
Hi
I know the AVC Decoder Configuration Record is externally framed in
ffmpeg. For example the flv and mp4 muxers define this record when
generating the ouput.
Referring to the ISO/IEC Spec 14496-15; the question I have relates to
the field called lengthSizeMinusOne (see below). This field
"indicates the length in bytes of the NALUnitLength field in an AVC
video sample or AVC parameter set sample of the associated stream
minus one. For example, a size of one byte is indicated with a value
of 0. The value of this field shall be one of 0, 1, or 3 corresponding
to a length encoded with 1, 2, or 4 ytes, respectively."
Why does ffmpeg always set this field to always have a value of 3
indicating a NALUnitLength of 4 (ffmpeg sets byte to 0xff, includes
the reserved 6 bits)? Does this mean that x264 always generates the
same size for this field
Also is it possible tell x264 what size the NALUnitLength should be?
This causes problems when I have multiple SPS/PPS entrys specified in
the AVC Decoder Configuration Record. These different SPS/PPS entrys
respresent bitstreams for the same sequence of images, including the
original bitstream. 9 out of 10 times these all have the same length
specified for the NALUnitLength however some video content has a
different value here in its original form, which means I cannot use
ffmpeg to generate a different bitstream varient for these images that
will work with the original.
Does a value that isnt 4 here indicate special type of AVC content,
e.g. one that contains b-frames?
Thanks
Herbie
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;
}
}
More information about the x264-devel
mailing list