1. Fully qualified codec strings
The codec string begins with the prefix "avc1." or "avc3.", with a suffix of 6 characters as described respectively in Section 3.4 of [rfc6381] and Section 5.4.1 of [iso14496-15].
2. VideoDecoderConfig description
If the VideoDecoderConfig.description
is present, it is assumed to be an AVCDecoderConfigurationRecord
, as defined by [iso14496-15], section
5.3.3.1, and the bitstream is assumed to be in avc
format.
NOTE: This format is commonly used in .MP4 files, where the player generally has random access to the media data.
If the VideoDecoderConfig.description
is not present, the bitstream is
assumed to be in annexb
format.
NOTE: "annexb" format is described in greater detail by [ITU-T-REC-H.264], Annex B. This format is commonly used in live-streaming applications, where including the SPS and PPS data periodically allows users to easily start from the middle of the stream.
3. VideoEncoderConfig extensions
partial dictionary VideoEncoderConfig {AvcEncoderConfig avc ; };
avc
, of type AvcEncoderConfig- Contains codec specific configuration options for the AVC (H.264) codec.
3.1. AvcEncoderConfig
dictionary {
AvcEncoderConfig AvcBitstreamFormat format = "avc"; };
format
, of type AvcBitstreamFormat, defaulting to"avc"
- Configures the format of output
EncodedVideoChunk
s. SeeAvcBitstreamFormat
.
3.2. AvcBitstreamFormat
enum {
AvcBitstreamFormat "annexb" ,"avc" , };
The AvcBitstreamFormat
determines the location of AVC Sequence Parameter
Set (SPS) and Picture Parameter Set (PPS) data, and mechanisms for packaging
the bitstream.
SPS and PPS are described in greater detail in sections G.3.41 and G.3.55 of [ITU-T-REC-H.264].
annexb
-
SPS and PPS data are included periodically throughout the bitstream.
NOTE: This format is described in greater detail by [ITU-T-REC-H.264], Annex B. This format is commonly used in live-streaming applications, where including the SPS and PPS data periodically allows users to easily start from the middle of the stream.
avc
-
SPS and PPS data are not included in the bitstream and are instead emitted
via the [[output callback]] as the
VideoDecoderConfig.description
of theEncodedVideoChunkMetadata.decoderConfig
.NOTE: This format is described in greater detail by [iso14496-15], section 5.3.3.1. This format is commonly used in .MP4 files, where the player generally has random access to the media data.
4. EncodedVideoChunk data
EncodedVideoChunk
[[internal data]] is expected to be
an access unit as defined in [ITU-T-REC-H.264] section 7.4.1.2.
NOTE: An access unit contains exactly one primary coded picture.
If the bitstream is in avc
format, [[internal data]] is assumed to be in canonical format, as
defined in [iso14496-15] section 5.3.2.
If the bitstream is in annexb
format, [[internal data]] is assumed to be in in Annex B format,
as defined in [ITU-T-REC-H.264] Annex B.
NOTE: Since [[internal data]] is inherently byte-aligned, implementations are not required to recover byte-alignment.
5. EncodedVideoChunk type
If an EncodedVideoChunk
's [[type]] is key
, and the bitstream is in avc
format, then the EncodedVideoChunk
is expected to
contain a primary coded picture that is an instantaneous decoding refresh (IDR)
picture.
NOTE: If the bitstream is in avc
format, parameter sets
necessary for decoding are included in VideoDecoderConfig.description
.
If an EncodedVideoChunk
's [[type]] is key
, and the bitstream is in annexb
format, then the EncodedVideoChunk
is expected
to contain both a primary coded picture that is an instantaneous decoding
refresh (IDR) picture, and all parameter sets necessary to decode all video data
NAL units in the EncodedVideoChunk
.
6. Privacy and Security Considerations
Please refer to the Privacy Considerations and Security Considerations sections in [WEBCODECS].