AV1 is built from open bitstream units, or OBUs. Finding their boundaries requires reading the stated framing rather than treating every incoming byte chunk as one frame. In the low-overhead format, an OBU header is followed by a variable-length size field and the OBU’s payload.
Distinguish the header from its payload length
The obu_has_size_field flag says whether the obu_size field is present. In the specification’s low-overhead bitstream format, that flag must be one. The size is encoded with leb128, so its storage can occupy more than one byte. A parser must consume the size field correctly before using the decoded value to locate the payload’s end. The optional extension header also changes where that field begins.
Use a small boundary calculation
Consider an illustrative OBU with a one-byte header, no extension, a one-byte size field and a payload length of ten bytes. Its total occupied space is twelve bytes. Advancing by ten from the start of the header would land inside its payload. Advancing by twelve reaches the next OBU. Larger size values can require a longer leb128 field, so the twelve-byte shortcut cannot become a general parsing rule.
Establish the surrounding format
AV1 also specifies a length-delimited format in Annex B, with additional enclosing lengths that help locate frames and temporal units. Other bindings can define their own packing arrangements. Where an OBU has no internal size field, the general syntax derives its payload size from an externally supplied length after accounting for its header. Therefore a container demuxer and a decoder-facing parser need an agreed description of what their lengths include.
Do not infer picture count from byte chunks
Sequence headers, metadata, frame headers and tile groups have different OBU roles. Multiple units can contribute to a picture, while a transport read can split a unit between buffers. A useful diagnostic captures the selected bitstream binding, header bytes, decoded lengths and available payload bytes. That evidence can identify a framing disagreement without asserting that AV1 itself or a particular ProMax player is unsupported.
