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

Choose how FFmpeg reads an input format.

For ordinary media files, start with `FFix.input/2`: FFmpeg usually detects
their format. Select a demuxer when the input needs extra information, such as
the dimensions of raw video or the sample rate of raw audio.

## Read raw frames

    alias FFix.{Demuxer, Encoder, Muxer}

    source =
      Demuxer.rawvideo("frames.rgb",
        video_size: "1920x1080",
        pixel_format: "rgb24",
        framerate: 30
      )

    output = source |> FFix.video(0) |> Encoder.libx264() |> Muxer.mp4("frames.mp4")
    FFix.command(output)

A raw frame file carries no header describing its size or pixel layout, so
these options must match the data. The demuxer returns an input declaration;
select its streams in the same way as any other input.

## Input controls

Pass format-specific options directly to the helper. General input controls,
such as seeking, go in `input_options:`:

    FFix.Demuxer.mov("interview.mp4", input_options: [ss: 30])

`mov/2` reads the MOV/MP4 family of containers. Input and output format names
can differ; use `FFix.Muxer` to choose the destination format.

Use `demux/3` for other format names, including FFmpeg input devices. Named
helpers use the recorded option reference; `raw:` accepts newer option names
as described in `FFix.Encoder`. Check `FFix.Discovery` for the formats and device
backends available in your build.

See the [FFmpeg demuxer reference](https://ffmpeg.org/ffmpeg-formats.html#Demuxers).

# `image2_option`

```elixir
@type image2_option() ::
  {:analyzeduration, integer() | String.t()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:export_path_metadata, boolean() | :auto | String.t()}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:framerate, number() | String.t()}
  | {:loop, boolean() | :auto | String.t()}
  | {:max_delay, integer() | String.t()}
  | {:pattern_type,
     integer() | String.t() | :glob_sequence | :glob | :sequence | :none}
  | {:pixel_format, String.t() | atom()}
  | {:probesize, integer() | String.t()}
  | {:start_number, integer() | String.t()}
  | {:start_number_range, integer() | String.t()}
  | {:ts_from_file, integer() | String.t() | :none | :sec | :ns}
  | {:video_size, String.t() | atom()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `lavfi_option`

```elixir
@type lavfi_option() ::
  {:analyzeduration, integer() | String.t()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:dumpgraph, String.t() | atom()}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:graph, String.t() | atom()}
  | {:graph_file, String.t() | atom()}
  | {:max_delay, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `m4a_option`

```elixir
@type m4a_option() ::
  {:activation_bytes, String.t() | atom()}
  | {:advanced_editlist, boolean() | :auto | String.t()}
  | {:analyzeduration, integer() | String.t()}
  | {:audible_fixed_key, String.t() | atom()}
  | {:audible_iv, String.t() | atom()}
  | {:audible_key, String.t() | atom()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:decryption_key, String.t() | atom()}
  | {:enable_drefs, boolean() | :auto | String.t()}
  | {:export_all, boolean() | :auto | String.t()}
  | {:export_xmp, boolean() | :auto | String.t()}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:ignore_chapters, boolean() | :auto | String.t()}
  | {:ignore_editlist, boolean() | :auto | String.t()}
  | {:interleaved_read, boolean() | :auto | String.t()}
  | {:max_delay, integer() | String.t()}
  | {:max_stts_delta, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:seek_streams_individually, boolean() | :auto | String.t()}
  | {:use_absolute_path, boolean() | :auto | String.t()}
  | {:use_mfra_for, integer() | String.t() | :auto | :dts | :pts}
  | {:use_tfdt, boolean() | :auto | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `matroska_option`

```elixir
@type matroska_option() ::
  {:analyzeduration, integer() | String.t()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:max_delay, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `mj2_option`

```elixir
@type mj2_option() ::
  {:activation_bytes, String.t() | atom()}
  | {:advanced_editlist, boolean() | :auto | String.t()}
  | {:analyzeduration, integer() | String.t()}
  | {:audible_fixed_key, String.t() | atom()}
  | {:audible_iv, String.t() | atom()}
  | {:audible_key, String.t() | atom()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:decryption_key, String.t() | atom()}
  | {:enable_drefs, boolean() | :auto | String.t()}
  | {:export_all, boolean() | :auto | String.t()}
  | {:export_xmp, boolean() | :auto | String.t()}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:ignore_chapters, boolean() | :auto | String.t()}
  | {:ignore_editlist, boolean() | :auto | String.t()}
  | {:interleaved_read, boolean() | :auto | String.t()}
  | {:max_delay, integer() | String.t()}
  | {:max_stts_delta, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:seek_streams_individually, boolean() | :auto | String.t()}
  | {:use_absolute_path, boolean() | :auto | String.t()}
  | {:use_mfra_for, integer() | String.t() | :auto | :dts | :pts}
  | {:use_tfdt, boolean() | :auto | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `mov_option`

```elixir
@type mov_option() ::
  {:activation_bytes, String.t() | atom()}
  | {:advanced_editlist, boolean() | :auto | String.t()}
  | {:analyzeduration, integer() | String.t()}
  | {:audible_fixed_key, String.t() | atom()}
  | {:audible_iv, String.t() | atom()}
  | {:audible_key, String.t() | atom()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:decryption_key, String.t() | atom()}
  | {:enable_drefs, boolean() | :auto | String.t()}
  | {:export_all, boolean() | :auto | String.t()}
  | {:export_xmp, boolean() | :auto | String.t()}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:ignore_chapters, boolean() | :auto | String.t()}
  | {:ignore_editlist, boolean() | :auto | String.t()}
  | {:interleaved_read, boolean() | :auto | String.t()}
  | {:max_delay, integer() | String.t()}
  | {:max_stts_delta, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:seek_streams_individually, boolean() | :auto | String.t()}
  | {:use_absolute_path, boolean() | :auto | String.t()}
  | {:use_mfra_for, integer() | String.t() | :auto | :dts | :pts}
  | {:use_tfdt, boolean() | :auto | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `mp3_option`

```elixir
@type mp3_option() ::
  {:analyzeduration, integer() | String.t()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:max_delay, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:usetoc, boolean() | :auto | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `mp4_option`

```elixir
@type mp4_option() ::
  {:activation_bytes, String.t() | atom()}
  | {:advanced_editlist, boolean() | :auto | String.t()}
  | {:analyzeduration, integer() | String.t()}
  | {:audible_fixed_key, String.t() | atom()}
  | {:audible_iv, String.t() | atom()}
  | {:audible_key, String.t() | atom()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:decryption_key, String.t() | atom()}
  | {:enable_drefs, boolean() | :auto | String.t()}
  | {:export_all, boolean() | :auto | String.t()}
  | {:export_xmp, boolean() | :auto | String.t()}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:ignore_chapters, boolean() | :auto | String.t()}
  | {:ignore_editlist, boolean() | :auto | String.t()}
  | {:interleaved_read, boolean() | :auto | String.t()}
  | {:max_delay, integer() | String.t()}
  | {:max_stts_delta, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:seek_streams_individually, boolean() | :auto | String.t()}
  | {:use_absolute_path, boolean() | :auto | String.t()}
  | {:use_mfra_for, integer() | String.t() | :auto | :dts | :pts}
  | {:use_tfdt, boolean() | :auto | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `rawvideo_option`

```elixir
@type rawvideo_option() ::
  {:analyzeduration, integer() | String.t()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:framerate, number() | String.t()}
  | {:max_delay, integer() | String.t()}
  | {:pixel_format, String.t() | atom()}
  | {:probesize, integer() | String.t()}
  | {:video_size, String.t() | atom()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `s16le_option`

```elixir
@type s16le_option() ::
  {:analyzeduration, integer() | String.t()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:ch_layout, String.t() | atom()}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:max_delay, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:sample_rate, integer() | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `t`

```elixir
@type t() :: %FFix.Demuxer{
  name: String.t() | nil,
  options: [FFix.Command.av_option()]
}
```

# `webm_option`

```elixir
@type webm_option() ::
  {:analyzeduration, integer() | String.t()}
  | {:avioflags, integer() | String.t() | [String.t() | :direct] | :direct}
  | {:fflags,
     integer()
     | String.t()
     | [
         String.t()
         | :flush_packets
         | :ignidx
         | :genpts
         | :nofillin
         | :noparse
         | :igndts
         | :discardcorrupt
         | :sortdts
         | :fastseek
         | :nobuffer
         | :bitexact
         | :shortest
         | :autobsf
       ]
     | :flush_packets
     | :ignidx
     | :genpts
     | :nofillin
     | :noparse
     | :igndts
     | :discardcorrupt
     | :sortdts
     | :fastseek
     | :nobuffer
     | :bitexact
     | :shortest
     | :autobsf}
  | {:max_delay, integer() | String.t()}
  | {:probesize, integer() | String.t()}
  | {:raw, [FFix.Command.av_option()]}
  | {:input_options, [FFix.Command.option()]}
```

# `demux`

```elixir
@spec demux(FFix.Command.Input.source(), String.t(), list()) :: FFix.Command.Input.t()
```

Declares an input using an FFmpeg format name and its options.

    FFix.Demuxer.demux("recording.pcm", "s16le", sample_rate: 48000)

Names and options are passed to FFmpeg. General input controls go in
`input_options:`. Use `FFix.Decoder` for decoding settings after declaring the input.

# `image2`

```elixir
@spec image2(FFix.Command.Input.source(), [image2_option()]) :: FFix.Command.Input.t()
```

image2 sequence

Declares an input in image2 format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `pattern_type` (int): set pattern type (from 0 to INT_MAX) (default 4) Values: `glob_sequence`, `glob`, `sequence`, `none`.
- `start_number` (int): set first number in the sequence (from INT_MIN to INT_MAX) (default 0)
- `start_number_range` (int): set range for looking at the first sequence number (from 1 to INT_MAX) (default 5)
- `ts_from_file` (int): set frame timestamp from file's one (from 0 to 2) (default none) Values: `none`, `sec`, `ns`.
- `export_path_metadata` (boolean): enable metadata containing input path information (default false)
- `framerate` (video_rate): set the video framerate (default "25")
- `pixel_format` (string): set video pixel format
- `video_size` (image_size): set video size
- `loop` (boolean): force loop over input file sequence (default false)
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

# `lavfi`

```elixir
@spec lavfi(FFix.Command.Input.source(), [lavfi_option()]) :: FFix.Command.Input.t()
```

Libavfilter virtual input device

Declares an input in lavfi format. See `FFix.Demuxer` for usage and option conventions.

## Example

    FFix.Demuxer.lavfi("testsrc2=size=640x360:duration=2")

## Options

- `graph` (string): set libavfilter graph
- `graph_file` (string): set libavfilter graph filename
- `dumpgraph` (string): dump graph to stderr
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

# `m4a`

```elixir
@spec m4a(FFix.Command.Input.source(), [m4a_option()]) :: FFix.Command.Input.t()
```

QuickTime / MOV

Declares an input in m4a format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `use_absolute_path` (boolean): allow using absolute path when opening alias, this is a possible security issue (default false)
- `seek_streams_individually` (boolean): Seek each stream individually to the closest point (default true)
- `ignore_editlist` (boolean): Ignore the edit list atom. (default false)
- `advanced_editlist` (boolean): Modify the AVIndex according to the editlists. Use this option to decode in the order specified by the edits. (default true)
- `ignore_chapters` (boolean): (default false)
- `use_mfra_for` (int): use mfra for fragment timestamps (from -1 to 2) (default auto) Values: `auto`, `dts`, `pts`.
- `use_tfdt` (boolean): use tfdt for fragment timestamps (default true)
- `export_all` (boolean): Export unrecognized metadata entries (default false)
- `export_xmp` (boolean): Export full XMP metadata (default false)
- `activation_bytes` (binary): Secret bytes for Audible AAX files
- `audible_key` (binary): AES-128 Key for Audible AAXC files
- `audible_iv` (binary): AES-128 IV for Audible AAXC files
- `audible_fixed_key` (binary): Fixed key used for handling Audible AAX files
- `decryption_key` (binary): The media decryption key (hex)
- `enable_drefs` (boolean): Enable external track support. (default false)
- `max_stts_delta` (int): treat offsets above this value as invalid (from 0 to UINT32_MAX) (default 4294487295)
- `interleaved_read` (boolean): Interleave packets from multiple tracks at demuxer level (default true)
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif,heic,heif.

# `matroska`

```elixir
@spec matroska(FFix.Command.Input.source(), [matroska_option()]) ::
  FFix.Command.Input.t()
```

Matroska / WebM

Declares an input in matroska format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: mkv,mk3d,mka,mks,webm.

# `mj2`

```elixir
@spec mj2(FFix.Command.Input.source(), [mj2_option()]) :: FFix.Command.Input.t()
```

QuickTime / MOV

Declares an input in mj2 format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `use_absolute_path` (boolean): allow using absolute path when opening alias, this is a possible security issue (default false)
- `seek_streams_individually` (boolean): Seek each stream individually to the closest point (default true)
- `ignore_editlist` (boolean): Ignore the edit list atom. (default false)
- `advanced_editlist` (boolean): Modify the AVIndex according to the editlists. Use this option to decode in the order specified by the edits. (default true)
- `ignore_chapters` (boolean): (default false)
- `use_mfra_for` (int): use mfra for fragment timestamps (from -1 to 2) (default auto) Values: `auto`, `dts`, `pts`.
- `use_tfdt` (boolean): use tfdt for fragment timestamps (default true)
- `export_all` (boolean): Export unrecognized metadata entries (default false)
- `export_xmp` (boolean): Export full XMP metadata (default false)
- `activation_bytes` (binary): Secret bytes for Audible AAX files
- `audible_key` (binary): AES-128 Key for Audible AAXC files
- `audible_iv` (binary): AES-128 IV for Audible AAXC files
- `audible_fixed_key` (binary): Fixed key used for handling Audible AAX files
- `decryption_key` (binary): The media decryption key (hex)
- `enable_drefs` (boolean): Enable external track support. (default false)
- `max_stts_delta` (int): treat offsets above this value as invalid (from 0 to UINT32_MAX) (default 4294487295)
- `interleaved_read` (boolean): Interleave packets from multiple tracks at demuxer level (default true)
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif,heic,heif.

# `mov`

```elixir
@spec mov(FFix.Command.Input.source(), [mov_option()]) :: FFix.Command.Input.t()
```

QuickTime / MOV

Declares an input in mov format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `use_absolute_path` (boolean): allow using absolute path when opening alias, this is a possible security issue (default false)
- `seek_streams_individually` (boolean): Seek each stream individually to the closest point (default true)
- `ignore_editlist` (boolean): Ignore the edit list atom. (default false)
- `advanced_editlist` (boolean): Modify the AVIndex according to the editlists. Use this option to decode in the order specified by the edits. (default true)
- `ignore_chapters` (boolean): (default false)
- `use_mfra_for` (int): use mfra for fragment timestamps (from -1 to 2) (default auto) Values: `auto`, `dts`, `pts`.
- `use_tfdt` (boolean): use tfdt for fragment timestamps (default true)
- `export_all` (boolean): Export unrecognized metadata entries (default false)
- `export_xmp` (boolean): Export full XMP metadata (default false)
- `activation_bytes` (binary): Secret bytes for Audible AAX files
- `audible_key` (binary): AES-128 Key for Audible AAXC files
- `audible_iv` (binary): AES-128 IV for Audible AAXC files
- `audible_fixed_key` (binary): Fixed key used for handling Audible AAX files
- `decryption_key` (binary): The media decryption key (hex)
- `enable_drefs` (boolean): Enable external track support. (default false)
- `max_stts_delta` (int): treat offsets above this value as invalid (from 0 to UINT32_MAX) (default 4294487295)
- `interleaved_read` (boolean): Interleave packets from multiple tracks at demuxer level (default true)
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif,heic,heif.

# `mp3`

```elixir
@spec mp3(FFix.Command.Input.source(), [mp3_option()]) :: FFix.Command.Input.t()
```

MP2/3 (MPEG audio layer 2/3)

Declares an input in mp3 format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `usetoc` (boolean): use table of contents (default false)
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: mp2,mp3,m2a,mpa.

# `mp4`

```elixir
@spec mp4(FFix.Command.Input.source(), [mp4_option()]) :: FFix.Command.Input.t()
```

QuickTime / MOV

Declares an input in mp4 format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `use_absolute_path` (boolean): allow using absolute path when opening alias, this is a possible security issue (default false)
- `seek_streams_individually` (boolean): Seek each stream individually to the closest point (default true)
- `ignore_editlist` (boolean): Ignore the edit list atom. (default false)
- `advanced_editlist` (boolean): Modify the AVIndex according to the editlists. Use this option to decode in the order specified by the edits. (default true)
- `ignore_chapters` (boolean): (default false)
- `use_mfra_for` (int): use mfra for fragment timestamps (from -1 to 2) (default auto) Values: `auto`, `dts`, `pts`.
- `use_tfdt` (boolean): use tfdt for fragment timestamps (default true)
- `export_all` (boolean): Export unrecognized metadata entries (default false)
- `export_xmp` (boolean): Export full XMP metadata (default false)
- `activation_bytes` (binary): Secret bytes for Audible AAX files
- `audible_key` (binary): AES-128 Key for Audible AAXC files
- `audible_iv` (binary): AES-128 IV for Audible AAXC files
- `audible_fixed_key` (binary): Fixed key used for handling Audible AAX files
- `decryption_key` (binary): The media decryption key (hex)
- `enable_drefs` (boolean): Enable external track support. (default false)
- `max_stts_delta` (int): treat offsets above this value as invalid (from 0 to UINT32_MAX) (default 4294487295)
- `interleaved_read` (boolean): Interleave packets from multiple tracks at demuxer level (default true)
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif,heic,heif.

# `new`

```elixir
@spec new(String.t() | nil, [FFix.Command.av_option()]) :: t()
```

Builds a demuxer configuration for the `demuxer:` option of `FFix.input/2`.

    format = FFix.Demuxer.new("rawvideo", video_size: "640x480", pixel_format: "rgb24")
    FFix.input("frames.rgb", demuxer: format)

A `nil` name keeps automatic format detection while applying the options.

# `rawvideo`

```elixir
@spec rawvideo(FFix.Command.Input.source(), [rawvideo_option()]) ::
  FFix.Command.Input.t()
```

raw video

Declares an input in rawvideo format. See `FFix.Demuxer` for usage and option conventions.

## Example

    FFix.Demuxer.rawvideo("frames.rgb", video_size: "640x480", pixel_format: "rgb24", framerate: 30)

## Options

- `pixel_format` (string): set pixel format (default "yuv420p")
- `video_size` (image_size): set frame size
- `framerate` (video_rate): set frame rate (default "25")
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: yuv,cif,qcif,rgb.

# `s16le`

```elixir
@spec s16le(FFix.Command.Input.source(), [s16le_option()]) :: FFix.Command.Input.t()
```

PCM signed 16-bit little-endian

Declares an input in s16le format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `sample_rate` (int): (from 0 to INT_MAX) (default 44100)
- `ch_layout` (channel_layout): (default "mono")
- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: sw.

# `webm`

```elixir
@spec webm(FFix.Command.Input.source(), [webm_option()]) :: FFix.Command.Input.t()
```

Matroska / WebM

Declares an input in webm format. See `FFix.Demuxer` for usage and option conventions.

## Options

- `avioflags` (flags): (default 0) Values: `direct`.
- `probesize` (int64): set probing size (from 32 to I64_MAX) (default 5000000)
- `fflags` (flags): (default autobsf) Values: `flush_packets`, `ignidx`, `genpts`, `nofillin`, `noparse`, `igndts`, `discardcorrupt`, `sortdts`, `fastseek`, `nobuffer`, `bitexact`, `shortest`, `autobsf`.
- `analyzeduration` (int64): specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0)
- `max_delay` (int): maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1)

## Format and codec details

- Common extensions: mkv,mk3d,mka,mks,webm.

---

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