FFix.Decoder (ffix v0.2.0)

Copy Markdown View Source

Configure how an input stream is decoded.

FFmpeg normally chooses a decoder from the input's codec. Use this module to select an implementation or change decoding options, such as its thread count. Configure decoding on the input before selecting streams:

alias FFix.{Decoder, Filter}

source =
  FFix.input("interview.mp4")
  |> Decoder.h264({:video, 0}, threads: 2)

picture = source |> FFix.video(0) |> Filter.scale(w: 640, h: -2)
FFix.output(picture, "preview.mp4") |> FFix.command()

This assumes H.264 video. auto/3 applies options while letting FFmpeg choose the decoder. Output compression is configured separately with FFix.Encoder.

Select the input track

Decoder selectors identify one track:

  • {:video, 0} — the first video track.
  • {:audio, 1} — the second audio track.
  • {:index, 3} — stream 3, counting every stream in the file.

Subtitle, data, and attachment selectors follow the same indexed form. Choose either media-relative selectors or absolute indexes for one input. Mixing them could configure the same track twice under different names.

All uses of that input share its decoding settings. Declare the file twice if you need independent decoding or seeking. See FFix.Command.Input for input reuse. Configuring the same selector again replaces its previous decoder settings.

Named helpers use the recorded option reference. Use decode/4 for other decoder names and raw: for newer options, as described in FFix.Encoder. Availability can be checked through FFix.Discovery.

See the FFmpeg codec reference for decoder-specific options.

Summary

Functions

AAC (Advanced Audio Coding)

Applies decoding options while FFmpeg chooses the implementation.

Configures an input track with an FFmpeg codec or decoder name and options.

H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

HEVC (High Efficiency Video Coding)

Builds a decoder configuration for an input's decoders: map.

PCM signed 16-bit little-endian

Types

aac_option()

@type aac_option() ::
  {:channel_order, integer() | String.t() | :default | :coded}
  | {:dual_mono_mode, integer() | String.t() | :auto | :main | :sub | :both}
  | {:err_detect,
     integer()
     | String.t()
     | [
         String.t()
         | :crccheck
         | :bitstream
         | :buffer
         | :explode
         | :ignore_err
         | :careful
         | :compliant
         | :aggressive
       ]
     | :crccheck
     | :bitstream
     | :buffer
     | :explode
     | :ignore_err
     | :careful
     | :compliant
     | :aggressive}
  | {:flags,
     integer()
     | String.t()
     | [
         String.t()
         | :unaligned
         | :mv4
         | :qpel
         | :loop
         | :gray
         | :psnr
         | :ildct
         | :low_delay
         | :global_header
         | :bitexact
         | :aic
         | :ilme
         | :cgop
         | :output_corrupt
         | :drop_changed
       ]
     | :unaligned
     | :mv4
     | :qpel
     | :loop
     | :gray
     | :psnr
     | :ildct
     | :low_delay
     | :global_header
     | :bitexact
     | :aic
     | :ilme
     | :cgop
     | :output_corrupt
     | :drop_changed}
  | {:flags2,
     integer()
     | String.t()
     | [
         String.t()
         | :fast
         | :noout
         | :ignorecrop
         | :local_header
         | :chunks
         | :showall
         | :export_mvs
         | :skip_manual
         | :ass_ro_flush_noop
         | :icc_profiles
       ]
     | :fast
     | :noout
     | :ignorecrop
     | :local_header
     | :chunks
     | :showall
     | :export_mvs
     | :skip_manual
     | :ass_ro_flush_noop
     | :icc_profiles}
  | {:lowres, integer() | String.t()}
  | {:strict,
     integer()
     | String.t()
     | :very
     | :strict
     | :normal
     | :unofficial
     | :experimental}
  | {:thread_type,
     integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame}
  | {:threads, integer() | String.t() | :auto}
  | {:raw, [FFix.Command.av_option()]}

ac3_option()

@type ac3_option() ::
  {:cons_noisegen, boolean() | :auto | String.t()}
  | {:downmix, String.t() | atom()}
  | {:drc_scale, number() | String.t()}
  | {:err_detect,
     integer()
     | String.t()
     | [
         String.t()
         | :crccheck
         | :bitstream
         | :buffer
         | :explode
         | :ignore_err
         | :careful
         | :compliant
         | :aggressive
       ]
     | :crccheck
     | :bitstream
     | :buffer
     | :explode
     | :ignore_err
     | :careful
     | :compliant
     | :aggressive}
  | {:flags,
     integer()
     | String.t()
     | [
         String.t()
         | :unaligned
         | :mv4
         | :qpel
         | :loop
         | :gray
         | :psnr
         | :ildct
         | :low_delay
         | :global_header
         | :bitexact
         | :aic
         | :ilme
         | :cgop
         | :output_corrupt
         | :drop_changed
       ]
     | :unaligned
     | :mv4
     | :qpel
     | :loop
     | :gray
     | :psnr
     | :ildct
     | :low_delay
     | :global_header
     | :bitexact
     | :aic
     | :ilme
     | :cgop
     | :output_corrupt
     | :drop_changed}
  | {:flags2,
     integer()
     | String.t()
     | [
         String.t()
         | :fast
         | :noout
         | :ignorecrop
         | :local_header
         | :chunks
         | :showall
         | :export_mvs
         | :skip_manual
         | :ass_ro_flush_noop
         | :icc_profiles
       ]
     | :fast
     | :noout
     | :ignorecrop
     | :local_header
     | :chunks
     | :showall
     | :export_mvs
     | :skip_manual
     | :ass_ro_flush_noop
     | :icc_profiles}
  | {:heavy_compr, boolean() | :auto | String.t()}
  | {:lowres, integer() | String.t()}
  | {:strict,
     integer()
     | String.t()
     | :very
     | :strict
     | :normal
     | :unofficial
     | :experimental}
  | {:target_level, integer() | String.t()}
  | {:thread_type,
     integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame}
  | {:threads, integer() | String.t() | :auto}
  | {:raw, [FFix.Command.av_option()]}

h264_option()

@type h264_option() ::
  {:enable_er, boolean() | :auto | String.t()}
  | {:err_detect,
     integer()
     | String.t()
     | [
         String.t()
         | :crccheck
         | :bitstream
         | :buffer
         | :explode
         | :ignore_err
         | :careful
         | :compliant
         | :aggressive
       ]
     | :crccheck
     | :bitstream
     | :buffer
     | :explode
     | :ignore_err
     | :careful
     | :compliant
     | :aggressive}
  | {:flags,
     integer()
     | String.t()
     | [
         String.t()
         | :unaligned
         | :mv4
         | :qpel
         | :loop
         | :gray
         | :psnr
         | :ildct
         | :low_delay
         | :global_header
         | :bitexact
         | :aic
         | :ilme
         | :cgop
         | :output_corrupt
         | :drop_changed
       ]
     | :unaligned
     | :mv4
     | :qpel
     | :loop
     | :gray
     | :psnr
     | :ildct
     | :low_delay
     | :global_header
     | :bitexact
     | :aic
     | :ilme
     | :cgop
     | :output_corrupt
     | :drop_changed}
  | {:flags2,
     integer()
     | String.t()
     | [
         String.t()
         | :fast
         | :noout
         | :ignorecrop
         | :local_header
         | :chunks
         | :showall
         | :export_mvs
         | :skip_manual
         | :ass_ro_flush_noop
         | :icc_profiles
       ]
     | :fast
     | :noout
     | :ignorecrop
     | :local_header
     | :chunks
     | :showall
     | :export_mvs
     | :skip_manual
     | :ass_ro_flush_noop
     | :icc_profiles}
  | {:is_avc, boolean() | :auto | String.t()}
  | {:lowres, integer() | String.t()}
  | {:nal_length_size, integer() | String.t()}
  | {:noref_gray, boolean() | :auto | String.t()}
  | {:skip_frame,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:skip_gray, boolean() | :auto | String.t()}
  | {:skip_idct,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:skip_loop_filter,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:strict,
     integer()
     | String.t()
     | :very
     | :strict
     | :normal
     | :unofficial
     | :experimental}
  | {:thread_type,
     integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame}
  | {:threads, integer() | String.t() | :auto}
  | {:x264_build, integer() | String.t()}
  | {:raw, [FFix.Command.av_option()]}

hevc_option()

@type hevc_option() ::
  {:apply_defdispwin, boolean() | :auto | String.t()}
  | {:err_detect,
     integer()
     | String.t()
     | [
         String.t()
         | :crccheck
         | :bitstream
         | :buffer
         | :explode
         | :ignore_err
         | :careful
         | :compliant
         | :aggressive
       ]
     | :crccheck
     | :bitstream
     | :buffer
     | :explode
     | :ignore_err
     | :careful
     | :compliant
     | :aggressive}
  | {:flags,
     integer()
     | String.t()
     | [
         String.t()
         | :unaligned
         | :mv4
         | :qpel
         | :loop
         | :gray
         | :psnr
         | :ildct
         | :low_delay
         | :global_header
         | :bitexact
         | :aic
         | :ilme
         | :cgop
         | :output_corrupt
         | :drop_changed
       ]
     | :unaligned
     | :mv4
     | :qpel
     | :loop
     | :gray
     | :psnr
     | :ildct
     | :low_delay
     | :global_header
     | :bitexact
     | :aic
     | :ilme
     | :cgop
     | :output_corrupt
     | :drop_changed}
  | {:flags2,
     integer()
     | String.t()
     | [
         String.t()
         | :fast
         | :noout
         | :ignorecrop
         | :local_header
         | :chunks
         | :showall
         | :export_mvs
         | :skip_manual
         | :ass_ro_flush_noop
         | :icc_profiles
       ]
     | :fast
     | :noout
     | :ignorecrop
     | :local_header
     | :chunks
     | :showall
     | :export_mvs
     | :skip_manual
     | :ass_ro_flush_noop
     | :icc_profiles}
  | {:lowres, integer() | String.t()}
  | {:skip_frame,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:skip_idct,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:skip_loop_filter,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:strict,
     integer()
     | String.t()
     | :very
     | :strict
     | :normal
     | :unofficial
     | :experimental}
  | {:"strict-displaywin", boolean() | :auto | String.t()}
  | {:thread_type,
     integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame}
  | {:threads, integer() | String.t() | :auto}
  | {:view_ids, String.t()}
  | {:raw, [FFix.Command.av_option()]}

mpeg4_option()

@type mpeg4_option() ::
  {:err_detect,
   integer()
   | String.t()
   | [
       String.t()
       | :crccheck
       | :bitstream
       | :buffer
       | :explode
       | :ignore_err
       | :careful
       | :compliant
       | :aggressive
     ]
   | :crccheck
   | :bitstream
   | :buffer
   | :explode
   | :ignore_err
   | :careful
   | :compliant
   | :aggressive}
  | {:flags,
     integer()
     | String.t()
     | [
         String.t()
         | :unaligned
         | :mv4
         | :qpel
         | :loop
         | :gray
         | :psnr
         | :ildct
         | :low_delay
         | :global_header
         | :bitexact
         | :aic
         | :ilme
         | :cgop
         | :output_corrupt
         | :drop_changed
       ]
     | :unaligned
     | :mv4
     | :qpel
     | :loop
     | :gray
     | :psnr
     | :ildct
     | :low_delay
     | :global_header
     | :bitexact
     | :aic
     | :ilme
     | :cgop
     | :output_corrupt
     | :drop_changed}
  | {:flags2,
     integer()
     | String.t()
     | [
         String.t()
         | :fast
         | :noout
         | :ignorecrop
         | :local_header
         | :chunks
         | :showall
         | :export_mvs
         | :skip_manual
         | :ass_ro_flush_noop
         | :icc_profiles
       ]
     | :fast
     | :noout
     | :ignorecrop
     | :local_header
     | :chunks
     | :showall
     | :export_mvs
     | :skip_manual
     | :ass_ro_flush_noop
     | :icc_profiles}
  | {:lowres, integer() | String.t()}
  | {:skip_frame,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:skip_idct,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:skip_loop_filter,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:strict,
     integer()
     | String.t()
     | :very
     | :strict
     | :normal
     | :unofficial
     | :experimental}
  | {:thread_type,
     integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame}
  | {:threads, integer() | String.t() | :auto}
  | {:raw, [FFix.Command.av_option()]}

pcm_s16le_option()

@type pcm_s16le_option() ::
  {:err_detect,
   integer()
   | String.t()
   | [
       String.t()
       | :crccheck
       | :bitstream
       | :buffer
       | :explode
       | :ignore_err
       | :careful
       | :compliant
       | :aggressive
     ]
   | :crccheck
   | :bitstream
   | :buffer
   | :explode
   | :ignore_err
   | :careful
   | :compliant
   | :aggressive}
  | {:flags,
     integer()
     | String.t()
     | [
         String.t()
         | :unaligned
         | :mv4
         | :qpel
         | :loop
         | :gray
         | :psnr
         | :ildct
         | :low_delay
         | :global_header
         | :bitexact
         | :aic
         | :ilme
         | :cgop
         | :output_corrupt
         | :drop_changed
       ]
     | :unaligned
     | :mv4
     | :qpel
     | :loop
     | :gray
     | :psnr
     | :ildct
     | :low_delay
     | :global_header
     | :bitexact
     | :aic
     | :ilme
     | :cgop
     | :output_corrupt
     | :drop_changed}
  | {:flags2,
     integer()
     | String.t()
     | [
         String.t()
         | :fast
         | :noout
         | :ignorecrop
         | :local_header
         | :chunks
         | :showall
         | :export_mvs
         | :skip_manual
         | :ass_ro_flush_noop
         | :icc_profiles
       ]
     | :fast
     | :noout
     | :ignorecrop
     | :local_header
     | :chunks
     | :showall
     | :export_mvs
     | :skip_manual
     | :ass_ro_flush_noop
     | :icc_profiles}
  | {:lowres, integer() | String.t()}
  | {:strict,
     integer()
     | String.t()
     | :very
     | :strict
     | :normal
     | :unofficial
     | :experimental}
  | {:thread_type,
     integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame}
  | {:threads, integer() | String.t() | :auto}
  | {:raw, [FFix.Command.av_option()]}

rawvideo_option()

@type rawvideo_option() ::
  {:err_detect,
   integer()
   | String.t()
   | [
       String.t()
       | :crccheck
       | :bitstream
       | :buffer
       | :explode
       | :ignore_err
       | :careful
       | :compliant
       | :aggressive
     ]
   | :crccheck
   | :bitstream
   | :buffer
   | :explode
   | :ignore_err
   | :careful
   | :compliant
   | :aggressive}
  | {:flags,
     integer()
     | String.t()
     | [
         String.t()
         | :unaligned
         | :mv4
         | :qpel
         | :loop
         | :gray
         | :psnr
         | :ildct
         | :low_delay
         | :global_header
         | :bitexact
         | :aic
         | :ilme
         | :cgop
         | :output_corrupt
         | :drop_changed
       ]
     | :unaligned
     | :mv4
     | :qpel
     | :loop
     | :gray
     | :psnr
     | :ildct
     | :low_delay
     | :global_header
     | :bitexact
     | :aic
     | :ilme
     | :cgop
     | :output_corrupt
     | :drop_changed}
  | {:flags2,
     integer()
     | String.t()
     | [
         String.t()
         | :fast
         | :noout
         | :ignorecrop
         | :local_header
         | :chunks
         | :showall
         | :export_mvs
         | :skip_manual
         | :ass_ro_flush_noop
         | :icc_profiles
       ]
     | :fast
     | :noout
     | :ignorecrop
     | :local_header
     | :chunks
     | :showall
     | :export_mvs
     | :skip_manual
     | :ass_ro_flush_noop
     | :icc_profiles}
  | {:lowres, integer() | String.t()}
  | {:skip_frame,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:skip_idct,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:skip_loop_filter,
     integer()
     | String.t()
     | :none
     | :default
     | :noref
     | :bidir
     | :nointra
     | :nokey
     | :all}
  | {:strict,
     integer()
     | String.t()
     | :very
     | :strict
     | :normal
     | :unofficial
     | :experimental}
  | {:thread_type,
     integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame}
  | {:threads, integer() | String.t() | :auto}
  | {:top, boolean() | :auto | String.t()}
  | {:raw, [FFix.Command.av_option()]}

t()

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

Functions

aac(input, selector, options \\ [])

AAC (Advanced Audio Coding)

Configures audio decoding on an input. See FFix.Decoder for usage and option conventions.

Example

FFix.Decoder.aac(input, {:audio, 0})

Options

  • dual_mono_mode (int): Select the channel to decode for dual mono (from -1 to 2) (default auto) Values: auto, main, sub, both.
  • channel_order (int): Order in which the channels are to be exported (from 0 to 1) (default default) Values: default, coded.
  • flags (flags): (default 0) Values: unaligned, mv4, qpel, loop, gray, psnr, ildct, low_delay, global_header, bitexact, aic, ilme, cgop, output_corrupt, drop_changed.
  • flags2 (flags): (default 0) Values: fast, noout, ignorecrop, local_header, chunks, showall, export_mvs, skip_manual, ass_ro_flush_noop, icc_profiles.
  • strict (int): how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal) Values: very, strict, normal, unofficial, experimental.
  • err_detect (flags): set error detection flags (default 0) Values: crccheck, bitstream, buffer, explode, ignore_err, careful, compliant, aggressive.
  • threads (int): set the number of threads (from 0 to INT_MAX) (default 1) Values: auto.
  • lowres (int): decode at 1= 1/2, 2=1/4, 3=1/8 resolutions (from 0 to INT_MAX) (default 0)
  • thread_type (flags): select multithreading type (default slice+frame) Values: slice, frame.

Format and codec details

  • General capabilities: dr1 chconf
  • Threading capabilities: none
  • Supported sample formats: fltp
  • Supported channel layouts: mono stereo 3.0 4.0 5.0 5.1 7.1(wide) 6.1(back) 7.1 22.2 5.1.2

ac3(input, selector, options \\ [])

ATSC A/52A (AC-3)

Configures audio decoding on an input. See FFix.Decoder for usage and option conventions.

Options

  • cons_noisegen (boolean): enable consistent noise generation (default false)
  • drc_scale (float): percentage of dynamic range compression to apply (from 0 to 6) (default 1)
  • heavy_compr (boolean): enable heavy dynamic range compression (default false)
  • target_level (int): target level in -dBFS (0 not applied) (from -31 to 0) (default 0)
  • downmix (channel_layout): Request a specific channel layout from the decoder
  • flags (flags): (default 0) Values: unaligned, mv4, qpel, loop, gray, psnr, ildct, low_delay, global_header, bitexact, aic, ilme, cgop, output_corrupt, drop_changed.
  • flags2 (flags): (default 0) Values: fast, noout, ignorecrop, local_header, chunks, showall, export_mvs, skip_manual, ass_ro_flush_noop, icc_profiles.
  • strict (int): how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal) Values: very, strict, normal, unofficial, experimental.
  • err_detect (flags): set error detection flags (default 0) Values: crccheck, bitstream, buffer, explode, ignore_err, careful, compliant, aggressive.
  • threads (int): set the number of threads (from 0 to INT_MAX) (default 1) Values: auto.
  • lowres (int): decode at 1= 1/2, 2=1/4, 3=1/8 resolutions (from 0 to INT_MAX) (default 0)
  • thread_type (flags): select multithreading type (default slice+frame) Values: slice, frame.

Format and codec details

  • General capabilities: dr1 chconf
  • Threading capabilities: none
  • Supported sample formats: fltp

auto(input, selector, options \\ [])

Applies decoding options while FFmpeg chooses the implementation.

FFix.input("interview.mp4") |> FFix.Decoder.auto({:video, 0}, threads: 2)

decode(input, name, selector, options \\ [])

Configures an input track with an FFmpeg codec or decoder name and options.

source = FFix.input("recording.flac")
FFix.Decoder.decode(source, "flac", {:audio, 0})

Returns the updated input. Select streams from this returned value so they use the new settings. Names and options are passed to FFmpeg.

h264(input, selector, options \\ [])

H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

Configures video decoding on an input. See FFix.Decoder for usage and option conventions.

Example

FFix.Decoder.h264(input, {:video, 0}, threads: 2)

Options

  • is_avc (boolean): is avc (default false)
  • nal_length_size (int): nal_length_size (from 0 to 4) (default 0)
  • enable_er (boolean): Enable error resilience on damaged frames (unsafe) (default auto)
  • x264_build (int): Assume this x264 version if no x264 version found in any SEI (from -1 to INT_MAX) (default -1)
  • skip_gray (boolean): Do not return gray gap frames (default false)
  • noref_gray (boolean): Avoid using gray gap frames as references (default true)
  • flags (flags): (default 0) Values: unaligned, mv4, qpel, loop, gray, psnr, ildct, low_delay, global_header, bitexact, aic, ilme, cgop, output_corrupt, drop_changed.
  • flags2 (flags): (default 0) Values: fast, noout, ignorecrop, local_header, chunks, showall, export_mvs, skip_manual, ass_ro_flush_noop, icc_profiles.
  • strict (int): how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal) Values: very, strict, normal, unofficial, experimental.
  • err_detect (flags): set error detection flags (default 0) Values: crccheck, bitstream, buffer, explode, ignore_err, careful, compliant, aggressive.
  • threads (int): set the number of threads (from 0 to INT_MAX) (default 1) Values: auto.
  • lowres (int): decode at 1= 1/2, 2=1/4, 3=1/8 resolutions (from 0 to INT_MAX) (default 0)
  • skip_loop_filter (int): skip loop filtering process for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • skip_idct (int): skip IDCT/dequantization for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • skip_frame (int): skip decoding for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • thread_type (flags): select multithreading type (default slice+frame) Values: slice, frame.

Format and codec details

  • General capabilities: dr1 delay threads
  • Threading capabilities: frame and slice
  • Supported hardware devices: cuda vaapi vdpau vulkan

hevc(input, selector, options \\ [])

HEVC (High Efficiency Video Coding)

Configures video decoding on an input. See FFix.Decoder for usage and option conventions.

Options

  • apply_defdispwin (boolean): Apply default display window from VUI (default false)
  • strict-displaywin (boolean): stricly apply default display window size (default false)
  • view_ids (int list): Array of view IDs that should be decoded and output; a single -1 to decode all views
  • flags (flags): (default 0) Values: unaligned, mv4, qpel, loop, gray, psnr, ildct, low_delay, global_header, bitexact, aic, ilme, cgop, output_corrupt, drop_changed.
  • flags2 (flags): (default 0) Values: fast, noout, ignorecrop, local_header, chunks, showall, export_mvs, skip_manual, ass_ro_flush_noop, icc_profiles.
  • strict (int): how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal) Values: very, strict, normal, unofficial, experimental.
  • err_detect (flags): set error detection flags (default 0) Values: crccheck, bitstream, buffer, explode, ignore_err, careful, compliant, aggressive.
  • threads (int): set the number of threads (from 0 to INT_MAX) (default 1) Values: auto.
  • lowres (int): decode at 1= 1/2, 2=1/4, 3=1/8 resolutions (from 0 to INT_MAX) (default 0)
  • skip_loop_filter (int): skip loop filtering process for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • skip_idct (int): skip IDCT/dequantization for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • skip_frame (int): skip decoding for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • thread_type (flags): select multithreading type (default slice+frame) Values: slice, frame.

Format and codec details

  • General capabilities: dr1 delay threads
  • Threading capabilities: frame and slice
  • Supported hardware devices: cuda vaapi vdpau vulkan

mpeg4(input, selector, options \\ [])

MPEG-4 part 2

Configures video decoding on an input. See FFix.Decoder for usage and option conventions.

Options

  • flags (flags): (default 0) Values: unaligned, mv4, qpel, loop, gray, psnr, ildct, low_delay, global_header, bitexact, aic, ilme, cgop, output_corrupt, drop_changed.
  • flags2 (flags): (default 0) Values: fast, noout, ignorecrop, local_header, chunks, showall, export_mvs, skip_manual, ass_ro_flush_noop, icc_profiles.
  • strict (int): how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal) Values: very, strict, normal, unofficial, experimental.
  • err_detect (flags): set error detection flags (default 0) Values: crccheck, bitstream, buffer, explode, ignore_err, careful, compliant, aggressive.
  • threads (int): set the number of threads (from 0 to INT_MAX) (default 1) Values: auto.
  • lowres (int): decode at 1= 1/2, 2=1/4, 3=1/8 resolutions (from 0 to INT_MAX) (default 0)
  • skip_loop_filter (int): skip loop filtering process for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • skip_idct (int): skip IDCT/dequantization for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • skip_frame (int): skip decoding for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • thread_type (flags): select multithreading type (default slice+frame) Values: slice, frame.

Format and codec details

  • General capabilities: horizband dr1 delay threads
  • Threading capabilities: frame
  • Supported hardware devices: cuda vaapi vdpau

new(name, options \\ [])

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

Builds a decoder configuration for an input's decoders: map.

decoder = FFix.Decoder.new("h264", threads: 2)
FFix.input("interview.mp4", decoders: %{{:video, 0} => decoder})

A nil name lets FFmpeg choose the decoder while applying the options.

pcm_s16le(input, selector, options \\ [])

PCM signed 16-bit little-endian

Configures audio decoding on an input. See FFix.Decoder for usage and option conventions.

Options

  • flags (flags): (default 0) Values: unaligned, mv4, qpel, loop, gray, psnr, ildct, low_delay, global_header, bitexact, aic, ilme, cgop, output_corrupt, drop_changed.
  • flags2 (flags): (default 0) Values: fast, noout, ignorecrop, local_header, chunks, showall, export_mvs, skip_manual, ass_ro_flush_noop, icc_profiles.
  • strict (int): how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal) Values: very, strict, normal, unofficial, experimental.
  • err_detect (flags): set error detection flags (default 0) Values: crccheck, bitstream, buffer, explode, ignore_err, careful, compliant, aggressive.
  • threads (int): set the number of threads (from 0 to INT_MAX) (default 1) Values: auto.
  • lowres (int): decode at 1= 1/2, 2=1/4, 3=1/8 resolutions (from 0 to INT_MAX) (default 0)
  • thread_type (flags): select multithreading type (default slice+frame) Values: slice, frame.

Format and codec details

  • General capabilities: dr1 paramchange
  • Threading capabilities: none
  • Supported sample formats: s16

rawvideo(input, selector, options \\ [])

raw video

Configures video decoding on an input. See FFix.Decoder for usage and option conventions.

Options

  • top (boolean): top field first (default auto)
  • flags (flags): (default 0) Values: unaligned, mv4, qpel, loop, gray, psnr, ildct, low_delay, global_header, bitexact, aic, ilme, cgop, output_corrupt, drop_changed.
  • flags2 (flags): (default 0) Values: fast, noout, ignorecrop, local_header, chunks, showall, export_mvs, skip_manual, ass_ro_flush_noop, icc_profiles.
  • strict (int): how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal) Values: very, strict, normal, unofficial, experimental.
  • err_detect (flags): set error detection flags (default 0) Values: crccheck, bitstream, buffer, explode, ignore_err, careful, compliant, aggressive.
  • threads (int): set the number of threads (from 0 to INT_MAX) (default 1) Values: auto.
  • lowres (int): decode at 1= 1/2, 2=1/4, 3=1/8 resolutions (from 0 to INT_MAX) (default 0)
  • skip_loop_filter (int): skip loop filtering process for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • skip_idct (int): skip IDCT/dequantization for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • skip_frame (int): skip decoding for the selected frames (from INT_MIN to INT_MAX) (default default) Values: none, default, noref, bidir, nointra, nokey, all.
  • thread_type (flags): select multithreading type (default slice+frame) Values: slice, frame.

Format and codec details

  • General capabilities: paramchange
  • Threading capabilities: none