# `FFix.Discovery.Parser`
[🔗](https://github.com/akash-akya/ffix/blob/v0.2.0/lib/ffix/discovery/parser.ex#L1)

Parse saved FFmpeg capability listings and help text.

Use `FFix.Discovery` to query an executable. Use these parsers when you
already have its output, for example from a saved deployment report:

    text = File.read!("encoder-help.txt")
    {:ok, details} = FFix.Discovery.Parser.help(:encoder, text)

Functions return `{:ok, metadata}` or `{:error, error}`. Catalog entries keep
alias groups in `names`. Component help keeps ordered option sections,
properties, and notes. Names, flags, and property labels remain strings.

## Option records

Options contain `name`, `type`, `flags`, `help`, `declared_default`, `ranges`,
and ordered `constants`. Defaults, bounds, and constant values keep their
printed spelling, including quotes. Unknown types use `{:unknown, name}`;
array types use `{:array, type}`.

These fields describe FFmpeg's help. They are useful for reference displays;
actual accepted values can depend on other options and runtime conditions.

# `result`

```elixir
@type result(value) :: {:ok, value} | {:error, FFix.Discovery.Error.t()}
```

# `help`

```elixir
@spec help(atom(), String.t()) :: result(map())
```

Parses help for one component, rejecting multi-implementation responses.

Protocol help only identifies option classes, so its `names` list is empty.
`FFix.Discovery.help/3` supplies protocol names from the registry instead.
`properties` is an ordered list of `{label, value}` strings, not a merged map.
Filter pads are ordered lists or `%{dynamic: description}`. Mixed fixed/dynamic
declarations retain the fixed list and add `dynamic_pads` keyed by direction.

# `list`

```elixir
@spec list(atom(), String.t()) :: result([map()])
```

Parses a catalog for a kind accepted by `FFix.Discovery.list/2`.
For format entries, `device?` is `nil` when an older listing omits that flag.

# `options`

```elixir
@spec options(String.t()) :: result([map()])
```

Parses the rows of one AVOptions section, without its heading.

# `shared`

```elixir
@spec shared(String.t()) :: result([map()])
```

Extracts AVCodecContext, AVFormatContext, AVIOContext, and URLContext sections
from full help. They remain separate from private options.

# `version`

```elixir
@spec version(String.t()) :: result(map())
```

Parses `ffmpeg -version` output into version, configuration, and library fields, retaining the original text.

---

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