Expand description
H264 SDP and payload-format helpers derived from RFC 6184.
Packet helpers in this module receive the H264 RTP payload slice. The first byte of that slice identifies the packetization mode used by the packet. Decoder-refresh detection needs to recognize IDR access units in all packet shapes that browsers commonly send.
Single NAL unit packet
+-------------+----------------------+
| NAL header | NAL payload |
+-------------+----------------------+
| F NRI Type | ... |
+-------------+----------------------+
STAP-A aggregation packet
+---------------+----------+-------------+----------+-------------+
| STAP-A header | NAL size | NAL bytes | NAL size | NAL bytes |
+---------------+----------+-------------+----------+-------------+
| Type=24 | 16 bits | starts with | 16 bits | starts with |
| | | NAL header | | NAL header |
+---------------+----------+-------------+----------+-------------+
FU-A fragmentation packet
+---------------+-------------+----------------------+
| FU indicator | FU header | fragment payload |
+---------------+-------------+----------------------+
| Type=28 | S E R Type | first fragment if S=1 |
+---------------+-------------+----------------------+rfc 6184 maps profile-level-id to three bytes:
profile_idc | profile-iop | level_idc
profile-iop bit layout:
7 6 5 4 3 2 1 0
+---+---+---+---+---+---+---+---+
|c0 |c1 |c2 |c3 |c4 |c5 | r | r |
+---+---+---+---+---+---+---+---+
cN = constraint_setN_flag
r = reserved_zero bitStructsยง
- Profile
IopPattern ๐ - masked
profile-iopmatcher for profile-equivalence wildcard bits - Profile
Level Id - parsed H264
profile-level-idcapability - Profile
Pattern ๐ - one accepted RFC 6184 profile-equivalence row
Enumsยง
- Level
Idc - H264 decoder capability level
- Packetization
Mode - H264 RTP packetization mode.
- Profile
- H264 sub-profile after equivalent RFC 6184 encodings are normalized
Constantsยง
- BASELINE_
IDC ๐ - CAVLC_
444_ ๐IDC - EXTENDED_
IDC ๐ - FU_
END_ BIT - FU-A end bit in the FU header.
- FU_
START_ BIT - FU-A start bit in the FU header.
- HIGH_
10_ ๐IDC - HIGH_
422_ ๐IDC - HIGH_
444_ ๐IDC - HIGH_
IDC ๐ - IOP_
CONSTRAINED_ ๐BASELINE - IOP_
CONSTRAINT_ ๐SET0 - IOP_
CONSTRAINT_ ๐SET1 - IOP_
CONSTRAINT_ ๐SET2 - IOP_
CONSTRAINT_ ๐SET3 - IOP_
NONE ๐ - IOP_
PROFILE_ ๐PATTERN_ LOW_ ZERO_ MASK - LEVEL_
1B_ ๐IDCS - LEVEL_
1B_ ๐OTHER_ IDC - LEVEL_
1_ ๐1_ IDC - MAIN_
IDC ๐ - NAL_
REF_ IDC_ HIGH - Highest NRI value for reference NAL units.
- NAL_
UNIT_ TYPE_ FU_ A - H264 FU-A fragmentation packet type.
- NAL_
UNIT_ TYPE_ IDR - H264 IDR slice NAL unit type.
- NAL_
UNIT_ TYPE_ MASK - Mask for the H264 NAL unit type field.
- NAL_
UNIT_ TYPE_ STAP_ A - H264 STAP-A aggregation packet type.
- PROFILE_
PATTERNS ๐
Functionsยง
- decode_
hex_ ๐byte - decode_
hex_ ๐nibble - fu_
a_ ๐starts_ idr - Detects whether a FU-A packet is the first fragment of an IDR NAL unit.
- level_
1b_ ๐profile_ level_ id_ bytes - level_
idc_ ๐value - normalized_
level_ ๐idc - pack_
profile_ ๐level_ id - parse_
profile_ ๐level_ id_ bytes - payload_
starts_ idr - Detects an H264 RTP packet that starts an IDR access unit.
- profile_
bytes ๐ - profile_
from_ ๐bytes - profile_
level_ ๐id_ bytes - stap_
a_ ๐contains_ idr - Scans a STAP-A payload for any contained IDR NAL unit.