Network Abstraction Layer (NAL) adaptation flag reference

This section contains information about available flags for the StreamInfo.NalAdaptationFlags enumeration.

The elementary stream in an application can be in either Annex-B or AVCC format:

  • The Annex-B format delimits NALUs (Network Abstraction Layer units) with two bytes of zeroes, followed by one or three bytes of zeroes, followed by the number 1 (called a start code, for example, 00000001).

  • The AVCC format also wraps NALUs, but each NALU is preceded by a value that indicates the size of the NALU (usually four bytes).

Many encoders produce the Annex-B bitstream format. Some higher-level bitstream processors (such as a playback engine or the Media Source Extensions (MSE) player in the AWS Management Console) use the AVCC format for their frames.

The codec private data (CPD), which is SPS/PPS (Sequence Parameter Set/Picture Parameter Set) for the H.264 codec, can also be in Annex-B or AVCC format. However, for the CPD, the formats are different from those described previously.

The flags tell the SDK to adapt the NALUs to AVCC or Annex-B for frame data and CPD as follows:

Flag Adaptation
NAL_ADAPTATION_FLAG_NONE No adaptation.
NAL_ADAPTATION_ANNEXB_NALS Adapt Annex-B NALUs to AVCC NALUs.
NAL_ADAPTATION_AVCC_NALS Adapt AVCC NALUs to Annex-B NALUs.
NAL_ADAPTATION_ANNEXB_CPD_NALS Adapt Annex-B NALUs for the codec private data to AVCC format NALUs.
NAL_ADAPTATION_ANNEXB_CPD_AND_FRAME_NALS Adapt Annex-B NALUs for the codec and frame private data to AVCC format NALUs.

For more information about NALU types, see Section 1.3: Network Abstraction Layer Unit Types in RFC 3984.