Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.experimental.video.annexb

Annex B framing shared by the NAL-based codecs (H.264 and H.265).

Annex B delimits NAL units with start codes; that framing is identical across H.264 and H.265 — only the NAL header layout after each start code differs (1-byte header with a 5-bit type vs. 2-byte header with a 6-bit type). This module holds the codec-independent start-code scan; the per-codec modules (h264, h265) interpret the headers.

Module Contents

NalUnit

class roboto.experimental.video.annexb.NalUnit#View Source

One NAL unit split out of Annex B-framed data.

Attributes

NalUnit.data

data bytes #

The unit’s bytes: header included, start code excluded.

NalUnit.type

type int #

nal_unit_type from the unit’s header (codec-specific layout).

nal_payload_bounds()

roboto.experimental.video.annexb.nal_payload_bounds(data)#View Source

Locate every NAL unit payload as a (start, end) byte range.

Handles both 3-byte (00 00 01) and 4-byte (00 00 00 01) start codes. Zero-length units are skipped.

Parameters

data bytes

Return type

list[tuple[int, int]]

Was this page helpful?