FFix.Demuxer (ffix v0.2.0)

Copy Markdown View Source

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.

Summary

Functions

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

Libavfilter virtual input device

QuickTime / MOV

QuickTime / MOV

QuickTime / MOV

MP2/3 (MPEG audio layer 2/3)

QuickTime / MOV

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

PCM signed 16-bit little-endian

Matroska / WebM

Types

image2_option()

@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()

@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()

@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()

@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()

@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()

@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()

@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()

@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()

@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()

@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()

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

webm_option()

@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()]}

Functions

demux(source, name, options \\ [])

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(source, options \\ [])

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(source, options \\ [])

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(source, options \\ [])

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(source, options \\ [])

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(source, options \\ [])

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(source, options \\ [])

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(source, options \\ [])

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(source, options \\ [])

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(name, options \\ [])

@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(source, options \\ [])

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(source, options \\ [])

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(source, options \\ [])

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.