Choose how output streams are compressed.
Apply an encoder to an input stream or to the end of a filter pipeline, then
pass the result to FFix.output/3 or a FFix.Muxer helper.
Video quality
libx264/2 encodes H.264 video. CRF is a quality setting: lower values give
higher quality and usually larger files. Start around 23 and compare a short
sample. The preset trades encoding time for compression efficiency.
alias FFix.{Encoder, Muxer}
command =
FFix.input("interview.mp4")
|> FFix.video(0)
|> Encoder.libx264(crf: 23, preset: "medium")
|> Muxer.mp4("interview-video.mp4")
|> FFix.command()For a bitrate-based delivery target, use b: "2M". Options such as maxrate
and bufsize give finer control over bitrate variation; consult the selected
encoder's reference before combining rate-control settings.
Audio and multiple tracks
source = FFix.input("interview.mp4")
audio = source |> FFix.audio(:all) |> Encoder.aac(b: "128k")
output = FFix.output(audio, "audio.m4a")This applies AAC encoding to each selected audio track. Use explicit indexes
when tracks need different settings. FFix.Command.Mapping explains how
encoding settings follow mapping order, including selections of several tracks.
Apply filters before the encoder. To keep existing encoded media, use
FFix.stream_copy/1. Reusing an encoder configuration in several mappings
requests a separate encode for each output use.
Options
Write option names without a leading dash or a stream suffix:
b: "128k", rather than "-b:a:0". FFix adds the correct output-stream scope.
Strings carry FFmpeg expressions and compound values; supported flag options
also accept lists of names. Output options can use callbacks to refer to named
streams; see FFix.Command.Output.
Named helpers check options against a reference recorded from FFmpeg 7.1.5.
FFmpeg supplies defaults for omitted options. Check FFix.Discovery when an
encoder needs to be available in a particular deployment.
Use encode/3 for other encoders. For a named helper's newer options,
raw: [{name, value}] skips the recorded option lookup while retaining the
usual value and command-option checks.
See the FFmpeg codec reference and H.264 encoding guide for more detail.
Summary
Functions
AAC (Advanced Audio Coding)
Encodes a source using an FFmpeg codec or encoder name and its options.
FFmpeg video codec #1
NVIDIA NVENC H.264 encoder
libopus Opus
libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
libx265 H.265 / HEVC
MPEG-4 part 2
Builds a reusable encoder configuration for FFix.Command.Mapping.new/2.
PCM signed 16-bit little-endian
PNG (Portable Network Graphics) image
Types
@type aac_option() :: {:aac_coder, integer() | String.t() | :anmr | :twoloop | :fast | FFix.Command.option_callback()} | {:aac_is, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:aac_ltp, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:aac_ms, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:aac_pce, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:aac_pns, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:aac_pred, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:aac_tns, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:b, integer() | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:level, integer() | String.t() | :unknown | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:profile, integer() | String.t() | :unknown | :main10 | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type ffv1_option() :: {:b, integer() | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:coder, integer() | String.t() | :rice | :range_def | :range_tab | :ac | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {:context, integer() | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:g, integer() | String.t() | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:level, integer() | String.t() | :unknown | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:profile, integer() | String.t() | :unknown | :main10 | FFix.Command.option_callback()} | {:slicecrc, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type h264_nvenc_option() :: {:"2pass", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:a53cc, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:"aq-strength", integer() | String.t() | FFix.Command.option_callback()} | {:aud, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:b, integer() | String.t() | FFix.Command.option_callback()} | {:b_adapt, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:b_ref_mode, integer() | String.t() | :disabled | :each | :middle | FFix.Command.option_callback()} | {:"bluray-compat", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:cbr, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:coder, integer() | String.t() | :default | :auto | :cabac | :cavlc | :ac | :vlc | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {:"constrained-encoding", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:cq, number() | String.t() | FFix.Command.option_callback()} | {:delay, integer() | String.t() | FFix.Command.option_callback()} | {:dpb_size, integer() | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:extra_sei, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:"forced-idr", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:g, integer() | String.t() | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:gpu, integer() | String.t() | :any | :list | FFix.Command.option_callback()} | {:init_qpB, integer() | String.t() | FFix.Command.option_callback()} | {:init_qpI, integer() | String.t() | FFix.Command.option_callback()} | {:init_qpP, integer() | String.t() | FFix.Command.option_callback()} | {:"intra-refresh", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:ldkfs, integer() | String.t() | FFix.Command.option_callback()} | {:level, integer() | String.t() | :auto | :"1" | :"1.0" | :"1b" | :"1.0b" | :"1.1" | :"1.2" | :"1.3" | :"2" | :"2.0" | :"2.1" | :"2.2" | :"3" | :"3.0" | :"3.1" | :"3.2" | :"4" | :"4.0" | :"4.1" | :"4.2" | :"5" | :"5.0" | :"5.1" | :"5.2" | :"6.0" | :"6.1" | :"6.2" | :unknown | FFix.Command.option_callback()} | {:lookahead_level, integer() | String.t() | :auto | :"0" | :"1" | :"2" | :"3" | FFix.Command.option_callback()} | {:max_slice_size, integer() | String.t() | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:multipass, integer() | String.t() | :disabled | :qres | :fullres | FFix.Command.option_callback()} | {:"no-scenecut", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:nonref_p, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:preset, integer() | String.t() | :default | :slow | :medium | :fast | :hp | :hq | :bd | :ll | :llhq | :llhp | :lossless | :losslesshp | :p1 | :p2 | :p3 | :p4 | :p5 | :p6 | :p7 | FFix.Command.option_callback()} | {:profile, integer() | String.t() | :baseline | :main | :high | :high444p | :unknown | :main10 | FFix.Command.option_callback()} | {:qp, integer() | String.t() | FFix.Command.option_callback()} | {:qp_cb_offset, integer() | String.t() | FFix.Command.option_callback()} | {:qp_cr_offset, integer() | String.t() | FFix.Command.option_callback()} | {:rc, integer() | String.t() | :constqp | :vbr | :cbr | :vbr_minqp | :ll_2pass_quality | :ll_2pass_size | :vbr_2pass | :cbr_ld_hq | :cbr_hq | :vbr_hq | FFix.Command.option_callback()} | {:"rc-lookahead", integer() | String.t() | FFix.Command.option_callback()} | {:rgb_mode, integer() | String.t() | :yuv420 | :yuv444 | :disabled | FFix.Command.option_callback()} | {:"single-slice-intra-refresh", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:"spatial-aq", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:spatial_aq, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:strict_gop, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:surfaces, integer() | String.t() | FFix.Command.option_callback()} | {:"temporal-aq", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:temporal_aq, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:tune, integer() | String.t() | :hq | :ll | :ull | :lossless | FFix.Command.option_callback()} | {:udu_sei, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:weighted_pred, integer() | String.t() | FFix.Command.option_callback()} | {:zerolatency, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type libopus_option() :: {:application, integer() | String.t() | :voip | :audio | :lowdelay | FFix.Command.option_callback()} | {:apply_phase_inv, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:b, integer() | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:fec, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:frame_duration, number() | String.t() | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:level, integer() | String.t() | :unknown | FFix.Command.option_callback()} | {:mapping_family, integer() | String.t() | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:packet_loss, integer() | String.t() | FFix.Command.option_callback()} | {:profile, integer() | String.t() | :unknown | :main10 | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:vbr, integer() | String.t() | :off | :on | :constrained | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type libx264_option() :: {:"8x8dct", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:a53cc, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:"aq-mode", integer() | String.t() | :none | :variance | :autovariance | :"autovariance-biased" | FFix.Command.option_callback()} | {:"aq-strength", number() | String.t() | FFix.Command.option_callback()} | {:aud, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:"avcintra-class", integer() | String.t() | FFix.Command.option_callback()} | {:b, integer() | String.t() | FFix.Command.option_callback()} | {:"b-bias", integer() | String.t() | FFix.Command.option_callback()} | {:"b-pyramid", integer() | String.t() | :none | :strict | :normal | FFix.Command.option_callback()} | {:b_strategy, integer() | String.t() | FFix.Command.option_callback()} | {:"bluray-compat", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:chromaoffset, integer() | String.t() | FFix.Command.option_callback()} | {:coder, integer() | String.t() | :default | :cavlc | :cabac | :vlc | :ac | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {:cplxblur, number() | String.t() | FFix.Command.option_callback()} | {:crf, number() | String.t() | FFix.Command.option_callback()} | {:crf_max, number() | String.t() | FFix.Command.option_callback()} | {:deblock, String.t() | atom() | FFix.Command.option_callback()} | {:"direct-pred", integer() | String.t() | :none | :spatial | :temporal | :auto | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:"fast-pskip", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:fastfirstpass, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:"forced-idr", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:g, integer() | String.t() | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:"intra-refresh", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:level, String.t() | atom() | integer() | :unknown | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:mb_info, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:mbtree, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:me_method, integer() | String.t() | :dia | :hex | :umh | :esa | :tesa | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:"mixed-refs", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:"motion-est", integer() | String.t() | :dia | :hex | :umh | :esa | :tesa | FFix.Command.option_callback()} | {:"nal-hrd", integer() | String.t() | :none | :vbr | :cbr | FFix.Command.option_callback()} | {:noise_reduction, integer() | String.t() | FFix.Command.option_callback()} | {:partitions, String.t() | atom() | FFix.Command.option_callback()} | {:passlogfile, String.t() | atom() | FFix.Command.option_callback()} | {:preset, String.t() | atom() | FFix.Command.option_callback()} | {:profile, String.t() | atom() | integer() | :unknown | :main10 | FFix.Command.option_callback()} | {:psy, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:"psy-rd", String.t() | atom() | FFix.Command.option_callback()} | {:qp, integer() | String.t() | FFix.Command.option_callback()} | {:"rc-lookahead", integer() | String.t() | FFix.Command.option_callback()} | {:sc_threshold, integer() | String.t() | FFix.Command.option_callback()} | {:"slice-max-size", integer() | String.t() | FFix.Command.option_callback()} | {:ssim, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:stats, String.t() | atom() | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:tune, String.t() | atom() | FFix.Command.option_callback()} | {:udu_sei, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:weightb, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:weightp, integer() | String.t() | :none | :simple | :smart | FFix.Command.option_callback()} | {:wpredp, String.t() | atom() | FFix.Command.option_callback()} | {:"x264-params", String.t() | atom() | FFix.Command.option_callback()} | {:x264opts, String.t() | atom() | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type libx265_option() :: {:a53cc, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:b, integer() | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {:crf, number() | String.t() | FFix.Command.option_callback()} | {:dolbyvision, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:"forced-idr", boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:g, integer() | String.t() | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:level, integer() | String.t() | :unknown | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:preset, String.t() | atom() | FFix.Command.option_callback()} | {:profile, String.t() | atom() | integer() | :unknown | :main10 | FFix.Command.option_callback()} | {:qp, integer() | String.t() | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:tune, String.t() | atom() | FFix.Command.option_callback()} | {:udu_sei, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:"x265-params", String.t() | atom() | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type mpeg4_option() :: {:alternate_scan, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {:b, integer() | String.t() | FFix.Command.option_callback()} | {:b_sensitivity, integer() | String.t() | FFix.Command.option_callback()} | {:b_strategy, integer() | String.t() | FFix.Command.option_callback()} | {:border_mask, number() | String.t() | FFix.Command.option_callback()} | {:brd_scale, integer() | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:chroma_elim_threshold, integer() | String.t() | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {:data_partitioning, boolean() | :auto | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:error_rate, integer() | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:g, integer() | String.t() | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:intra_penalty, integer() | String.t() | FFix.Command.option_callback()} | {:level, integer() | String.t() | :unknown | FFix.Command.option_callback()} | {:lmax, integer() | String.t() | FFix.Command.option_callback()} | {:lmin, integer() | String.t() | FFix.Command.option_callback()} | {:luma_elim_threshold, integer() | String.t() | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:mepc, integer() | String.t() | FFix.Command.option_callback()} | {:mepre, integer() | String.t() | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:motion_est, integer() | String.t() | :zero | :epzs | :xone | FFix.Command.option_callback()} | {:mpeg_quant, integer() | String.t() | FFix.Command.option_callback()} | {:mpv_flags, integer() | String.t() | [String.t() | :skip_rd | :strict_gop | :qp_rd | :cbp_rd | :naq | :mv0] | :skip_rd | :strict_gop | :qp_rd | :cbp_rd | :naq | :mv0 | FFix.Command.option_callback()} | {:noise_reduction, integer() | String.t() | FFix.Command.option_callback()} | {:profile, integer() | String.t() | :unknown | :main10 | FFix.Command.option_callback()} | {:ps, integer() | String.t() | FFix.Command.option_callback()} | {:qsquish, number() | String.t() | FFix.Command.option_callback()} | {:quantizer_noise_shaping, integer() | String.t() | FFix.Command.option_callback()} | {:rc_buf_aggressivity, number() | String.t() | FFix.Command.option_callback()} | {:rc_eq, String.t() | atom() | FFix.Command.option_callback()} | {:rc_init_cplx, number() | String.t() | FFix.Command.option_callback()} | {:rc_qmod_amp, number() | String.t() | FFix.Command.option_callback()} | {:rc_qmod_freq, integer() | String.t() | FFix.Command.option_callback()} | {:sc_threshold, integer() | String.t() | FFix.Command.option_callback()} | {:skip_cmp, integer() | String.t() | :sad | :sse | :satd | :dct | :psnr | :bit | :rd | :zero | :vsad | :vsse | :nsse | :dct264 | :dctmax | :chroma | :msad | FFix.Command.option_callback()} | {:skip_exp, integer() | String.t() | FFix.Command.option_callback()} | {:skip_factor, integer() | String.t() | FFix.Command.option_callback()} | {:skip_threshold, integer() | String.t() | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type pcm_s16le_option() :: {:b, integer() | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:level, integer() | String.t() | :unknown | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:profile, integer() | String.t() | :unknown | :main10 | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type png_option() :: {:b, integer() | String.t() | FFix.Command.option_callback()} | {:bufsize, integer() | String.t() | FFix.Command.option_callback()} | {:compression_level, integer() | String.t() | FFix.Command.option_callback()} | {:dpi, integer() | String.t() | FFix.Command.option_callback()} | {:dpm, integer() | String.t() | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {: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 | FFix.Command.option_callback()} | {:g, integer() | String.t() | FFix.Command.option_callback()} | {:global_quality, integer() | String.t() | FFix.Command.option_callback()} | {:level, integer() | String.t() | :unknown | FFix.Command.option_callback()} | {:maxrate, integer() | String.t() | FFix.Command.option_callback()} | {:minrate, integer() | String.t() | FFix.Command.option_callback()} | {:pred, integer() | String.t() | :none | :sub | :up | :avg | :paeth | :mixed | FFix.Command.option_callback()} | {:profile, integer() | String.t() | :unknown | :main10 | FFix.Command.option_callback()} | {:strict, integer() | String.t() | :very | :strict | :normal | :unofficial | :experimental | FFix.Command.option_callback()} | {:thread_type, integer() | String.t() | [String.t() | :slice | :frame] | :slice | :frame | FFix.Command.option_callback()} | {:threads, integer() | String.t() | :auto | FFix.Command.option_callback()} | {:raw, [FFix.Command.output_av_option()]}
@type t() :: %FFix.Encoder{ name: String.t() | nil, options: [FFix.Command.output_av_option()] }
Functions
@spec aac(FFix.Command.source(), [aac_option()]) :: FFix.Command.Mapping.t()
AAC (Advanced Audio Coding)
Encodes the selected streams with aac. See FFix.Encoder for usage and option conventions.
Example
FFix.Encoder.aac(audio, b: "128k")Options
aac_coder(int): Coding algorithm (from 0 to 2) (default twoloop) Values:anmr,twoloop,fast.aac_ms(boolean): Force M/S stereo coding (default auto)aac_is(boolean): Intensity stereo coding (default true)aac_pns(boolean): Perceptual noise substitution (default true)aac_tns(boolean): Temporal noise shaping (default true)aac_ltp(boolean): Long term prediction (default false)aac_pred(boolean): AAC-Main prediction (default false)aac_pce(boolean): Forces the use of PCEs (default false)b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int): (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int): encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: dr1 delay small
- Threading capabilities: none
- Supported sample rates: 96000 88200 64000 48000 44100 32000 24000 22050 16000 12000 11025 8000 7350
- Supported sample formats: fltp
@spec encode(FFix.Command.source(), String.t(), list()) :: FFix.Command.Mapping.t()
Encodes a source using an FFmpeg codec or encoder name and its options.
source = FFix.input("recording.wav")
audio = FFix.Encoder.encode(FFix.audio(source, 0), "flac", compression_level: 8)
FFix.output(audio, "recording.flac")Names and options are passed to FFmpeg. A codec name such as "h264" lets
FFmpeg select an implementation. Use "libx264" or libx264/2 when you need
that implementation and its particular options.
@spec ffv1(FFix.Command.source(), [ffv1_option()]) :: FFix.Command.Mapping.t()
FFmpeg video codec #1
Encodes the selected streams with ffv1. See FFix.Encoder for usage and option conventions.
Example
FFix.Encoder.ffv1(video)Options
slicecrc(boolean): Protect slices with CRCs (default auto)coder(int): Coder type (from -2 to 2) (default rice) Values:rice,range_def,range_tab,ac.context(int): Context model (from 0 to 1) (default 0)b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.g(int): set the group of picture (GOP) size (from INT_MIN to INT_MAX) (default 12)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int): (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int): encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: dr1 delay threads
- Threading capabilities: slice
- Supported pixel formats: yuv420p yuva420p yuva422p yuv444p yuva444p yuv440p yuv422p yuv411p yuv410p bgr0 bgra yuv420p16le yuv422p16le yuv444p16le yuv444p9le yuv422p9le yuv420p9le yuv420p10le yuv422p10le yuv444p10le yuv420p12le yuv422p12le yuv444p12le yuva444p16le yuva422p16le yuva420p16le yuva444p12le yuva422p12le yuva444p10le yuva422p10le yuva420p10le yuva444p9le yuva422p9le yuva420p9le gray16le gray gbrp9le gbrp10le gbrp12le gbrp14le gbrap14le gbrap10le gbrap12le ya8 gray10le gray12le gray14le gbrp16le rgb48le gbrap16le rgba64le gray9le yuv420p14le yuv422p14le yuv444p14le yuv440p10le yuv440p12le
@spec h264_nvenc(FFix.Command.source(), [h264_nvenc_option()]) :: FFix.Command.Mapping.t()
NVIDIA NVENC H.264 encoder
Encodes the selected streams with h264_nvenc. See FFix.Encoder for usage and option conventions.
Options
preset(int): Set the encoding preset (from 0 to 18) (default p4) Values:default,slow,medium,fast,hp,hq,bd,ll,llhq,llhp,lossless,losslesshp,p1,p2,p3,p4,p5,p6,p7.tune(int): Set the encoding tuning info (from 1 to 4) (default hq) Values:hq,ll,ull,lossless.profile(int) — h264_nvenc: Set the encoding profile (from 0 to 3) (default main) Values:baseline,main,high,high444p.level(int) — h264_nvenc: Set the encoding level restriction (from 0 to 62) (default auto) Values:auto,1,1.0,1b,1.0b,1.1,1.2,1.3,2,2.0,2.1,2.2,3,3.0,3.1,3.2,4,4.0,4.1,4.2,5,5.0,5.1,5.2,6.0,6.1,6.2.rc(int): Override the preset rate-control (from -1 to INT_MAX) (default -1) Values:constqp,vbr,cbr,vbr_minqp,ll_2pass_quality,ll_2pass_size,vbr_2pass,cbr_ld_hq,cbr_hq,vbr_hq.rc-lookahead(int): Number of frames to look ahead for rate-control (from 0 to INT_MAX) (default 0)surfaces(int): Number of concurrent surfaces (from 0 to 64) (default 0)cbr(boolean): Use cbr encoding mode (default false)2pass(boolean): Use 2pass encoding mode (default auto)gpu(int): Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on. (from -2 to INT_MAX) (default any) Values:any,list.rgb_mode(int): Configure how nvenc handles packed RGB input. (from 0 to INT_MAX) (default yuv420) Values:yuv420,yuv444,disabled.delay(int): Delay frame output by the given amount of frames (from 0 to INT_MAX) (default INT_MAX)no-scenecut(boolean): When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts (default false)forced-idr(boolean): If forcing keyframes, force them as IDR frames. (default false)b_adapt(boolean): When lookahead is enabled, set this to 0 to disable adaptive B-frame decision (default true)spatial-aq(boolean): set to 1 to enable Spatial AQ (default false)spatial_aq(boolean): set to 1 to enable Spatial AQ (default false)temporal-aq(boolean): set to 1 to enable Temporal AQ (default false)temporal_aq(boolean): set to 1 to enable Temporal AQ (default false)zerolatency(boolean): Set 1 to indicate zero latency operation (no reordering delay) (default false)nonref_p(boolean): Set this to 1 to enable automatic insertion of non-reference P-frames (default false)strict_gop(boolean): Set 1 to minimize GOP-to-GOP rate fluctuations (default false)aq-strength(int): When Spatial AQ is enabled, this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive) (from 1 to 15) (default 8)cq(float): Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control (from 0 to 51) (default 0)aud(boolean): Use access unit delimiters (default false)bluray-compat(boolean): Bluray compatibility workarounds (default false)init_qpP(int): Initial QP value for P frame (from -1 to 51) (default -1)init_qpB(int): Initial QP value for B frame (from -1 to 51) (default -1)init_qpI(int): Initial QP value for I frame (from -1 to 51) (default -1)qp(int): Constant quantization parameter rate control method (from -1 to 51) (default -1)qp_cb_offset(int): Quantization parameter offset for cb channel (from -12 to 12) (default 0)qp_cr_offset(int): Quantization parameter offset for cr channel (from -12 to 12) (default 0)weighted_pred(int): Set 1 to enable weighted prediction (from 0 to 1) (default 0)coder(int): Coder type (from -1 to 2) (default default) Values:default,auto,cabac,cavlc,ac,vlc.b_ref_mode(int): Use B frames as references (from -1 to 2) (default -1) Values:disabled,each,middle.a53cc(boolean): Use A53 Closed Captions (if available) (default true)dpb_size(int): Specifies the DPB size used for encoding (0 means automatic) (from 0 to INT_MAX) (default 0)multipass(int): Set the multipass encoding (from 0 to 2) (default disabled) Values:disabled,qres,fullres.ldkfs(int): Low delay key frame scale; Specifies the Scene Change frame size increase allowed in case of single frame VBV and CBR (from 0 to 255) (default 0)extra_sei(boolean): Pass on extra SEI data (e.g. a53 cc) to be included in the bitstream (default true)udu_sei(boolean): Pass on user data unregistered SEI if available (default false)intra-refresh(boolean): Use Periodic Intra Refresh instead of IDR frames (default false)single-slice-intra-refresh(boolean): Use single slice intra refresh (default false)max_slice_size(int): Maximum encoded slice size in bytes (from 0 to INT_MAX) (default 0)constrained-encoding(boolean): Enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices (default false)lookahead_level(int): Specifies the lookahead level. Higher level may improve quality at the expense of performance. (from -1 to 15) (default -1) Values:auto,0,1,2,3.b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.g(int): set the group of picture (GOP) size (from INT_MIN to INT_MAX) (default 12)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int) — AVCodecContext: (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int) — AVCodecContext: encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: dr1 delay hardware
- Threading capabilities: none
- Supported hardware devices: cuda cuda
- Supported pixel formats: yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 bgra rgb0 rgba x2rgb10le x2bgr10le gbrp gbrp16le cuda
@spec libopus(FFix.Command.source(), [libopus_option()]) :: FFix.Command.Mapping.t()
libopus Opus
Encodes the selected streams with libopus. See FFix.Encoder for usage and option conventions.
Example
FFix.Encoder.libopus(audio, b: "96k")Options
application(int): Intended application type (from 2048 to 2051) (default audio) Values:voip,audio,lowdelay.frame_duration(float): Duration of a frame in milliseconds (from 2.5 to 120) (default 20)packet_loss(int): Expected packet loss percentage (from 0 to 100) (default 0)fec(boolean): Enable inband FEC. Expected packet loss must be non-zero (default false)vbr(int): Variable bit rate mode (from 0 to 2) (default on) Values:off,on,constrained.mapping_family(int): Channel Mapping Family (from -1 to 255) (default -1)apply_phase_inv(boolean): Apply intensity stereo phase inversion (default true)b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int): (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int): encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: dr1 delay small
- Threading capabilities: none
- Supported sample rates: 48000 24000 16000 12000 8000
- Supported sample formats: s16 flt
@spec libx264(FFix.Command.source(), [libx264_option()]) :: FFix.Command.Mapping.t()
libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Encodes the selected streams with libx264. See FFix.Encoder for usage and option conventions.
Example
FFix.Encoder.libx264(video, crf: 23, preset: "medium")Options
preset(string): Set the encoding preset (cf. x264 --fullhelp) (default "medium")tune(string): Tune the encoding params (cf. x264 --fullhelp)profile(string) — libx264: Set profile restrictions (cf. x264 --fullhelp)fastfirstpass(boolean): Use fast settings when encoding first pass (default true)level(string) — libx264: Specify level (as defined by Annex A)passlogfile(string): Filename for 2 pass statswpredp(string): Weighted prediction for P-framesa53cc(boolean): Use A53 Closed Captions (if available) (default true)x264opts(string): x264 optionscrf(float): Select the quality for constant quality mode (from -1 to FLT_MAX) (default -1)crf_max(float): In CRF mode, prevents VBV from lowering quality beyond this point. (from -1 to FLT_MAX) (default -1)qp(int): Constant quantization parameter rate control method (from -1 to INT_MAX) (default -1)aq-mode(int): AQ method (from -1 to INT_MAX) (default -1) Values:none,variance,autovariance,autovariance-biased.aq-strength(float): AQ strength. Reduces blocking and blurring in flat and textured areas. (from -1 to FLT_MAX) (default -1)psy(boolean): Use psychovisual optimizations. (default auto)psy-rd(string): Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.rc-lookahead(int): Number of frames to look ahead for frametype and ratecontrol (from -1 to INT_MAX) (default -1)weightb(boolean): Weighted prediction for B-frames. (default auto)weightp(int): Weighted prediction analysis method. (from -1 to INT_MAX) (default -1) Values:none,simple,smart.ssim(boolean): Calculate and print SSIM stats. (default auto)intra-refresh(boolean): Use Periodic Intra Refresh instead of IDR frames. (default auto)bluray-compat(boolean): Bluray compatibility workarounds. (default auto)b-bias(int): Influences how often B-frames are used (from INT_MIN to INT_MAX) (default INT_MIN)b-pyramid(int): Keep some B-frames as references. (from -1 to INT_MAX) (default -1) Values:none,strict,normal.mixed-refs(boolean): One reference per partition, as opposed to one reference per macroblock (default auto)8x8dct(boolean): High profile 8x8 transform. (default auto)fast-pskip(boolean): (default auto)aud(boolean): Use access unit delimiters. (default auto)mbtree(boolean): Use macroblock tree ratecontrol. (default auto)deblock(string): Loop filter parameters, in <alpha:beta> form.cplxblur(float): Reduce fluctuations in QP (before curve compression) (from -1 to FLT_MAX) (default -1)partitions(string): A comma-separated list of partitions to consider. Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, alldirect-pred(int): Direct MV prediction mode (from -1 to INT_MAX) (default -1) Values:none,spatial,temporal,auto.slice-max-size(int): Limit the size of each slice in bytes (from -1 to INT_MAX) (default -1)stats(string): Filename for 2 pass statsnal-hrd(int): Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4) (from -1 to INT_MAX) (default -1) Values:none,vbr,cbr.avcintra-class(int): AVC-Intra class 50/100/200/300/480 (from -1 to 480) (default -1)me_method(int): Set motion estimation method (from -1 to 4) (default -1) Values:dia,hex,umh,esa,tesa.motion-est(int): Set motion estimation method (from -1 to 4) (default -1) Values:dia,hex,umh,esa,tesa.forced-idr(boolean): If forcing keyframes, force them as IDR frames. (default false)coder(int): Coder type (from -1 to 1) (default default) Values:default,cavlc,cabac,vlc,ac.b_strategy(int): Strategy to choose between I/P/B-frames (from -1 to 2) (default -1)chromaoffset(int): QP difference between chroma and luma (from INT_MIN to INT_MAX) (default 0)sc_threshold(int): Scene change threshold (from INT_MIN to INT_MAX) (default -1)noise_reduction(int): Noise reduction (from INT_MIN to INT_MAX) (default -1)udu_sei(boolean): Use user data unregistered SEI if available (default false)x264-params(dictionary): Override the x264 configuration using a :-separated list of key=value parametersmb_info(boolean): Set mb_info data through AVSideData, only useful when used from the API (default false)b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.g(int): set the group of picture (GOP) size (from INT_MIN to INT_MAX) (default 12)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int) — AVCodecContext: (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int) — AVCodecContext: encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: dr1 delay threads
- Threading capabilities: other
- Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv16 nv21 yuv420p10le yuv422p10le yuv444p10le nv20le gray gray10le
@spec libx265(FFix.Command.source(), [libx265_option()]) :: FFix.Command.Mapping.t()
libx265 H.265 / HEVC
Encodes the selected streams with libx265. See FFix.Encoder for usage and option conventions.
Options
crf(float): set the x265 crf (from -1 to FLT_MAX) (default -1)qp(int): set the x265 qp (from -1 to INT_MAX) (default -1)forced-idr(boolean): if forcing keyframes, force them as IDR frames (default false)preset(string): set the x265 presettune(string): set the x265 tune parameterprofile(string) — libx265: set the x265 profileudu_sei(boolean): Use user data unregistered SEI if available (default false)a53cc(boolean): Use A53 Closed Captions (if available) (default false)x265-params(dictionary): set the x265 configuration using a :-separated list of key=value parametersdolbyvision(boolean): Enable Dolby Vision RPU coding (default auto) Values:auto.b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.g(int): set the group of picture (GOP) size (from INT_MIN to INT_MAX) (default 12)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int) — AVCodecContext: (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int): encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: dr1 delay threads
- Threading capabilities: other
- Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p gbrp yuv420p10le yuv422p10le yuv444p10le gbrp10le yuv420p12le yuv422p12le yuv444p12le gbrp12le gray gray10le gray12le
@spec mpeg4(FFix.Command.source(), [mpeg4_option()]) :: FFix.Command.Mapping.t()
MPEG-4 part 2
Encodes the selected streams with mpeg4. See FFix.Encoder for usage and option conventions.
Options
data_partitioning(boolean): Use data partitioning. (default false)alternate_scan(boolean): Enable alternate scantable. (default false)mpeg_quant(int): Use MPEG quantizers instead of H.263 (from 0 to 1) (default 0)b_strategy(int): Strategy to choose between I/P/B-frames (from 0 to 2) (default 0)b_sensitivity(int): Adjust sensitivity of b_frame_strategy 1 (from 1 to INT_MAX) (default 40)brd_scale(int): Downscale frames for dynamic B-frame decision (from 0 to 3) (default 0)mpv_flags(flags): Flags common for all mpegvideo-based encoders. (default 0) Values:skip_rd,strict_gop,qp_rd,cbp_rd,naq,mv0.luma_elim_threshold(int): single coefficient elimination threshold for luminance (negative values also consider dc coefficient) (from INT_MIN to INT_MAX) (default 0)chroma_elim_threshold(int): single coefficient elimination threshold for chrominance (negative values also consider dc coefficient) (from INT_MIN to INT_MAX) (default 0)quantizer_noise_shaping(int): (from 0 to INT_MAX) (default 0)error_rate(int): Simulate errors in the bitstream to test error concealment. (from 0 to INT_MAX) (default 0)qsquish(float): how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function) (from 0 to 99) (default 0)rc_qmod_amp(float): experimental quantizer modulation (from -FLT_MAX to FLT_MAX) (default 0)rc_qmod_freq(int): experimental quantizer modulation (from INT_MIN to INT_MAX) (default 0)rc_eq(string): Set rate control equation. When computing the expression, besides the standard functions defined in the section 'Expression Evaluation', the following functions are available: bits2qp(bits), qp2bits(qp). Also the following constants are available: iTex pTex tex mv fCode iCount mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex avgTex.rc_init_cplx(float): initial complexity for 1-pass encoding (from -FLT_MAX to FLT_MAX) (default 0)rc_buf_aggressivity(float): currently useless (from -FLT_MAX to FLT_MAX) (default 1)border_mask(float): increase the quantizer for macroblocks close to borders (from -FLT_MAX to FLT_MAX) (default 0)lmin(int): minimum Lagrange factor (VBR) (from 0 to INT_MAX) (default 236)lmax(int): maximum Lagrange factor (VBR) (from 0 to INT_MAX) (default 3658)skip_threshold(int): Frame skip threshold (from INT_MIN to INT_MAX) (default 0)skip_factor(int): Frame skip factor (from INT_MIN to INT_MAX) (default 0)skip_exp(int): Frame skip exponent (from INT_MIN to INT_MAX) (default 0)skip_cmp(int): Frame skip compare function (from INT_MIN to INT_MAX) (default dctmax) Values:sad,sse,satd,dct,psnr,bit,rd,zero,vsad,vsse,nsse,dct264,dctmax,chroma,msad.sc_threshold(int): Scene change threshold (from INT_MIN to INT_MAX) (default 0)noise_reduction(int): Noise reduction (from INT_MIN to INT_MAX) (default 0)ps(int): RTP payload size in bytes (from INT_MIN to INT_MAX) (default 0)motion_est(int): motion estimation algorithm (from 0 to 2) (default epzs) Values:zero,epzs,xone.mepc(int): Motion estimation bitrate penalty compensation (1.0 = 256) (from INT_MIN to INT_MAX) (default 256)mepre(int): pre motion estimation (from INT_MIN to INT_MAX) (default 0)intra_penalty(int): Penalty for intra blocks in block decision (from 0 to 1.07374e+09) (default 0)b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.g(int): set the group of picture (GOP) size (from INT_MIN to INT_MAX) (default 12)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int): (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int): encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: delay threads
- Threading capabilities: slice
- Supported pixel formats: yuv420p
@spec new(String.t() | nil, [FFix.Command.output_av_option()]) :: t()
Builds a reusable encoder configuration for FFix.Command.Mapping.new/2.
encoder = FFix.Encoder.new("libx264", crf: 20)
FFix.Command.Mapping.new(video, encoder)A nil name lets FFmpeg choose the encoder while applying the supplied options.
For a pipeline, prefer a named helper or encode/3.
@spec pcm_s16le(FFix.Command.source(), [pcm_s16le_option()]) :: FFix.Command.Mapping.t()
PCM signed 16-bit little-endian
Encodes the selected streams with pcm_s16le. See FFix.Encoder for usage and option conventions.
Options
b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int): (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int): encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: dr1 variable
- Threading capabilities: none
- Supported sample formats: s16
@spec png(FFix.Command.source(), [png_option()]) :: FFix.Command.Mapping.t()
PNG (Portable Network Graphics) image
Encodes the selected streams with png. See FFix.Encoder for usage and option conventions.
Options
dpi(int): Set image resolution (in dots per inch) (from 0 to 65536) (default 0)dpm(int): Set image resolution (in dots per meter) (from 0 to 65536) (default 0)pred(int): Prediction method (from 0 to 5) (default none) Values:none,sub,up,avg,paeth,mixed.b(int64): set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)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.g(int): set the group of picture (GOP) size (from INT_MIN to INT_MAX) (default 12)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.maxrate(int64): maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0)minrate(int64): minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0)bufsize(int): set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0)global_quality(int): (from INT_MIN to INT_MAX) (default 0)threads(int): set the number of threads (from 0 to INT_MAX) (default 1) Values:auto.profile(int): (from INT_MIN to INT_MAX) (default unknown) Values:unknown,main10.level(int): encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown) Values:unknown.compression_level(int): (from INT_MIN to INT_MAX) (default -1)thread_type(flags): select multithreading type (default slice+frame) Values:slice,frame.
Format and codec details
- General capabilities: dr1 threads
- Threading capabilities: frame
- Supported pixel formats: rgb24 rgba rgb48be rgba64be pal8 gray ya8 gray16be ya16be monob