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. 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.
3. VideoDecoderConfig description
If the 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 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.
4. 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
.
5. VideoEncoderConfig extensions
partial dictionary VideoEncoderConfig {AvcEncoderConfig avc ; };
avc
, of type AvcEncoderConfig- Contains codec specific configuration options for the AVC (H.264) codec.
5.1. AvcEncoderConfig
dictionary {
AvcEncoderConfig AvcBitstreamFormat format = "avc"; };
format
, of type AvcBitstreamFormat, defaulting to"avc"
- Configures the format of output
EncodedVideoChunk
s. SeeAvcBitstreamFormat
.
5.2. AvcBitstreamFormat
enum {
AvcBitstreamFormat "annexb" ,"avc" , };
The AvcBitstreamFormat
determines the location of AVC parameter sets, and
mechanisms for packaging the bitstream.
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 theVideoDecoderConfig.description
of theEncodedVideoChunkMetadata.decoderConfig
.NOTE: This format is described in greater detail by [iso14496-15], section 5.3. This format is commonly used in .MP4 files, where the player generally has random access to the media data.
6. VideoEncoderEncodeOptions extensions
partial dictionary VideoEncoderEncodeOptions {VideoEncoderEncodeOptionsForAvc avc ; };
avc
, of type VideoEncoderEncodeOptionsForAvc- Contains codec specific encode options for the [ITU-T-REC-H.264] codec.
6.1. VideoEncoderEncodeOptionsForAvc
dictionary {
VideoEncoderEncodeOptionsForAvc unsigned short ?quantizer ; };
quantizer
, of type unsigned short, nullable- Sets per-frame quantizer value. In [ITU-T-REC-H.264] the quantizer threshold can be varied from 0 to 51.
7. Privacy Considerations
Please refer to the section Privacy Considerations in [WEBCODECS].
8. Security Considerations
Please refer to the section Security Considerations in [WEBCODECS].