---
sidebar:
  hidden: true
title: 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`](/docs/reference/python-sdk/roboto/experimental/video/h264), [`h265`](/docs/reference/python-sdk/roboto/experimental/video/h265)) interpret the headers.

## Module Contents

### NalUnit

```python
class roboto.experimental.video.annexb.NalUnit
```

`from roboto.experimental.video import NalUnit`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/video/annexb.py#L22-L29)

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

**Attributes**

- **NalUnit.data** (`bytes`): The unit's bytes: header included, start code excluded.
- **NalUnit.type** (`int`): `nal_unit_type` from the unit's header (codec-specific layout).

### nal_payload_bounds()

```python
def roboto.experimental.video.annexb.nal_payload_bounds(
    data: bytes,
) -> list[tuple[int, int]]
```

`from roboto.experimental.video.annexb import nal_payload_bounds`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/video/annexb.py#L32-L63)

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`)

**Returns**

- `list[tuple[int, int]]`
