---
sidebar:
  hidden: true
title: roboto.experimental.video.h265
---
Minimal H.265 (HEVC) Annex B bitstream inspection.

Implements only the byte-level parsing needed to drive a GOP-aware decoder: splitting a frame's data into NAL units and detecting keyframes (IRAP pictures). It neither decodes video nor parses variable-length fields — the decoder reads everything else from the in-band parameter sets.

The start-code scan shared with H.264 lives in [`annexb`](/docs/reference/python-sdk/roboto/experimental/video/annexb); this module adds the H.265 specifics: a 2-byte NAL header whose first byte carries a 6-bit type in bits 6..1 (ITU-T H.265 section 7.3.1.2).

## Module Contents

- [NalUnit](/reference/python-sdk/roboto/experimental/video/annexb#roboto.experimental.video.annexb.NalUnit) (class): One NAL unit split out of Annex B-framed data.

### NalUnitType

```python
class roboto.experimental.video.h265.NalUnitType
```

`from roboto.experimental.video.h265 import NalUnitType`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/video/h265.py#L37-L51)

Bases: `enum.IntEnum`

H.265 NAL unit types (ITU-T H.265 table 7-1) relevant to this module.

NAL headers can carry any 6-bit type value, so [`NalUnit.type`](/reference/python-sdk/roboto/experimental/video/annexb#roboto.experimental.video.annexb.NalUnit.type) is a plain `int`; compare against these members for the types that matter here.

**Attributes**

- **NalUnitType.BLA_W_LP** = `16`
- **NalUnitType.CRA_NUT** = `21`
- **NalUnitType.IDR_N_LP** = `20`
- **NalUnitType.IDR_W_RADL** = `19`
- **NalUnitType.PICTURE_PARAMETER_SET** = `34`
- **NalUnitType.SEQUENCE_PARAMETER_SET** = `33`
- **NalUnitType.TRAIL_R** = `1`
- **NalUnitType.VIDEO_PARAMETER_SET** = `32`

### find_nal_units()

```python
def roboto.experimental.video.h265.find_nal_units(
    data: bytes,
) -> list[roboto.experimental.video.annexb.NalUnit]
```

`from roboto.experimental.video.h265 import find_nal_units`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/video/h265.py#L58-L76)

Split Annex B-framed H.265 data into its NAL units.

**Parameters**

- **data** (`bytes`): One frame's Annex B-framed bytes, using 3-byte or 4-byte start codes.

**Returns**

- `list[roboto.experimental.video.annexb.NalUnit]`: The frame's NAL units in bitstream order. Each unit's `data` is a copy of the unit's bytes (header included, start code excluded).

**Usage**

```python
from roboto.experimental.video.h265 import NalUnitType, find_nal_units
units = find_nal_units(annex_b_frame_bytes)
[unit.type for unit in units]
# [32, 33, 34, 19]
```

### is_keyframe()

```python
def roboto.experimental.video.h265.is_keyframe(data: bytes) -> bool
```

`from roboto.experimental.video.h265 import is_keyframe`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/video/h265.py#L79-L93)

Whether the Annex B-framed H.265 frame contains an IRAP picture.

An IRAP picture (IDR, CRA, or BLA) is a clean decoder entry point: decoding may start at this frame without any earlier GOP state. Frames without one are delta frames, decodable only after the preceding keyframe has been fed to the decoder.

**Parameters**

- **data** (`bytes`): One frame's Annex B-framed bytes.

**Returns**

- `bool`: True when the frame contains an IRAP picture.
