๐ NAME
ffmpeg-codecs - FFmpeg codecs
๐ Quick Reference
| Use Case | Command | Description |
| ๐ List all decoders | ffmpeg -decoders | Display all enabled decoders |
| ๐ List all encoders | ffmpeg -encoders | Display all enabled encoders |
| ๐ฌ Use a specific video codec | -c:v libx264 | Select H.264 encoder |
| ๐ต Use a specific audio codec | -c:a aac | Select AAC encoder |
| ๐ Set video bitrate | -b:v 2000k | Target video bitrate in bits/s |
| ๐ Set audio bitrate | -b:a 128k | Target audio bitrate in bits/s |
| โญ Set video quality (VBR) | -q:v 5 | Constant quality encoding (0-10, higher=better) |
| โญ Set CRF quality (x264/x265) | -crf 23 | Constant Rate Factor (0-51, lower=better) |
| ๐ผ๏ธ Set GOP size | -g 48 | Keyframe interval in frames |
| โ๏ธ Set encoder preset | -preset medium | Speed/quality tradeoff (ultrafast to placebo) |
| โ๏ธ Set encoder profile | -profile:v high | Profile restrictions for codec |
| ๐ Set pixel format | -pix_fmt yuv420p | Color space and subsampling |
| ๐ Set frame size | -s 1920x1080 | Output video resolution |
| โฑ๏ธ Set frame rate | -r 30 | Output frames per second |
| ๐๏ธ 2-pass encoding (pass 1) | -flags +pass1 | First pass: analyze video |
| ๐๏ธ 2-pass encoding (pass 2) | -flags +pass2 | Second pass: use analysis data |
| ๐ Disable audio | -an | No audio output |
| ๐ผ๏ธ Disable video | -vn | No video output |
๐ Description
This document describes the codecs (decoders and encoders) provided by the libavcodec library.
โ๏ธ Codec Options
libavcodec provides some generic global options, which can be set on all the encoders and decoders. In addition each codec may support so-called private options, which are specific for a given codec.
Sometimes, a global option may only affect a specific kind of codec, and may be nonsensical or ignored by another, so you need to be aware of the meaning of the specified options. Also some options are meant only for decoding or encoding.
Options may be set by specifying -option value in the FFmpeg tools, or by setting the value explicitly in the AVCodecContext options or using the libavutil/opt.h API for programmatic use.
๐ Bitrate Options
- b integer (encoding,audio,video) โ Set bitrate in bits/s. Default: 200K.
- ab integer (encoding,audio) โ Set audio bitrate (in bits/s). Default: 128K.
- bt integer (encoding,video) โ Set video bitrate tolerance (in bits/s).
- maxrate integer (encoding,audio,video) โ Set max bitrate tolerance (in bits/s). Requires bufsize.
- minrate integer (encoding,audio,video) โ Set min bitrate tolerance (in bits/s). Useful for CBR.
- bufsize integer (encoding,audio,video) โ Set ratecontrol buffer size (in bits).
๐ท๏ธ Flags
flags flags (decoding/encoding,audio,video,subtitles) โ Set generic flags.
- mv4 โ Use four motion vector by macroblock (mpeg4)
- qpel โ Use 1/4 pel motion compensation
- loop โ Use loop filter
- qscale โ Use fixed qscale
- pass1 โ Use internal 2pass ratecontrol in first pass mode
- pass2 โ Use internal 2pass ratecontrol in second pass mode
- gray โ Only decode/encode grayscale
- psnr โ Set error variables during encoding
- truncated โ Input bitstream might be randomly truncated
- drop_changed โ Don't output frames with different parameters
- ildct โ Use interlaced DCT
- low_delay โ Force low delay
- global_header โ Place global headers in extradata instead of every keyframe
- bitexact โ Only write platform-independent data (for regression testing)
- aic โ Apply H263 advanced intra coding / mpeg4 ac prediction
- ilme โ Apply interlaced motion estimation
- cgop โ Use closed gop
- output_corrupt โ Output even potentially corrupted frames
โฑ๏ธ Time / Frame Options
- time_base rational number โ Set codec time base.
- g integer (encoding,video) โ Set GOP size. Default: 12.
- ar integer (decoding/encoding,audio) โ Set audio sampling rate (in Hz).
- ac integer (decoding/encoding,audio) โ Set number of audio channels.
- cutoff integer (encoding,audio) โ Set cutoff bandwidth.
- frame_size integer (encoding,audio) โ Set audio frame size.
- frame_number integer โ Set the frame number.
- delay integer
๐ฏ Quantization Options
- qcomp float (encoding,video) โ Set video quantizer scale compression (VBR). Range: 0.0-1.0.
- qblur float (encoding,video) โ Set video quantizer scale blur (VBR).
- qmin integer (encoding,video) โ Set min video quantizer scale (VBR). Range: -1 to 69. Default: 2.
- qmax integer (encoding,video) โ Set max video quantizer scale (VBR). Range: -1 to 1024. Default: 31.
- qdiff integer (encoding,video) โ Set max difference between quantizer scales.
- bf integer (encoding,video) โ Set max number of B frames between non-B-frames. Range: -1 to 16. Default: 0.
- b_qfactor float (encoding,video) โ Set qp factor between P and B frames.
- b_qoffset float (encoding,video) โ Set QP offset between P and B frames.
- b_strategy integer (encoding,video) โ Set strategy to choose between I/P/B-frames.
- ps integer (encoding,video) โ Set RTP payload size in bytes.
- i_qfactor float (encoding,video) โ Set QP factor between P and I frames.
- i_qoffset float (encoding,video) โ Set QP offset between P and I frames.
๐ Bug Workarounds
bug flags (decoding,video) โ Workaround not auto detected encoder bugs.
- autodetect
- xvid_ilace โ Xvid interlacing bug (autodetected if fourcc==XVIX)
- ump4 (autodetected if fourcc==UMP4)
- no_padding โ padding bug (autodetected)
- amv
- qpel_chroma
- std_qpel โ old standard qpel
- qpel_chroma2
- direct_blocksize โ direct-qpel-blocksize bug
- edge โ edge padding bug
- hpel_chroma
- dc_clip
- ms โ Workaround various bugs in microsoft broken decoders
- trunc โ truncated frames
๐ Strictness
strict integer (decoding/encoding,audio,video) โ Specify how strictly to follow the standards.
- very โ Strictly conform to an older more strict version of the spec
- strict โ Strictly conform to all things in the spec
- normal
- unofficial โ Allow unofficial extensions
- experimental โ Allow non-standardized experimental things (โ ๏ธ security risk)
๐ Error Detection
err_detect flags (decoding,audio,video) โ Set error detection flags.
- crccheck โ Verify embedded CRCs
- bitstream โ Detect bitstream specification deviations
- buffer โ Detect improper bitstream length
- explode โ Abort decoding on minor error detection
- ignore_err โ Ignore decoding errors, continue decoding
- careful โ Consider spec violations not seen in the wild as errors
- compliant โ Consider all spec non-compliancies as errors
- aggressive โ Consider things a sane encoder shouldn't do as errors
๐งฎ Quantization / DCT
- mpeg_quant integer (encoding,video) โ Use MPEG quantizers instead of H.263
- dct integer (encoding,video) โ Set DCT algorithm: auto, fastint, int, mmx, altivec, faan
- idct integer (decoding/encoding,video) โ Select IDCT implementation: auto, int, simple, simplemmx, simpleauto, arm, altivec, sh4, simplearm, simplearmv5te, simplearmv6, simpleneon, xvid, faani
- lumi_mask float (encoding,video) โ Compress bright areas stronger than medium ones
- tcplx_mask float (encoding,video) โ Set temporal complexity masking
- scplx_mask float (encoding,video) โ Set spatial complexity masking
- p_mask float (encoding,video) โ Set inter masking
- dark_mask float (encoding,video) โ Compress dark areas stronger than medium ones
๐ก๏ธ Error Concealment
ec flags (decoding,video) โ Set error concealment strategy.
- guess_mvs โ Iterative motion vector (MV) search (slow)
- deblock โ Use strong deblock filter for damaged MBs
- favor_inter โ Favor predicting from previous frame instead of current
๐ฌ Debug Options
debug flags (decoding/encoding,audio,video,subtitles) โ Print specific debug info.
- pict โ Picture info
- rc โ Rate control
- bitstream
- mb_type โ Macroblock (MB) type
- qp โ Per-block quantization parameter (QP)
- dct_coeff
- green_metadata โ Display complexity metadata
- skip
- startcode
- er โ Error recognition
- mmco โ Memory management control operations (H.264)
- bugs
- buffers โ Picture buffer allocations
- thread_ops โ Threading operations
- nomc โ Skip motion compensation
๐ Comparison Functions
The following options accept comparison function values: cmp, subcmp, mbcmp, ildctcmp, precmp, skipcmp (all integer, encoding,video).
- sad โ Sum of absolute differences, fast (default)
- sse โ Sum of squared errors
- satd โ Sum of absolute Hadamard transformed differences
- dct โ Sum of absolute DCT transformed differences
- psnr โ Sum of squared quantization errors (avoid, low quality)
- bit โ Number of bits needed for the block
- rd โ Rate distortion optimal, slow
- zero โ 0
- vsad โ Sum of absolute vertical differences
- vsse โ Sum of squared vertical differences
- nsse โ Noise preserving sum of squared differences
- w53 โ 5/3 wavelet, only used in snow
- w97 โ 9/7 wavelet, only used in snow
- dctmax
- chroma
๐ Motion Estimation
- dia_size integer (encoding,video) โ Set diamond type & size for motion estimation
- last_pred integer (encoding,video) โ Set amount of motion predictors from previous frame
- preme integer (encoding,video) โ Set pre motion estimation
- pre_dia_size integer (encoding,video) โ Set diamond type & size for motion estimation pre-pass
- subq integer (encoding,video) โ Set sub pel motion estimation quality
- me_range integer (encoding,video) โ Set limit motion vectors range (1023 for DivX player)
๐ฆ Encoder Settings
- global_quality integer (encoding,audio,video)
- coder integer (encoding,video) โ vlc (variable length), ac (arithmetic), raw (no encoding), rle (run-length)
- context integer (encoding,video) โ Set context model
- mbd integer (encoding,video) โ Macroblock decision algorithm: simple, bits, rd
- sc_threshold integer (encoding,video) โ Set scene change threshold
- nr integer (encoding,video) โ Set noise reduction
- rc_init_occupancy integer (encoding,video) โ Set initial buffer occupancy
๐ท๏ธ flags2
flags2 flags (decoding/encoding,audio,video,subtitles)
- fast โ Allow non spec compliant speedup tricks
- noout โ Skip bitstream encoding
- ignorecrop โ Ignore cropping information from sps
- local_header โ Place global headers at every keyframe
- chunks โ Frame data might be split into multiple chunks
- showall โ Show all frames before the first keyframe
- export_mvs โ Export motion vectors into frame side-data
- skip_manual โ Do not skip samples and export skip information
- ass_ro_flush_noop โ Do not reset ASS ReadOrder field on flush
๐ค export_side_data
export_side_data flags (decoding/encoding,audio,video,subtitles)
- mvs โ Export motion vectors into frame side-data
- prft โ Export encoder Producer Reference Time into packet side-data
- venc_params โ Export video encoding parameters through frame side data
- film_grain โ Export film grain parameters through frame side data
๐งต Threading
- threads integer (decoding/encoding,video) โ Set number of threads. auto/0 = automatic. Default: auto.
- thread_type flags (decoding/encoding,video) โ slice (decode parts of a frame), frame (decode multiple frames). Default: slice+frame.
- slices integer (encoding,video) โ Number of slices, used in parallelized encoding
๐จ Color / Video Properties
- profile integer (encoding,audio,video) โ Set encoder codec profile. Default: unknown.
- level integer (encoding,audio,video)
- lowres integer (decoding,audio,video) โ Decode at 1=1/2, 2=1/4, 3=1/8 resolutions
- skip_top integer (decoding,video) โ Skip macroblock rows at top
- skip_bottom integer (decoding,video) โ Skip macroblock rows at bottom
- aspect rational number (encoding,video) โ Set sample aspect ratio
- sar rational number (encoding,video) โ Alias to aspect
- dc integer (encoding,video) โ Set intra_dc_precision
- nssew integer (encoding,video) โ Set nsse weight
- skip_threshold integer (encoding,video) โ Set frame skip threshold
- skip_factor integer (encoding,video) โ Set frame skip factor
- skip_exp integer (encoding,video) โ Set frame skip exponent
- mblmin integer (encoding,video) โ Set min macroblock lagrange factor (VBR)
- mblmax integer (encoding,video) โ Set max macroblock lagrange factor (VBR)
- mepc integer (encoding,video) โ Set motion estimation bitrate penalty compensation (1.0 = 256)
- skip_loop_filter integer (decoding,video)
- skip_idct integer (decoding,video)
- skip_frame integer (decoding,video) โ Skip processing based on frame type
- bidir_refine integer (encoding,video) โ Refine bidirectional macroblock motion vectors
- brd_scale integer (encoding,video) โ Downscale frames for dynamic B-frame decision
- keyint_min integer (encoding,video) โ Set minimum interval between IDR-frames
- refs integer (encoding,video) โ Set reference frames for motion compensation
- chromaoffset integer (encoding,video) โ Set chroma qp offset from luma
- trellis integer (encoding,audio,video) โ Set rate-distortion optimal quantization
- mv0_threshold integer (encoding,video)
- b_sensitivity integer (encoding,video) โ Adjust sensitivity of b_frame_strategy 1
- compression_level integer (encoding,audio,video)
- min_prediction_order integer (encoding,audio)
- max_prediction_order integer (encoding,audio)
- timecode_frame_start integer (encoding,video) โ Set GOP timecode frame start number
- bits_per_raw_sample integer
- channel_layout integer (decoding/encoding,audio)
- request_channel_layout integer (decoding,audio)
- rc_max_vbv_use float (encoding,video)
- rc_min_vbv_use float (encoding,video)
- ticks_per_frame integer (decoding/encoding,audio,video)
๐จ Color Properties
color_primaries integer (decoding/encoding,video)
- bt709 โ BT.709
- bt470m โ BT.470 M
- bt470bg โ BT.470 BG
- smpte170m โ SMPTE 170 M
- smpte240m โ SMPTE 240 M
- film โ Film
- bt2020 โ BT.2020
- smpte428 / smpte428_1 โ SMPTE ST 428-1
- smpte431 โ SMPTE 431-2
- smpte432 โ SMPTE 432-1
- jedec-p22 โ JEDEC P22
color_trc integer (decoding/encoding,video)
- bt709 โ BT.709
- gamma22 โ BT.470 M
- gamma28 โ BT.470 BG
- smpte170m โ SMPTE 170 M
- smpte240m โ SMPTE 240 M
- linear โ Linear
- log / log100 โ Log
- log_sqrt / log316 โ Log square root
- iec61966_2_4 / iec61966-2-4 โ IEC 61966-2-4
- bt1361 / bt1361e โ BT.1361
- iec61966_2_1 / iec61966-2-1 โ IEC 61966-2-1
- bt2020_10 / bt2020_10bit โ BT.2020 - 10 bit
- bt2020_12 / bt2020_12bit โ BT.2020 - 12 bit
- smpte2084 โ SMPTE ST 2084
- smpte428 / smpte428_1 โ SMPTE ST 428-1
- arib-std-b67 โ ARIB STD-B67
colorspace integer (decoding/encoding,video)
- rgb โ RGB
- bt709 โ BT.709
- fcc โ FCC
- bt470bg โ BT.470 BG
- smpte170m โ SMPTE 170 M
- smpte240m โ SMPTE 240 M
- ycocg โ YCOCG
- bt2020nc / bt2020_ncl โ BT.2020 NCL
- bt2020c / bt2020_cl โ BT.2020 CL
- smpte2085 โ SMPTE 2085
- chroma-derived-nc โ Chroma-derived NCL
- chroma-derived-c โ Chroma-derived CL
- ictcp โ ICtCp
color_range integer (decoding/encoding,video)
- tv / mpeg โ MPEG (219*2^(n-8))
- pc / jpeg โ JPEG (2^n-1)
chroma_sample_location integer (decoding/encoding,video)
- left, center, topleft, top, bottomleft, bottom
๐ Audio Service
audio_service_type integer (encoding,audio)
- ma โ Main Audio Service
- ef โ Effects
- vi โ Visually Impaired
- hi โ Hearing Impaired
- di โ Dialogue
- co โ Commentary
- em โ Emergency
- vo โ Voice Over
- ka โ Karaoke
๐ฅ Input Options
- request_sample_fmt sample_fmt (decoding,audio) โ Set preferred sample format. Default: "none".
- pkt_timebase rational number
- sub_charenc encoding (decoding,subtitles) โ Set input subtitles character encoding.
- field_order field_order (video) โ Set/override field order: progressive, tt, bb, tb, bt.
- skip_alpha bool (decoding,video) โ Disable processing alpha (transparency). Default: 0.
- codec_whitelist list (input) โ Comma-separated list of allowed decoders.
- dump_separator string (input) โ Separator for fields printed on command line.
- max_pixels integer (decoding/encoding,video) โ Maximum number of pixels per image.
- apply_cropping bool (decoding,video) โ Enable cropping. Default: 1 (enabled).
๐ Frame Skip Options
skip_loop_filter, skip_idct, skip_frame integer (decoding,video)
- none โ Discard no frame
- default โ Discard useless frames like 0-sized frames
- noref โ Discard all non-reference frames
- bidir โ Discard all bidirectional frames
- nokey โ Discard all frames except keyframes
- nointra โ Discard all frames except I frames
- all โ Discard all frames
Default: default.
๐ Log Level
log_level_offset integer โ Set the log level offset.
๐ฌ Decoders
Decoders are configured elements in FFmpeg which allow the decoding of multimedia streams.
When you configure your FFmpeg build, all the supported native decoders are enabled by default. Decoders requiring an external library must be enabled manually via the corresponding --enable-lib option. You can list all available decoders using the configure option --list-decoders.
You can disable all the decoders with --disable-decoders and selectively enable/disable single decoders with --enable-decoder=DECODER / --disable-decoder=DECODER.
The option -decoders of the ff* tools will display the list of enabled decoders.
๐ผ๏ธ Video Decoders
๐๏ธ av1
AOMedia Video 1 (AV1) decoder.
Options
- operating_point โ Select an operating point of a scalable AV1 bitstream (0-31). Default: 0.
๐๏ธ rawvideo
Raw video decoder.
Options
- top top_field_first โ Specify assumed field type: -1 progressive (default), 0 bottom-field-first, 1 top-field-first.
๐๏ธ libdav1d
dav1d AV1 decoder. Requires --enable-libdav1d.
Options
- framethreads โ Amount of frame threads (0 = autodetect)
- tilethreads โ Amount of tile threads (0 = autodetect)
- filmgrain โ Apply film grain if present in bitstream
- oppoint โ Select operating point (0-31)
- alllayers โ Output all spatial layers (default: false)
๐๏ธ libdavs2
AVS2-P2/IEEE1857.4 video decoder wrapper.
๐๏ธ libuavs3d
AVS3-P2/IEEE1857.10 video decoder. Requires --enable-libuavs3d.
Options
- frame_threads โ Amount of frame threads (0 = autodetect)
๐ Audio Decoders
๐ต ac3
AC-3 audio decoder (ATSC A/52:2010, ETSI TS 102 366, RealAudio 3).
Options
- -drc_scale value โ Dynamic Range Scale Factor. Default: 1. Range: 0 (disabled), 0-1 (partial), >1 (asymmetric compression).
๐ต flac
FLAC audio decoder.
Options
- -use_buggy_lpc โ Decode buggy streams with high lpc values from lavc FLAC encoder
๐ต ffwavesynth
Internal wave synthesizer. Internal use only, format not publicly documented.
๐ต libcelt
libcelt decoder wrapper. Requires --enable-libcelt.
๐ต libgsm
libgsm decoder wrapper. Requires --enable-libgsm. Supports both ordinary GSM and Microsoft variant.
๐ต libilbc
libilbc decoder wrapper. Requires --enable-libilbc.
Options
- enhance โ Enable enhancement of decoded audio (1=enabled, 0=disabled, default: 0)
๐ต libopencore-amrnb
libopencore-amrnb decoder wrapper. Requires --enable-libopencore-amrnb. Native AMR-NB decoder also exists.
๐ต libopencore-amrwb
libopencore-amrwb decoder wrapper. Requires --enable-libopencore-amrwb. Native AMR-WB decoder also exists.
๐ต libopus
libopus decoder wrapper. Requires --enable-libopus. Native Opus decoder also exists.
๐ Subtitles Decoders
๐บ libaribb24
ARIB STD-B24 caption decoder (profiles A and C).
Options
- -aribb24-base-path path โ Base path for config files and image dumping
- -aribb24-skip-ruby-text boolean โ Skip half-height ruby text blocks (enabled by default)
๐บ dvbsub
Options
- compute_clut โ -1 compute if no match, 0 never compute, 1 always compute and override
- dvb_substream โ Select substream, or -1 for all (default)
๐บ dvdsub
Decodes bitmap subtitles used in DVDs, VobSub, and Matroska.
Options
- palette โ Global palette (16 24-bit hex values separated by commas)
- ifo_palette โ IFO file from which to obtain global palette (experimental)
- forced_subs_only โ Only decode forced subtitle entries (0=disabled, 1=enabled, default: 0)
๐บ libzvbi-teletext
DVB teletext decoder. Requires --enable-libzvbi.
Options
- txt_page โ List of teletext page numbers to decode. * = all, subtitle = all subtitle pages. Default: *.
- txt_default_region โ Default character set (0-87). Default: -1 (libzvbi default).
- txt_chop_top โ Discard top teletext line. Default: 1.
- txt_format โ Format: bitmap (default), text, ass
- txt_left โ X offset of bitmaps. Default: 0.
- txt_top โ Y offset of bitmaps. Default: 0.
- txt_chop_spaces โ Chop leading/trailing spaces and remove empty lines. Default: 1.
- txt_duration โ Display duration in ms. Default: -1 (infinite).
- txt_transparent โ Force transparent background. Default: 0.
- txt_opacity โ Opacity (0-255). Default: 0 if transparent, 255 otherwise.
๐ฌ Encoders
Encoders are configured elements in FFmpeg which allow the encoding of multimedia streams.
When you configure your FFmpeg build, all the supported native encoders are enabled by default. Encoders requiring an external library must be enabled manually via the corresponding --enable-lib option. You can list all available encoders using the configure option --list-encoders.
You can disable all the encoders with --disable-encoders and selectively enable/disable single encoders with --enable-encoder=ENCODER / --disable-encoder=ENCODER.
The option -encoders of the ff* tools will display the list of enabled encoders.
๐ Audio Encoders
๐ต aac
Advanced Audio Coding (AAC) encoder. Native FFmpeg implementation.
Options
- b โ Set bit rate in bits/s (CBR mode). Default: 128kbps.
- q โ Set quality for VBR mode (via ffmpeg CLI). For library: use global_quality.
- cutoff โ Set cutoff frequency. If unspecified, dynamically adjusted.
- aac_coder โ Coding method: twoloop (default, TLS), anmr (experimental, lower quality), fast (constant quantizer, better at high bitrates)
- aac_ms โ Mid/side coding: auto (default), enable, disable
- aac_is โ Intensity stereo: enabled by default, disable for debugging
- aac_pns โ Perceptual noise substitution: enabled by default, disable for debugging
- aac_tns โ Temporal noise shaping: enabled by default, disable for debugging
- aac_ltp โ Long term prediction (implied by profile:a aac_low, incompatible with aac_pred)
- aac_pred โ Traditional prediction (implies aac_main profile, incompatible with aac_ltp)
- profile โ aac_low (default, Low-complexity), mpeg2_aac_low, aac_ltp, aac_main
๐ต ac3 and ac3_fixed
AC-3 audio encoders. ac3 uses floating-point, ac3_fixed uses fixed-point integer math.
Metadata Control Options
- -per_frame_metadata boolean โ Allow per-frame metadata changes. Default: 0.
Downmix Levels
- -center_mixlev level โ Center mix level: 0.707 (-3dB), 0.595 (-4.5dB, default), 0.500 (-6dB)
- -surround_mixlev level โ Surround mix level: 0.707 (-3dB), 0.500 (-6dB, default), 0.000 (silence)
Audio Production Information
- -mixing_level number โ Peak SPL (80-111, or -1 for unknown)
- -room_type type โ 0/notindicated (default), 1/large, 2/small
Other Metadata
- -copyright boolean โ Copyright indicator
- -dialnorm value โ Dialogue normalization (-31 to -1, default: -31)
- -dsur_mode mode โ Dolby Surround mode: 0/notindicated (default), 1/off, 2/on
- -original boolean โ Original source indicator
Extended Bitstream Information - Part 1
- -dmix_mode mode โ Preferred stereo downmix: 0/notindicated, 1/ltrt, 2/loro
- -ltrt_cmixlev level โ Lt/Rt center mix level (various gain values, default: 0.595)
- -ltrt_surmixlev level โ Lt/Rt surround mix level (default: 0.500)
- -loro_cmixlev level โ Lo/Ro center mix level (default: 0.595)
- -loro_surmixlev level โ Lo/Ro surround mix level (default: 0.500)
Extended Bitstream Information - Part 2
- -dsurex_mode mode โ Dolby Surround EX mode
- -dheadphone_mode mode โ Dolby Headphone mode
- -ad_conv_type type โ A/D converter type: 0/standard (default), 1/hdcd
Other AC-3 Encoding Options
- -stereo_rematrixing boolean โ Enable/disable rematrixing for stereo input. Default: enabled.
- cutoff frequency โ Set lowpass cutoff frequency. Default: encoder-selected.
Floating-Point-Only Options
- -channel_coupling boolean โ Enable/disable channel coupling. -1/auto (default), 0/off, 1/on
- -cpl_start_band number โ Coupling start band (1-15, -1/auto = encoder-selected)
๐ต flac
FLAC (Free Lossless Audio Codec) Encoder.
Options
- compression_level โ 0-12. Default: 5.
- frame_size โ Size of frames in samples per channel
- lpc_coeff_precision โ LPC coefficient precision (1-15). Default: 15.
- lpc_type โ First stage LPC algorithm: none, fixed, levinson, cholesky
- lpc_passes โ Passes for Cholesky factorization
- min_partition_order โ Minimum partition order
- max_partition_order โ Maximum partition order
- prediction_order_method โ estimation, 2level, 4level, 8level, search, log
- ch_mode โ Channel mode: auto, indep, left_side, right_side, mid_side
- exact_rice_parameters โ Calculate rice parameters exactly (1=slower, better compression)
- multi_dim_quant โ Multi Dimensional Quantization (1=2nd stage LPC, slow, slightly better compression)
๐ต opus
Native FFmpeg Opus encoder. Currently only implements CELT part. Quality is usually worse or equal to libopus.
Options
- b โ Set bit rate in bits/s. If unspecified, guessed from channels/layout.
- opus_delay โ Maximum delay in milliseconds. Lower than 20ms decreases quality quickly.
๐ต libfdk_aac
libfdk-aac AAC encoder wrapper. Requires --enable-libfdk-aac. Incompatible with GPL.
Options
- b โ Set bit rate in bits/s. Automatically set if not specified. Ignored in VBR mode.
- ar โ Audio sampling rate (Hz)
- channels โ Number of audio channels
- flags +qscale โ Enable fixed quality, VBR mode
- cutoff โ Cutoff frequency (0 = automatic)
- profile โ aac_low (LC), aac_he (HE-AAC), aac_he_v2 (HE-AACv2), aac_ld (Low Delay), aac_eld (Enhanced Low Delay)
- afterburner โ Improve quality at cost of speed. Default: 1.
- eld_sbr โ Enable SBR for ELD. Default: 0.
- eld_v2 โ Enable ELDv2 (requires fdk-aac > 4.0.0). Default: 0.
- signaling โ SBR/PS signaling style: default, implicit, explicit_sbr, explicit_hierarchical
- latm โ Output LATM/LOAS encapsulated data. Default: 0.
- header_period โ StreamMuxConfig repetition period in LATM (16-bit non-negative). Default: 0.
- vbr โ VBR mode (1-5). 0 = CBR. Only aac_low profile supports VBR.
VBR bit rates (approximate): 1=32, 2=40, 3=48-56, 4=64, 5=80-96 kbps/channel.
Examples
ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
๐ต libmp3lame
LAME MP3 encoder wrapper. Requires --enable-libmp3lame.
Options
- b (-b) โ Bitrate in bits/s for CBR or ABR
- q (-V) โ Constant quality for VBR (via CLI). For library: use global_quality.
- compression_level (-q) โ Algorithm quality (0-9, 0=highest quality/slowest)
- cutoff (--lowpass) โ Lowpass cutoff frequency. If unspecified, dynamically adjusted.
- reservoir โ Enable bit reservoir (1=enabled, default). Use --nores to override.
- joint_stereo (-m j) โ Enable L/R or mid/side stereo per frame. Default: 1.
- abr (--abr) โ Enable ABR mode. Still relies on b for bitrate.
๐ต libopencore-amrnb
OpenCORE Adaptive Multi-Rate Narrowband encoder. Requires --enable-libopencore-amrnb --enable-version3. Mono-only, 8000Hz officially (override with strict unofficial).
Options
- b โ Bitrate: 4750, 5150, 5900, 6700, 7400, 7950, 10200, 12200 bps
- dtx โ Discontinuous transmission (comfort noise). Default: 0.
๐ต libopus
libopus Opus encoder wrapper. Requires --enable-libopus.
Options
- b (bitrate) โ Bit rate in bits/s
- vbr (vbr, hard-cbr, cvbr) โ off=CBR, on=VBR (default), constrained=CVBR
- compression_level (comp) โ Complexity (0-10). Default: 10.
- frame_duration (framesize) โ Frame size in ms: 2.5, 5, 10, 20, 40, 60. Default: 20.
- packet_loss (expect-loss) โ Expected packet loss percentage. Default: 0.
- fec โ Enable inband forward error correction. Requires packet_loss > 0.
- application โ voip (speech), audio (default, fidelity), lowdelay
- cutoff โ Bandwidth: 4000, 6000, 8000, 12000, 20000 Hz. Default: 0 (disabled).
- mapping_family โ Channel mapping family: -1 (auto, default), 0 (mono/stereo), 1 (surround), 255 (independent streams)
- apply_phase_inv (requires libopus >= 1.2) โ Phase inversion for intensity stereo. 0=disable, 1=enable (default).
๐ต libshine
Shine Fixed-Point MP3 encoder wrapper. Requires --enable-libshine. Stereo/mono only, CBR-only.
Options
- b (-b) โ Bitrate in bits/s for CBR
๐ต libtwolame
TwoLAME MP2 encoder wrapper. Requires --enable-libtwolame.
Options
- b (-b) โ Bitrate in bits/s. Default: 128k.
- q (-V) โ VBR quality (-50 to 50, useful -10 to 10). Higher = better.
- mode (--mode) โ auto (default), stereo, joint_stereo, dual_channel, mono
- psymodel (--psyc-mode) โ Psychoacoustic model (-1 to 4). Default: 3.
- energy_levels (--energy) โ Enable energy levels extensions. Default: 0.
- error_protection (--protect) โ Enable CRC error protection. Default: 0.
- copyright (--copyright) โ Copyright flag. Default: 0.
- original (--original) โ Original flag. Default: 0.
๐ต libvo-amrwbenc
VisualOn Adaptive Multi-Rate Wideband encoder. Requires --enable-libvo-amrwbenc --enable-version3. Mono-only, 16000Hz officially (override with strict unofficial).
Options
- b โ Bitrate: 6600, 8850, 12650, 14250, 15850, 18250, 19850, 23050, 23850 bps
- dtx โ Discontinuous transmission. Default: 0.
๐ต libvorbis
libvorbis encoder wrapper. Requires --enable-libvorbis.
Options
- b (-b) โ Bitrate in bits/s for ABR
- q (-q) โ VBR quality (-1.0 to 10.0). Default: 3.0.
- cutoff (--advanced-encode-option lowpass_frequency=N) โ Cutoff bandwidth in Hz. 0=disabled (default).
- minrate (-m) โ Minimum bitrate in bits/s
- maxrate (-M) โ Maximum bitrate in bits/s (ABR only)
- iblock (--advanced-encode-option impulse_noisetune=N) โ Noise floor bias for impulse blocks (-15.0 to 0.0)
๐ต mjpeg
Motion JPEG encoder.
Options
- huffman โ Huffman encoding strategy: default (default tables), optimal (compute optimal tables)
๐ต wavpack
WavPack lossless audio encoder.
Options
- frame_size (--blocksize) โ Range 128-131072. Default: auto-calculated from sample rate and channels.
- compression_level (-f, -h, -hh, -x)
- joint_stereo (-j) โ on=force mid/side, off=force left/right, auto=encoder decides
- optimize_mono โ Enable optimization for mono (non-mono streams only): on, off
๐ผ๏ธ Video Encoders
๐๏ธ GIF
GIF image/animation encoder.
Options
- gifflags โ offsetting (enable picture offsetting, default enabled), transdiff (transparency detection, default enabled)
- gifimage โ Encode one full GIF image per frame (not animated). Default: 0.
- global_palette โ Write palette to global GIF header. Default: 1.
๐๏ธ Hap
Vidvox Hap video encoder.
Options
- format โ hap (default), hap_alpha, hap_q
- chunks โ Number of chunks (1-64). Default: 1.
- compressor โ Second-stage compressor: none, snappy (default)
๐๏ธ jpeg2000
Native JPEG 2000 encoder. Lossy by default (-q:v for quality). Lossless: -pred 1.
Options
- format โ j2k or jp2 (default, allows non-rgb pix_fmts)
- tile_width โ Tile width (1-1073741824). Default: 256.
- tile_height โ Tile height. Default: 256.
- pred โ DWT type: dwt97int (Lossy, default), dwt53 (Lossless)
- sop โ Add SOP marker at start of each packet. Disabled by default.
- eph โ Add EPH marker at end of each packet header. Disabled by default.
- prog โ Progression order: lrcp (default), rlcp, rpcl, pcrl, cprl
- layer_rates โ Compression ratios for layers (string). Example: "100,10,1"
ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k
๐๏ธ librav1e
rav1e AV1 encoder wrapper. Requires --enable-librav1e.
Options
- qmax โ Maximum quantizer (bitrate mode)
- qmin โ Minimum quantizer (bitrate mode)
- qp โ Quantizer value (0-255)
- speed โ Speed preset (0-10)
- tiles โ Number of tiles
- tile-rows โ Number of tile rows
- tile-columns โ Number of tile columns
- rav1e-params โ Set rav1e options as key=value pairs separated by ":"
ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
๐๏ธ libaom-av1
libaom AV1 encoder wrapper. Requires --enable-libaom.
Options
- b โ Bitrate target in bits/s. VBR by default; CBR if maxrate=minrate=b; constrained-quality if crf also set.
- g / keyint_min โ GOP size. If zero, intra-only.
- qmin / qmax โ Quantisation range (0-63, divided by 4 for real AV1 quantiser).
- minrate / maxrate / bufsize / rc_init_occupancy โ Rate control buffering.
- threads โ Number of threads (default: hardware threads). May need tiles or row-mt.
- profile โ Encoding profile (default: matches input bit depth/chroma).
- cpu-used โ Quality/speed tradeoff (0-8, higher=faster). Default: 1.
- auto-alt-ref โ Enable alternate reference frames (default: library default).
- arnr-max-frames โ Altref noise reduction max frame count. Default: -1.
- arnr-strength โ Altref noise reduction filter strength (-1 to 6). Default: -1.
- aq-mode โ Adaptive quantization: none (0), variance (1), complexity (2), cyclic (3)
- tune โ Distortion metric: psnr (0, default), ssim (1)
- lag-in-frames โ Lookahead frames (default: library default).
- error-resilience โ default (improves resilience against whole frame loss).
- crf โ Constant quality (0-63, higher=lower quality). Only used if set.
- static-thresh โ Block skip threshold (non-negative integer, default: 0).
- drop-threshold โ Frame drop threshold (% of target buffer, default: 0).
- denoise-noise-level โ Noise level for grain synthesis (0=disabled).
- denoise-block-size โ Block size for denoising (default: 32).
- undershoot-pct โ Datarate undershoot min % (-1 to 100). Default: -1.
- overshoot-pct โ Datarate overshoot max % (-1 to 1000). Default: -1.
- minsection-pct โ GOP bitrate min variation % (-1 to 100). Default: -1.
- maxsection-pct โ GOP bitrate max variation % (-1 to 5000). Default: -1.
- frame-parallel โ Enable frame parallel decodability. Default: true.
- tiles โ Tiles as columns x rows. Default: minimum required (1x1 up to 4K).
- tile-columns / tile-rows โ Tiles as log2 of count (compatibility with libvpx/VP9).
- row-mt (requires libaom >= 1.0.0-759-g90a15f4f2) โ Enable row based multi-threading. Disabled by default.
- enable-cdef โ Enable Constrained Directional Enhancement Filter. Default: true.
- enable-restoration โ Enable Loop Restoration Filter. Default: true.
- enable-global-motion โ Enable global motion for block prediction. Default: true.
- enable-intrabc โ Enable block copy mode for intra prediction. Default: true.
- enable-rect-partitions (requires libaom >= v2.0.0) โ Enable rectangular partitions. Default: true.
- enable-1to4-partitions (requires libaom >= v2.0.0) โ Enable 1:4/4:1 partitions. Default: true.
- enable-ab-partitions (requires libaom >= v2.0.0) โ Enable AB shape partitions. Default: true.
- enable-angle-delta (requires libaom >= v2.0.0) โ Enable angle delta intra prediction. Default: true.
- enable-cfl-intra (requires libaom >= v2.0.0) โ Enable chroma from luma intra prediction. Default: true.
- enable-filter-intra (requires libaom >= v2.0.0) โ Enable filter intra predictor. Default: true.
- enable-intra-edge-filter (requires libaom >= v2.0.0) โ Enable intra edge filter. Default: true.
- enable-smooth-intra (requires libaom >= v2.0.0) โ Enable smooth intra prediction mode. Default: true.
- enable-paeth-intra (requires libaom >= v2.0.0) โ Enable paeth predictor. Default: true.
- enable-palette (requires libaom >= v2.0.0) โ Enable palette prediction mode. Default: true.
- enable-flip-idtx (requires libaom >= v2.0.0) โ Enable extended transform types. Default: true.
- enable-tx64 (requires libaom >= v2.0.0) โ Enable 64-pt transform. Default: true.
- reduced-tx-type-set (requires libaom >= v2.0.0) โ Use reduced set of transform types. Default: false.
- use-intra-dct-only (requires libaom >= v2.0.0) โ Use DCT only for INTRA modes. Default: false.
- use-inter-dct-only (requires libaom >= v2.0.0) โ Use DCT only for INTER modes. Default: false.
- use-intra-default-tx-only (requires libaom >= v2.0.0) โ Use Default-transform only for INTRA modes. Default: false.
- enable-ref-frame-mvs (requires libaom >= v2.0.0) โ Enable temporal mv prediction. Default: true.
- enable-reduced-reference-set (requires libaom >= v2.0.0) โ Use reduced set of references. Default: false.
- enable-obmc (requires libaom >= v2.0.0) โ Enable OBMC. Default: true.
- enable-dual-filter (requires libaom >= v2.0.0) โ Enable dual filter. Default: true.
- enable-diff-wtd-comp (requires libaom >= v2.0.0) โ Enable difference-weighted compound. Default: true.
- enable-dist-wtd-comp (requires libaom >= v2.0.0) โ Enable distance-weighted compound. Default: true.
- enable-onesided-comp (requires libaom >= v2.0.0) โ Enable one sided compound. Default: true.
- enable-interinter-wedge (requires libaom >= v2.0.0) โ Enable interinter wedge compound. Default: true.
- enable-interintra-wedge (requires libaom >= v2.0.0) โ Enable interintra wedge compound. Default: true.
- enable-masked-comp (requires libaom >= v2.0.0) โ Enable masked compound. Default: true.
- enable-interintra-comp (requires libaom >= v2.0.0) โ Enable interintra compound. Default: true.
- enable-smooth-interintra (requires libaom >= v2.0.0) โ Enable smooth interintra mode. Default: true.
- aom-params โ Set libaom options as key=value pairs separated by ":"
ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
๐๏ธ libsvtav1
SVT-AV1 encoder wrapper. Requires --enable-libsvtav1.
Options
- profile โ Encoding profile
- level โ Operating point level
- tier โ Operating point tier
- rc โ Rate control: cqp (constant quantizer, default), vbr (variable bitrate), cvbr (constrained VBR per GOP)
- qmax โ Maximum quantizer (bitrate mode)
- qmin โ Minimum quantizer (bitrate mode)
- qp โ Quantizer for cqp mode (0-63)
- sc_detection โ Enable scene change detection
- la_depth โ Lookahead frames (0-120)
- preset โ Quality-speed tradeoff (0-8, higher=faster). Default: 8.
- tile_rows โ Log2 of tile rows (0-6)
- tile_columns โ Log2 of tile columns (0-4)
๐๏ธ libkvazaar
Kvazaar H.265/HEVC encoder. Requires --enable-libkvazaar.
Options
- b โ Target video bitrate in bits/s (enables rate control)
- kvazaar-params โ Set kvazaar parameters as name=value pairs separated by commas
๐๏ธ libopenh264
Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper. Requires --enable-libopenh264.
Options
- b โ Bitrate (bits per second)
- g โ GOP size
- maxrate โ Max bitrate
- flags +global_header โ Set global header in bitstream
- slices โ Number of slices (parallelized encoding). Default: 0. Used with slice_mode fixed.
- slice_mode โ fixed, rowmb, auto (default), dyn
- loopfilter โ Enable loop filter (1=auto, 0=disable)
- profile โ Set to main to enable CABAC
- max_nal_size โ Maximum NAL size in bytes
- allow_skip_frames โ Allow skipping frames to hit target bitrate
๐๏ธ libtheora
libtheora Theora encoder wrapper. Requires --enable-libtheora.
Options
- b โ Video bitrate for CBR (ignored in VBR mode)
- flags โ Enable qscale for VBR, pass1/pass2 for 2-pass
- g โ GOP size
- global_quality โ Global quality in lambda units (converted to QP, range 0-63)
- q โ VBR quality (0-10, CLI only). For library: use global_quality.
Examples
ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
๐๏ธ libvpx
VP8/VP9 encoder wrapper. Requires --enable-libvpx.
Options
- b (target-bitrate) โ Bitrate in bits/s
- g (kf-max-dist) โ GOP size
- keyint_min (kf-min-dist) โ Minimum GOP size
- qmin (min-q) / qmax (max-q) โ Quantizer range
- bufsize (buf-sz) โ Ratecontrol buffer size (bits)
- rc_init_occupancy (buf-initial-sz) โ Initial buffer occupancy
- undershoot-pct / overshoot-pct โ Datarate undershoot/overshoot percentage
- skip_threshold (drop-frame)
- qcomp (bias-pct)
- maxrate (maxsection-pct) / minrate (minsection-pct) โ GOP max/min bitrate
- minrate=maxrate=b โ CBR mode
- crf (end-usage=cq) โ Constant quality mode
- tune โ psnr or ssim
- quality / deadline (deadline) โ best (avoid), good (default), realtime
- speed / cpu-used (cpu-used) โ Quality/speed ratio
- nr (noise-sensitivity) โ Noise reduction
- static-thresh โ Block skip threshold
- slices (token-parts) โ Number of partitions (FFmpeg: total, vpxenc: log2)
- max-intra-rate โ Max I-frame bitrate as % of target
- auto-alt-ref โ Enable alternate reference frames (2-pass only). Values > 1 enable multi-layer (VP9 only).
- arnr-maxframes / arnr-type / arnr-strength โ Altref noise reduction
- rc-lookahead / lag-in-frames โ Lookahead frames for frametype and ratecontrol
- error-resilient โ Enable error resiliency
- sharpness โ Sharpness (0-7, tradeoff with PSNR)
- ts-parameters โ Temporal scalability configuration (key=value pairs separated by ":")
VP9-specific Options
- lossless โ Enable lossless mode
- tile-columns โ Log2 of tile columns
- tile-rows โ Log2 of tile rows
- frame-parallel โ Enable frame parallel decodability
- aq-mode โ Adaptive quantization: 0=off, 1=variance, 2=complexity, 3=cyclic refresh, 4=equator360
- colorspace โ rgb, bt709, unspecified, bt470bg, smpte170m, smpte240m, bt2020_ncl
- row-mt โ Enable row based multi-threading
- tune-content โ default (0), screen (1), film (2)
- corpus-complexity โ Corpus VBR mode (0-10000, 0=standard VBR)
- enable-tpl โ Enable temporal dependency model
- ref-frame-config โ Per-frame metadata for fine control of referencing schemes
๐๏ธ libwebp
libwebp WebP Image encoder wrapper. Supports YUV420 (lossy) and RGB (lossless).
Options
- -lossless โ Enable lossless mode. Default: 0.
- -compression_level โ Quality/speed or size/speed tradeoff (0-6). Default: 4.
- -qscale โ For lossy: image quality (0-100). For lossless: compression effort. Default: 75.
- -preset โ none, default, picture, photo, drawing, icon, text
๐๏ธ libx264, libx264rgb
x264 H.264/MPEG-4 AVC encoder wrapper. Requires --enable-libx264. libx264rgb accepts packed RGB input.
Options
- b (bitrate) โ Bitrate in bits/s
- bf (bframes) โ Max B-frames
- g (keyint) โ GOP size
- qmin (qpmin) / qmax (qpmax) โ Quantizer range
- qdiff (qpstep) โ Max quantizer difference
- qblur (qblur) โ Quantizer curve blur
- qcomp (qcomp) โ Quantizer curve compression factor
- refs (ref) โ Reference frames per P-frame (0-16)
- sc_threshold (scenecut) โ Scene change detection threshold
- trellis (trellis) โ Trellis quantization. Enabled by default.
- nr (nr) โ Noise reduction
- me_range (merange) โ Motion search range in pixels
- me_method (me) โ dia/epzs (fastest), hex, umh, esa, tesa (slowest)
- forced-idr โ Force IDR-frame type for I-frames
- subq (subme) โ Sub-pixel motion estimation method
- b_strategy (b-adapt) โ Adaptive B-frame placement (first-pass only)
- keyint_min (min-keyint) โ Minimum GOP size
- coder โ ac (CABAC), vlc (CAVLC, no CABAC)
- cmp โ chroma (enable chroma in ME), sad (ignore chroma, --no-chroma-me)
- threads (threads) โ Number of encoding threads
- thread_type โ slice (sliced-threads), frame (frame-based)
- flags โ Use -cgop for open GOP
- rc_init_occupancy (vbv-init)
- preset (preset) โ Encoding preset
- tune (tune) โ Tuning of encoding params
- profile (profile) โ Profile restrictions
- fastfirstpass โ Enable fast settings on first pass. 0 = --slow-firstpass.
- crf (crf) โ Constant quality mode
- crf_max (crf-max) โ Prevent VBV from lowering quality beyond this point
- qp (qp) โ Constant quantization rate control
- aq-mode (aq-mode) โ none (0), variance (1), autovariance (2, experimental)
- aq-strength (aq-strength) โ AQ strength
- psy โ Psychovisual optimizations (1=enable, 0=disable)
- psy-rd (psy-rd) โ Strength in psy-rd:psy-trellis format
- rc-lookahead (rc-lookahead) โ Lookahead frames for frametype and ratecontrol
- weightb โ Weighted prediction for B-frames
- weightp (weightp) โ none (0), simple (1), smart (2)
- ssim (ssim) โ Calculate and print SSIM stats
- intra-refresh (intra-refresh) โ Periodic Intra Refresh instead of IDR
- avcintra-class (class) โ AVC-Intra class: 50, 100, 200
- bluray-compat (bluray-compat) โ Blu-ray compatibility (shorthand for --bluray-compat --force-cfr)
- b-bias (b-bias) โ Influence on B-frame usage frequency
- b-pyramid (b-pyramid) โ none, strict, normal
- mixed-refs โ One reference per partition (vs per macroblock)
- 8x8dct โ Adaptive spatial transform (high profile 8x8)
- fast-pskip โ Early SKIP detection on P-frames
- aud (aud) โ Access unit delimiters
- mbtree โ Macroblock tree ratecontrol
- deblock (deblock) โ Loop filter parameters in alpha:beta form
- cplxblur (cplxblur) โ Fluctuations reduction in QP
- partitions (partitions) โ p8x8, p4x4, b8x8, i8x8, i4x4, none, all
- direct-pred (direct) โ none, spatial, temporal, auto
- slice-max-size (slice-max-size) โ Max slice size in bytes
- stats (stats) โ Multi-pass stats file name
- nal-hrd (nal-hrd) โ none, vbr, cbr (not allowed in MP4)
- x264opts โ Any x264 option (key=value pairs separated by ":")
- a53cc โ Import closed captions into output. Default: 1.
- x264-params โ Override x264 configuration (key=value pairs separated by ":")
Examples
ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
๐๏ธ libx265
x265 H.265/HEVC encoder wrapper. Requires --enable-libx265.
Options
- b โ Target video bitrate
- bf โ Max B-frames
- g โ GOP size
- keyint_min โ Minimum GOP size
- refs โ Reference frames per P-frame (1-16)
- preset โ x265 preset
- tune โ x265 tune parameter
- profile โ Profile restrictions
- crf โ Constant quality mode
- qp โ Constant quantization rate control
- qmin / qmax โ Quantizer range
- qdiff โ Max quantizer difference
- qblur โ Quantizer curve blur
- qcomp โ Quantizer curve compression factor
- i_qfactor / b_qfactor โ QP factors
- forced-idr โ Force IDR-frame type for I-frames
- x265-params โ Set x265 options as key=value pairs separated by ":"
ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
๐๏ธ libxavs2
xavs2 AVS2-P2/IEEE1857.4 encoder wrapper. Requires --enable-libxavs2.
Options
- b / bit_rate โ Bitrate
- g / gop_size โ GOP size
- bf / max_b_frames โ Max B-frames
- lcu_row_threads โ Parallel threads for rows (1-8, default: 5)
- initial_qp โ Initial QP for first frame (1-63, default: 34)
- qp โ QP for constant-QP mode (1-63, default: 34)
- max_qp โ Max QP for rate control (1-63, default: 55)
- min_qp โ Min QP for rate control (1-63, default: 20)
- speed_level โ Speed level (0-9, default: 0, higher=better but slower)
- log_level โ Log level: -1=none, 0=error, 1=warning, 2=info, 3=debug
- xavs2-params โ Set xavs2 options as key=value pairs separated by ":"
ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
๐๏ธ libxvid
Xvid MPEG-4 Part 2 encoder wrapper. Requires --enable-libxvid --enable-gpl.
Options
- b, g, qmin, qmax, mpeg_quant, threads, bf, b_qfactor, b_qoffset โ Shared codec options
- flags โ mv4, aic, gray, gmc, qpel, cgop, global_header
- trellis โ Trellis quantization
- me_method โ zero (default), phods/x1/log, epzs, full
- mbd โ simple (default), bits, rd
- lumi_aq โ Lumi masking adaptive quantization. Default: 0.
- variance_aq โ Variance adaptive quantization. Default: 0.
- ssim โ off, avg, frame
- ssim_acc โ SSIM accuracy (0-4, 0=most accurate)
๐๏ธ MediaFoundation
Wrappers to encoders in the MediaFoundation framework (SW and HW). Video encoders accept nv12 or yuv420p.
๐๏ธ mpeg2
MPEG-2 video encoder.
Options
- profile โ 422, high, ss, snr, main, simple
- level โ high, high1440, main, low
- seq_disp_ext โ Write sequence_display_extension: -1/auto (default), 0/never, 1/always
- video_format โ unspecified (default), component, pal, ntsc, secam, mac
- a53cc โ Import closed captions. Default: 1.
๐๏ธ png
PNG image encoder.
Options
- dpi โ Dots per inch (unset by default)
- dpm โ Dots per meter (unset by default)
๐๏ธ ProRes
Apple ProRes encoder (prores-aw and prores-ks).
Options (prores-ks)
- profile โ proxy, lt, standard, hq, 4444, 4444xq
- quant_mat โ Quantization matrix: auto, default, proxy, lt, standard, hq
- bits_per_mb โ Bits per macroblock (200-8000)
- mbs_per_slice โ Macroblocks per slice (1-8). Default: 8.
- vendor โ Override 4-byte vendor ID
- alpha_bits โ Alpha component bits: 0 (disable), 8, 16
๐๏ธ QSV encoders
Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG, VP9).
Rate control modes: CQP (with qscale), LA_ICQ (with look_ahead), ICQ, LA (with look_ahead), VCM (with vcm), CBR (maxrate=avg), VBR (maxrate>avg), AVBR (no maxrate).
Mapped options: g/gop_size โ GopPicSize, bf/max_b_frames+1 โ GopRefDist, slices โ NumSlice, refs โ NumRefFrame, coder vlc โ CAVLC.
๐๏ธ snow
Options
- iterative_dia_size โ Dia size for iterative motion estimation
๐๏ธ VAAPI encoders
Wrappers for hardware encoders via VAAPI. Input must be in VAAPI hardware surfaces (use hwupload filter).
Common options: g/gop_size, bf/max_b_frames, profile, level, b/bit_rate, maxrate/rc_max_rate, bufsize/rc_buffer_size, compression_level, q/global_quality, qmin/qmax, i_qfactor/b_qfactor, slices.
All encoders support:
- low_power โ Use lower power encoder if available
- idr_interval โ Normal intra frames between IDR frames in open-GOP mode
- b_depth โ B-frame reference depth
- rc_mode โ auto, CQP, CBR, VBR, ICQ, QVBR, AVBR
h264_vaapi: coder (ac/cabac, vlc/cavlc), aud, sei (identifier, timing, recovery_point)
hevc_vaapi: aud, tier, sei (hdr), tiles
mjpeg_vaapi: jfif, huffman
mpeg2_vaapi: profile, level
vp8_vaapi: loop_filter_level, loop_filter_sharpness
vp9_vaapi: loop_filter_level, loop_filter_sharpness
๐๏ธ vc2
SMPTE VC-2 (BBC Dirac Pro). Supports yuv420, yuv422, yuv444 at 8/10/12 bits.
Options
- b โ Target video bitrate (around 1:6 of uncompressed). Higher values near uncompressed = lossless.
- field_order โ Enable field coding for interlaced inputs (e.g. tt)
- wavelet_depth โ Wavelet transforms (1-5). Default: 5.
- wavelet_type โ 5_3 (LeGall) or 9_7 (Deslauriers-Dubuc, default)
- slice_width / slice_height โ Slice size. For compatibility: 32x8.
- tolerance โ Undershoot tolerance (%)
- qm โ Quantization matrix preset: default, flat, color
๐ Subtitles Encoders
๐บ dvdsub
Encodes bitmap subtitle format used in DVDs (VOBSUB, Matroska).
Options
- palette โ Global palette (16 24-bit hex values separated by commas)
- even_rows_fix โ Make number of pixel rows even (adds transparent row if needed). Default: 0.
๐ See Also
ffmpeg(1), ffplay(1), ffprobe(1), libavcodec(3)
๐ฅ Authors
The FFmpeg developers.
For details about the authorship, see the Git history of the project (git://source.ffmpeg.org/ffmpeg), e.g. by typing git log in the FFmpeg source directory, or browsing the online repository at http://source.ffmpeg.org.
Maintainers for the specific components are listed in the file MAINTAINERS in the source code tree.