# `MOQX.Catalog.Track`
[🔗](https://github.com/dmorn/moqx/blob/main/lib/moqx/catalog/track.ex#L1)

A single track entry from a CMSF catalog.

Tracks represent individual media streams (video, audio, timeline, etc.)
discovered from a remote relay's catalog. Use the fields directly to inspect
track metadata such as codec, role, or packaging.

The `raw` field preserves the original JSON map for forward compatibility
with catalog fields not yet modeled as struct keys.

Beyond raw access, this module also provides:

- `explicit_metadata/1` for normalized, explicitly signaled metadata
- `extra_metadata/1` for unknown extension keys from `raw`
- `inferred_metadata/1` for best-effort derived hints (e.g. container)
- `describe/1` to combine all three views

# `inferred_container`

```elixir
@type inferred_container() :: :cmaf | :fmp4 | nil
```

# `t`

```elixir
@type t() :: %MOQX.Catalog.Track{
  codec: String.t() | nil,
  depends: [String.t()],
  init_data: binary() | nil,
  name: String.t(),
  packaging: String.t() | nil,
  raw: map(),
  role: String.t() | nil
}
```

# `describe`

```elixir
@spec describe(t()) :: %{explicit: map(), inferred: map(), extra: map()}
```

Returns `%{explicit: ..., inferred: ..., extra: ...}` for one track.

# `explicit_metadata`

```elixir
@spec explicit_metadata(t()) :: map()
```

Returns normalized metadata explicitly signaled by the catalog for this track.

Fields absent from the catalog are omitted from the returned map.

# `extra_metadata`

```elixir
@spec extra_metadata(t()) :: map()
```

Returns raw catalog keys not currently modeled as known metadata fields.

# `inferred_metadata`

```elixir
@spec inferred_metadata(t()) :: map()
```

Returns best-effort inferred metadata derived from explicit fields.

This does not replace explicit catalog signaling. It adds practical hints,
such as inferred container type.

---

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