# `RTMP.FLV.VideoTag`
[🔗](https://github.com/Adeyeye93/rtmp/blob/v0.1.0/lib/rtmp/flv/video_tag.ex#L1)

Parses the body of an RTMP video message (an FLV video tag body).

H.264 (FLV codec id 7) is parsed:

  * The sequence header's AVCDecoderConfigurationRecord is decoded into
    `%{profile: ..., compatibility: ..., level: ..., nalu_length_size: ...,
    sps: [binary], pps: [binary]}`.
  * Media frames carry their composition time offset and are split into
    NAL units, using the NALU length size from the most recent sequence
    header (4 until one arrives).
  * End-of-sequence packets are skipped.

Other legacy FLV video codecs (Sorenson H.263, VP6, Screen Video, ...)
are passed through unparsed. Video info/command frames (frame type 5)
are skipped.

Enhanced RTMP video (the `IsExHeader` bit — HEVC, AV1, VP9 via FourCC) is
not supported and is reported as `{:unsupported, reason}` so the
connection can reject it cleanly.

# `result`

```elixir
@type result() :: {:ok, map()} | :skip | {:error, term()} | {:unsupported, term()}
```

# `parse`

```elixir
@spec parse(binary(), 1..4) :: result()
```

Parses a video message payload into `RTMP.Frame` fields.

`nalu_length_size` is the length-prefix size from the stream's current
AVCDecoderConfigurationRecord.

# `parse_avc_decoder_config`

```elixir
@spec parse_avc_decoder_config(binary()) :: {:ok, map()} | {:error, term()}
```

Decodes an AVCDecoderConfigurationRecord (ISO 14496-15, 5.2.4.1).

# `split_nalus`

```elixir
@spec split_nalus(binary(), 1..4) ::
  {:ok, [binary()]} | {:error, :invalid_nalu_length}
```

Splits length-prefixed (AVCC) NAL units. `size` is the prefix length in bytes.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
