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

Extracts `onMetaData` from RTMP data messages.

Encoders send stream metadata (resolution, frame rate, codecs, bitrates,
encoder name) as a data message, usually wrapped as
`@setDataFrame("onMetaData", {...})` and sometimes as a bare
`onMetaData({...})`. Both are accepted. The result is a map with the
encoder's own keys, e.g.:

    %{"width" => 1920.0, "height" => 1080.0, "framerate" => 30.0,
      "videocodecid" => 7.0, "audiocodecid" => 10.0,
      "encoder" => "Lavf61.7.100"}

Numbers are floats (AMF0 has no integer type). Other data messages
(`onTextData`, `onCuePoint`, ...) are ignored.

# `parse`

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

Returns `{:ok, metadata}`, `:ignore` for other data messages, or `{:error, reason}`.

---

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