Available on crate features
codec-h264 and codec only.Expand description
H.264 (AVC) bitstream helpers: NAL iteration, Annex-B ↔ AVCC conversion, and SPS resolution extraction.
Structs§
- H264
CodecParserimplementation for H.264 / AVC.- SpsInfo
- Decoded video dimensions and profile from a sequence parameter set.
Constants§
- NAL_IDR
- NAL unit type for a coded slice of an IDR picture (keyframe).
- NAL_PPS
- NAL unit type for a picture parameter set.
- NAL_SPS
- NAL unit type for a sequence parameter set.
Functions§
- annexb_
to_ avcc - Convert an Annex-B bytestream to AVCC (length-prefixed) with a 4-byte length.
- avcc_
to_ annexb - Convert an AVCC (length-prefixed) bytestream to Annex-B (
00 00 00 01). - hls_
codec_ string - The HLS
CODECSattribute for H.264, e.g."avc1.4d401f"(profile/level encoded asavc1.PPCCLL). The middle byte is the constraint-set flags (0). - iter_
nals_ annexb - Iterate the NAL units of an Annex-B (
00 00 01/00 00 00 01) bytestream, yielding each NAL payload without its start code. - parse_
sps - Parse a sequence parameter set NAL (including its 1-byte NAL header) and
extract the coded resolution. Returns
Noneon a malformed SPS or one using a scaling matrix (unsupported here).