4 Encoders are configured elements in FFmpeg which allow the encoding of
7 When you configure your FFmpeg build, all the supported native encoders
8 are enabled by default. Encoders requiring an external library must be enabled
9 manually via the corresponding @code{--enable-lib} option. You can list all
10 available encoders using the configure option @code{--list-encoders}.
12 You can disable all the encoders with the configure option
13 @code{--disable-encoders} and selectively enable / disable single encoders
14 with the options @code{--enable-encoder=@var{ENCODER}} /
15 @code{--disable-encoder=@var{ENCODER}}.
17 The option @code{-encoders} of the ff* tools will display the list of
22 @chapter Audio Encoders
23 @c man begin AUDIO ENCODERS
25 A description of some of the currently available audio encoders
31 Advanced Audio Coding (AAC) encoder.
33 This encoder is the default AAC encoder, natively implemented into FFmpeg.
39 Set bit rate in bits/s. Setting this automatically activates constant bit rate
40 (CBR) mode. If this option is unspecified it is set to 128kbps.
43 Set quality for variable bit rate (VBR) mode. This option is valid only using
44 the @command{ffmpeg} command-line tool. For library interface users, use
45 @option{global_quality}.
48 Set cutoff frequency. If unspecified will allow the encoder to dynamically
49 adjust the cutoff to improve clarity on low bitrates.
52 Set AAC encoder coding method. Possible values:
56 Two loop searching (TLS) method. This is the default method.
58 This method first sets quantizers depending on band thresholds and then tries
59 to find an optimal combination by adding or subtracting a specific value from
60 all quantizers and adjusting some individual quantizer a little. Will tune
61 itself based on whether @option{aac_is}, @option{aac_ms} and @option{aac_pns}
65 Average noise to mask ratio (ANMR) trellis-based solution.
67 This is an experimental coder which currently produces a lower quality, is more
68 unstable and is slower than the default twoloop coder but has potential.
69 Currently has no support for the @option{aac_is} or @option{aac_pns} options.
70 Not currently recommended.
73 Constant quantizer method.
75 Uses a cheaper version of twoloop algorithm that doesn't try to do as many
76 clever adjustments. Worse with low bitrates (less than 64kbps), but is better
77 and much faster at higher bitrates.
82 Sets mid/side coding mode. The default value of "auto" will automatically use
83 M/S with bands which will benefit from such coding. Can be forced for all bands
84 using the value "enable", which is mainly useful for debugging or disabled using
88 Sets intensity stereo coding tool usage. By default, it's enabled and will
89 automatically toggle IS for similar pairs of stereo bands if it's beneficial.
90 Can be disabled for debugging by setting the value to "disable".
93 Uses perceptual noise substitution to replace low entropy high frequency bands
94 with imperceptible white noise during the decoding process. By default, it's
95 enabled, but can be disabled for debugging purposes by using "disable".
98 Enables the use of a multitap FIR filter which spans through the high frequency
99 bands to hide quantization noise during the encoding process and is reverted
100 by the decoder. As well as decreasing unpleasant artifacts in the high range
101 this also reduces the entropy in the high bands and allows for more bits to
102 be used by the mid-low bands. By default it's enabled but can be disabled for
103 debugging by setting the option to "disable".
106 Enables the use of the long term prediction extension which increases coding
107 efficiency in very low bandwidth situations such as encoding of voice or
108 solo piano music by extending constant harmonic peaks in bands throughout
109 frames. This option is implied by profile:a aac_low and is incompatible with
110 aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
113 Enables the use of a more traditional style of prediction where the spectral
114 coefficients transmitted are replaced by the difference of the current
115 coefficients minus the previous "predicted" coefficients. In theory and sometimes
116 in practice this can improve quality for low to mid bitrate audio.
117 This option implies the aac_main profile and is incompatible with aac_ltp.
120 Sets the encoding profile, possible values:
124 The default, AAC "Low-complexity" profile. Is the most compatible and produces
128 Equivalent to @code{-profile:a aac_low -aac_pns 0}. PNS was introduced with the
129 MPEG4 specifications.
132 Long term prediction profile, is enabled by and will enable the @option{aac_ltp}
133 option. Introduced in MPEG4.
136 Main-type prediction profile, is enabled by and will enable the @option{aac_pred}
137 option. Introduced in MPEG2.
140 If this option is unspecified it is set to @samp{aac_low}.
143 @section ac3 and ac3_fixed
147 These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
148 the undocumented RealAudio 3 (a.k.a. dnet).
150 The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
151 encoder only uses fixed-point integer math. This does not mean that one is
152 always faster, just that one or the other may be better suited to a
153 particular system. The @var{ac3_fixed} encoder is not the default codec for
154 any of the output formats, so it must be specified explicitly using the option
155 @code{-acodec ac3_fixed} in order to use it.
157 @subsection AC-3 Metadata
159 The AC-3 metadata options are used to set parameters that describe the audio,
160 but in most cases do not affect the audio encoding itself. Some of the options
161 do directly affect or influence the decoding and playback of the resulting
162 bitstream, while others are just for informational purposes. A few of the
163 options will add bits to the output stream that could otherwise be used for
164 audio data, and will thus affect the quality of the output. Those will be
165 indicated accordingly with a note in the option list below.
167 These parameters are described in detail in several publicly-available
170 @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
171 @item @uref{http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf,A/54 - Guide to the Use of the ATSC Digital Television Standard}
172 @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
173 @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
176 @subsubsection Metadata Control Options
180 @item -per_frame_metadata @var{boolean}
181 Allow Per-Frame Metadata. Specifies if the encoder should check for changing
182 metadata for each frame.
185 The metadata values set at initialization will be used for every frame in the
188 Metadata values can be changed before encoding each frame.
193 @subsubsection Downmix Levels
197 @item -center_mixlev @var{level}
198 Center Mix Level. The amount of gain the decoder should apply to the center
199 channel when downmixing to stereo. This field will only be written to the
200 bitstream if a center channel is present. The value is specified as a scale
201 factor. There are 3 valid values:
206 Apply -4.5dB gain (default)
211 @item -surround_mixlev @var{level}
212 Surround Mix Level. The amount of gain the decoder should apply to the surround
213 channel(s) when downmixing to stereo. This field will only be written to the
214 bitstream if one or more surround channels are present. The value is specified
215 as a scale factor. There are 3 valid values:
220 Apply -6dB gain (default)
222 Silence Surround Channel(s)
227 @subsubsection Audio Production Information
228 Audio Production Information is optional information describing the mixing
229 environment. Either none or both of the fields are written to the bitstream.
233 @item -mixing_level @var{number}
234 Mixing Level. Specifies peak sound pressure level (SPL) in the production
235 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
236 unknown or not indicated. The default value is -1, but that value cannot be
237 used if the Audio Production Information is written to the bitstream. Therefore,
238 if the @code{room_type} option is not the default value, the @code{mixing_level}
239 option must not be -1.
241 @item -room_type @var{type}
242 Room Type. Describes the equalization used during the final mixing session at
243 the studio or on the dubbing stage. A large room is a dubbing stage with the
244 industry standard X-curve equalization; a small room has flat equalization.
245 This field will not be written to the bitstream if both the @code{mixing_level}
246 option and the @code{room_type} option have the default values.
250 Not Indicated (default)
261 @subsubsection Other Metadata Options
265 @item -copyright @var{boolean}
266 Copyright Indicator. Specifies whether a copyright exists for this audio.
270 No Copyright Exists (default)
276 @item -dialnorm @var{value}
277 Dialogue Normalization. Indicates how far the average dialogue level of the
278 program is below digital 100% full scale (0 dBFS). This parameter determines a
279 level shift during audio reproduction that sets the average volume of the
280 dialogue to a preset level. The goal is to match volume level between program
281 sources. A value of -31dB will result in no volume level change, relative to
282 the source volume, during audio reproduction. Valid values are whole numbers in
283 the range -31 to -1, with -31 being the default.
285 @item -dsur_mode @var{mode}
286 Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
287 (Pro Logic). This field will only be written to the bitstream if the audio
288 stream is stereo. Using this option does @b{NOT} mean the encoder will actually
289 apply Dolby Surround processing.
293 Not Indicated (default)
296 Not Dolby Surround Encoded
299 Dolby Surround Encoded
302 @item -original @var{boolean}
303 Original Bit Stream Indicator. Specifies whether this audio is from the
304 original source and not a copy.
311 Original Source (default)
316 @subsection Extended Bitstream Information
317 The extended bitstream options are part of the Alternate Bit Stream Syntax as
318 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
319 If any one parameter in a group is specified, all values in that group will be
320 written to the bitstream. Default values are used for those that are written
321 but have not been specified. If the mixing levels are written, the decoder
322 will use these values instead of the ones specified in the @code{center_mixlev}
323 and @code{surround_mixlev} options if it supports the Alternate Bit Stream
326 @subsubsection Extended Bitstream Information - Part 1
330 @item -dmix_mode @var{mode}
331 Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
332 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
336 Not Indicated (default)
339 Lt/Rt Downmix Preferred
342 Lo/Ro Downmix Preferred
345 @item -ltrt_cmixlev @var{level}
346 Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
347 center channel when downmixing to stereo in Lt/Rt mode.
360 Apply -4.5dB gain (default)
364 Silence Center Channel
367 @item -ltrt_surmixlev @var{level}
368 Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
369 surround channel(s) when downmixing to stereo in Lt/Rt mode.
378 Apply -6.0dB gain (default)
380 Silence Surround Channel(s)
383 @item -loro_cmixlev @var{level}
384 Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
385 center channel when downmixing to stereo in Lo/Ro mode.
398 Apply -4.5dB gain (default)
402 Silence Center Channel
405 @item -loro_surmixlev @var{level}
406 Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
407 surround channel(s) when downmixing to stereo in Lo/Ro mode.
416 Apply -6.0dB gain (default)
418 Silence Surround Channel(s)
423 @subsubsection Extended Bitstream Information - Part 2
427 @item -dsurex_mode @var{mode}
428 Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
429 (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
430 apply Dolby Surround EX processing.
434 Not Indicated (default)
437 Dolby Surround EX Off
443 @item -dheadphone_mode @var{mode}
444 Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
445 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
446 option does @b{NOT} mean the encoder will actually apply Dolby Headphone
451 Not Indicated (default)
460 @item -ad_conv_type @var{type}
461 A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
466 Standard A/D Converter (default)
474 @subsection Other AC-3 Encoding Options
478 @item -stereo_rematrixing @var{boolean}
479 Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
480 is an optional AC-3 feature that increases quality by selectively encoding
481 the left/right channels as mid/side. This option is enabled by default, and it
482 is highly recommended that it be left as enabled except for testing purposes.
484 @item cutoff @var{frequency}
485 Set lowpass cutoff frequency. If unspecified, the encoder selects a default
486 determined by various other encoding parameters.
490 @subsection Floating-Point-Only AC-3 Encoding Options
492 These options are only valid for the floating-point encoder and do not exist
493 for the fixed-point encoder due to the corresponding features not being
494 implemented in fixed-point.
498 @item -channel_coupling @var{boolean}
499 Enables/Disables use of channel coupling, which is an optional AC-3 feature
500 that increases quality by combining high frequency information from multiple
501 channels into a single channel. The per-channel high frequency information is
502 sent with less accuracy in both the frequency and time domains. This allows
503 more bits to be used for lower frequencies while preserving enough information
504 to reconstruct the high frequencies. This option is enabled by default for the
505 floating-point encoder and should generally be left as enabled except for
506 testing purposes or to increase encoding speed.
510 Selected by Encoder (default)
513 Disable Channel Coupling
516 Enable Channel Coupling
519 @item -cpl_start_band @var{number}
520 Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
521 value higher than the bandwidth is used, it will be reduced to 1 less than the
522 coupling end band. If @var{auto} is used, the start band will be determined by
523 the encoder based on the bit rate, sample rate, and channel layout. This option
524 has no effect if channel coupling is disabled.
528 Selected by Encoder (default)
536 FLAC (Free Lossless Audio Codec) Encoder
540 The following options are supported by FFmpeg's flac encoder.
543 @item compression_level
544 Sets the compression level, which chooses defaults for many other options
545 if they are not set explicitly. Valid values are from 0 to 12, 5 is the
549 Sets the size of the frames in samples per channel.
551 @item lpc_coeff_precision
552 Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
556 Sets the first stage LPC algorithm
562 fixed LPC coefficients
570 Number of passes to use for Cholesky factorization during LPC analysis
572 @item min_partition_order
573 The minimum partition order
575 @item max_partition_order
576 The maximum partition order
578 @item prediction_order_method
593 The mode is chosen automatically for each frame
595 Channels are independently coded
601 @item exact_rice_parameters
602 Chooses if rice parameters are calculated exactly or approximately.
603 if set to 1 then they are chosen exactly, which slows the code down slightly and
604 improves compression slightly.
606 @item multi_dim_quant
607 Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
608 applied after the first stage to finetune the coefficients. This is quite slow
609 and slightly improves compression.
618 This is a native FFmpeg encoder for the Opus format. Currently its in development and
619 only implements the CELT part of the codec. Its quality is usually worse and at best
620 is equal to the libopus encoder.
626 Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
627 to make a good guess.
630 Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
634 @anchor{libfdk-aac-enc}
637 libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
639 The libfdk-aac library is based on the Fraunhofer FDK AAC code from
642 Requires the presence of the libfdk-aac headers and library during
643 configuration. You need to explicitly configure the build with
644 @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
645 so if you allow the use of GPL, you should configure with
646 @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
648 This encoder has support for the AAC-HE profiles.
650 VBR encoding, enabled through the @option{vbr} or @option{flags
651 +qscale} options, is experimental and only works with some
652 combinations of parameters.
654 Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
657 For more information see the fdk-aac project at
658 @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
662 The following options are mapped on the shared FFmpeg codec options.
666 Set bit rate in bits/s. If the bitrate is not explicitly specified, it
667 is automatically set to a suitable value depending on the selected
670 In case VBR mode is enabled the option is ignored.
673 Set audio sampling rate (in Hz).
676 Set the number of audio channels.
679 Enable fixed quality, VBR (Variable Bit Rate) mode.
680 Note that VBR is implicitly enabled when the @option{vbr} value is
684 Set cutoff frequency. If not specified (or explicitly set to 0) it
685 will use a value automatically computed by the library. Default value
691 The following profiles are recognized:
694 Low Complexity AAC (LC)
697 High Efficiency AAC (HE-AAC)
700 High Efficiency AAC version 2 (HE-AACv2)
706 Enhanced Low Delay AAC (ELD)
709 If not specified it is set to @samp{aac_low}.
712 The following are private options of the libfdk_aac encoder.
716 Enable afterburner feature if set to 1, disabled if set to 0. This
717 improves the quality but also the required processing power.
722 Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
728 Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
729 disabled if set to 0.
731 Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0).
736 Set SBR/PS signaling style.
738 It can assume one of the following values:
741 choose signaling implicitly (explicit hierarchical by default,
742 implicit if global header is disabled)
745 implicit backwards compatible signaling
748 explicit SBR, implicit PS signaling
750 @item explicit_hierarchical
751 explicit hierarchical signaling
754 Default value is @samp{default}.
757 Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
762 Set StreamMuxConfig and PCE repetition period (in frames) for sending
763 in-band configuration buffers within LATM/LOAS transport layer.
765 Must be a 16-bits non-negative integer.
770 Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
771 good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
772 (Constant Bit Rate) is enabled.
774 Currently only the @samp{aac_low} profile supports VBR encoding.
776 VBR modes 1-5 correspond to roughly the following average bit rates:
788 about 80-96 kbps/channel
794 Set the audio frame length in samples. Default value is the internal
795 default of the library. Refer to the library's documentation for information
796 about supported values.
803 Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
806 ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
810 Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
811 High-Efficiency AAC profile:
813 ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
820 LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
822 Requires the presence of the libmp3lame headers and library during
823 configuration. You need to explicitly configure the build with
824 @code{--enable-libmp3lame}.
826 See @ref{libshine} for a fixed-point MP3 encoder, although with a
831 The following options are supported by the libmp3lame wrapper. The
832 @command{lame}-equivalent of the options are listed in parentheses.
836 Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
837 expressed in kilobits/s.
840 Set constant quality setting for VBR. This option is valid only
841 using the @command{ffmpeg} command-line tool. For library interface
842 users, use @option{global_quality}.
844 @item compression_level (@emph{-q})
845 Set algorithm quality. Valid arguments are integers in the 0-9 range,
846 with 0 meaning highest quality but slowest, and 9 meaning fastest
847 while producing the worst quality.
849 @item cutoff (@emph{--lowpass})
850 Set lowpass cutoff frequency. If unspecified, the encoder dynamically
854 Enable use of bit reservoir when set to 1. Default value is 1. LAME
855 has this enabled by default, but can be overridden by use
856 @option{--nores} option.
858 @item joint_stereo (@emph{-m j})
859 Enable the encoder to use (on a frame by frame basis) either L/R
860 stereo or mid/side stereo. Default value is 1.
862 @item abr (@emph{--abr})
863 Enable the encoder to use ABR when set to 1. The @command{lame}
864 @option{--abr} sets the target bitrate, while this options only
865 tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
867 @item copyright (@emph{-c})
868 Set MPEG audio copyright flag when set to 1. The default value is 0
871 @item original (@emph{-o})
872 Set MPEG audio original flag when set to 1. The default value is 1
876 @section libopencore-amrnb
878 OpenCORE Adaptive Multi-Rate Narrowband encoder.
880 Requires the presence of the libopencore-amrnb headers and library during
881 configuration. You need to explicitly configure the build with
882 @code{--enable-libopencore-amrnb --enable-version3}.
884 This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
885 but you can override it by setting @option{strict} to @samp{unofficial} or
893 Set bitrate in bits per second. Only the following bitrates are supported,
894 otherwise libavcodec will round to the nearest valid bitrate.
908 Allow discontinuous transmission (generate comfort noise) when set to 1. The
909 default value is 0 (disabled).
915 libopus Opus Interactive Audio Codec encoder wrapper.
917 Requires the presence of the libopus headers and library during
918 configuration. You need to explicitly configure the build with
919 @code{--enable-libopus}.
921 @subsection Option Mapping
923 Most libopus options are modelled after the @command{opusenc} utility from
924 opus-tools. The following is an option mapping chart describing options
925 supported by the libopus wrapper, and their @command{opusenc}-equivalent
930 @item b (@emph{bitrate})
931 Set the bit rate in bits/s. FFmpeg's @option{b} option is
932 expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
935 @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
936 Set VBR mode. The FFmpeg @option{vbr} option has the following
937 valid arguments, with the @command{opusenc} equivalent options
941 @item off (@emph{hard-cbr})
942 Use constant bit rate encoding.
944 @item on (@emph{vbr})
945 Use variable bit rate encoding (the default).
947 @item constrained (@emph{cvbr})
948 Use constrained variable bit rate encoding.
951 @item compression_level (@emph{comp})
952 Set encoding algorithm complexity. Valid options are integers in
953 the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
954 gives the highest quality but slowest encoding. The default is 10.
956 @item frame_duration (@emph{framesize})
957 Set maximum frame size, or duration of a frame in milliseconds. The
958 argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
959 frame sizes achieve lower latency but less quality at a given bitrate.
960 Sizes greater than 20ms are only interesting at fairly low bitrates.
963 @item packet_loss (@emph{expect-loss})
964 Set expected packet loss percentage. The default is 0.
966 @item fec (@emph{n/a})
967 Enable inband forward error correction. @option{packet_loss} must be non-zero
968 to take advantage - frequency of FEC 'side-data' is proportional to expected packet loss.
971 @item application (N.A.)
972 Set intended application type. Valid options are listed below:
976 Favor improved speech intelligibility.
978 Favor faithfulness to the input (the default).
980 Restrict to only the lowest delay modes by disabling voice-optimized
985 Set cutoff bandwidth in Hz. The argument must be exactly one of the
986 following: 4000, 6000, 8000, 12000, or 20000, corresponding to
987 narrowband, mediumband, wideband, super wideband, and fullband
988 respectively. The default is 0 (cutoff disabled). Note that libopus
989 forces a wideband cutoff for bitrates < 15 kbps, unless CELT-only
990 (@option{application} set to @samp{lowdelay}) mode is used.
992 @item mapping_family (@emph{mapping_family})
993 Set channel mapping family to be used by the encoder. The default value of -1
994 uses mapping family 0 for mono and stereo inputs, and mapping family 1
995 otherwise. The default also disables the surround masking and LFE bandwidth
996 optimzations in libopus, and requires that the input contains 8 channels or
999 Other values include 0 for mono and stereo, 1 for surround sound with masking
1000 and LFE bandwidth optimizations, and 255 for independent streams with an
1001 unspecified channel layout.
1003 @item apply_phase_inv (N.A.) (requires libopus >= 1.2)
1004 If set to 0, disables the use of phase inversion for intensity stereo,
1005 improving the quality of mono downmixes, but slightly reducing normal stereo
1006 quality. The default is 1 (phase inversion enabled).
1013 Shine Fixed-Point MP3 encoder wrapper.
1015 Shine is a fixed-point MP3 encoder. It has a far better performance on
1016 platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
1017 However, as it is more targeted on performance than quality, it is not on par
1018 with LAME and other production-grade encoders quality-wise. Also, according to
1019 the project's homepage, this encoder may not be free of bugs as the code was
1020 written a long time ago and the project was dead for at least 5 years.
1022 This encoder only supports stereo and mono input. This is also CBR-only.
1024 The original project (last updated in early 2007) is at
1025 @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
1026 updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
1028 Requires the presence of the libshine headers and library during
1029 configuration. You need to explicitly configure the build with
1030 @code{--enable-libshine}.
1032 See also @ref{libmp3lame}.
1036 The following options are supported by the libshine wrapper. The
1037 @command{shineenc}-equivalent of the options are listed in parentheses.
1041 Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
1042 is expressed in kilobits/s.
1048 TwoLAME MP2 encoder wrapper.
1050 Requires the presence of the libtwolame headers and library during
1051 configuration. You need to explicitly configure the build with
1052 @code{--enable-libtwolame}.
1056 The following options are supported by the libtwolame wrapper. The
1057 @command{twolame}-equivalent options follow the FFmpeg ones and are in
1062 Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
1063 option is expressed in kilobits/s. Default value is 128k.
1066 Set quality for experimental VBR support. Maximum value range is
1067 from -50 to 50, useful range is from -10 to 10. The higher the
1068 value, the better the quality. This option is valid only using the
1069 @command{ffmpeg} command-line tool. For library interface users,
1070 use @option{global_quality}.
1072 @item mode (@emph{--mode})
1073 Set the mode of the resulting audio. Possible values:
1077 Choose mode automatically based on the input. This is the default.
1088 @item psymodel (@emph{--psyc-mode})
1089 Set psychoacoustic model to use in encoding. The argument must be
1090 an integer between -1 and 4, inclusive. The higher the value, the
1091 better the quality. The default value is 3.
1093 @item energy_levels (@emph{--energy})
1094 Enable energy levels extensions when set to 1. The default value is
1097 @item error_protection (@emph{--protect})
1098 Enable CRC error protection when set to 1. The default value is 0
1101 @item copyright (@emph{--copyright})
1102 Set MPEG audio copyright flag when set to 1. The default value is 0
1105 @item original (@emph{--original})
1106 Set MPEG audio original flag when set to 1. The default value is 0
1111 @section libvo-amrwbenc
1113 VisualOn Adaptive Multi-Rate Wideband encoder.
1115 Requires the presence of the libvo-amrwbenc headers and library during
1116 configuration. You need to explicitly configure the build with
1117 @code{--enable-libvo-amrwbenc --enable-version3}.
1119 This is a mono-only encoder. Officially it only supports 16000Hz sample
1120 rate, but you can override it by setting @option{strict} to
1121 @samp{unofficial} or lower.
1128 Set bitrate in bits/s. Only the following bitrates are supported, otherwise
1129 libavcodec will round to the nearest valid bitrate.
1144 Allow discontinuous transmission (generate comfort noise) when set to 1. The
1145 default value is 0 (disabled).
1151 libvorbis encoder wrapper.
1153 Requires the presence of the libvorbisenc headers and library during
1154 configuration. You need to explicitly configure the build with
1155 @code{--enable-libvorbis}.
1159 The following options are supported by the libvorbis wrapper. The
1160 @command{oggenc}-equivalent of the options are listed in parentheses.
1162 To get a more accurate and extensive documentation of the libvorbis
1163 options, consult the libvorbisenc's and @command{oggenc}'s documentations.
1164 See @url{http://xiph.org/vorbis/},
1165 @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
1169 Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
1170 expressed in kilobits/s.
1173 Set constant quality setting for VBR. The value should be a float
1174 number in the range of -1.0 to 10.0. The higher the value, the better
1175 the quality. The default value is @samp{3.0}.
1177 This option is valid only using the @command{ffmpeg} command-line tool.
1178 For library interface users, use @option{global_quality}.
1180 @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
1181 Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
1182 related option is expressed in kHz. The default value is @samp{0} (cutoff
1185 @item minrate (@emph{-m})
1186 Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
1187 expressed in kilobits/s.
1189 @item maxrate (@emph{-M})
1190 Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
1191 expressed in kilobits/s. This only has effect on ABR mode.
1193 @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
1194 Set noise floor bias for impulse blocks. The value is a float number from
1195 -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
1196 to the crispness of transients in the encoded audio. The tradeoff for better
1197 transient response is a higher bitrate.
1204 Motion JPEG encoder.
1210 Set the huffman encoding strategy. Possible values:
1214 Use the default huffman tables. This is the default strategy.
1217 Compute and use optimal huffman tables.
1225 WavPack lossless audio encoder.
1229 The equivalent options for @command{wavpack} command line utility are listed in
1232 @subsubsection Shared options
1234 The following shared options are effective for this encoder. Only special notes
1235 about this particular encoder will be documented here. For the general meaning
1236 of the options, see @ref{codec-options,,the Codec Options chapter}.
1239 @item frame_size (@emph{--blocksize})
1240 For this encoder, the range for this option is between 128 and 131072. Default
1241 is automatically decided based on sample rate and number of channel.
1243 For the complete formula of calculating default, see
1244 @file{libavcodec/wavpackenc.c}.
1246 @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
1249 @subsubsection Private options
1252 @item joint_stereo (@emph{-j})
1253 Set whether to enable joint stereo. Valid values are:
1257 Force mid/side audio encoding.
1258 @item off (@emph{0})
1259 Force left/right audio encoding.
1261 Let the encoder decide automatically.
1265 Set whether to enable optimization for mono. This option is only effective for
1266 non-mono streams. Available values:
1277 @c man end AUDIO ENCODERS
1279 @chapter Video Encoders
1280 @c man begin VIDEO ENCODERS
1282 A description of some of the currently available video encoders
1285 @section a64_multi, a64_multi5
1287 A64 / Commodore 64 multicolor charset encoder. @code{a64_multi5} is extended with 5th color (colram).
1291 Cinepak aka CVID encoder.
1292 Compatible with Windows 3.1 and vintage MacOS.
1297 @item g @var{integer}
1299 A keyframe is inserted at least every @code{-g} frames, sometimes sooner.
1301 @item q:v @var{integer}
1302 Quality factor. Lower is better. Higher gives lower bitrate.
1303 The following table lists bitrates when encoding akiyo_cif.y4m for various values of @code{-q:v} with @code{-g 100}:
1306 @item @code{-q:v 1} 1918 kb/s
1307 @item @code{-q:v 2} 1735 kb/s
1308 @item @code{-q:v 4} 1500 kb/s
1309 @item @code{-q:v 10} 1041 kb/s
1310 @item @code{-q:v 20} 826 kb/s
1311 @item @code{-q:v 40} 553 kb/s
1312 @item @code{-q:v 100} 394 kb/s
1313 @item @code{-q:v 200} 312 kb/s
1314 @item @code{-q:v 400} 266 kb/s
1315 @item @code{-q:v 1000} 237 kb/s
1318 @item max_extra_cb_iterations @var{integer}
1319 Max extra codebook recalculation passes, more is better and slower.
1321 @item skip_empty_cb @var{boolean}
1322 Avoid wasting bytes, ignore vintage MacOS decoder.
1324 @item max_strips @var{integer}
1325 @itemx min_strips @var{integer}
1326 The minimum and maximum number of strips to use.
1327 Wider range sometimes improves quality.
1328 More strips is generally better quality but costs more bits.
1329 Fewer strips tend to yield more keyframes.
1330 Vintage compatible is 1..3.
1332 @item strip_number_adaptivity @var{integer}
1333 How much number of strips is allowed to change between frames.
1334 Higher is better but slower.
1340 GIF image/animation encoder.
1345 @item gifflags @var{integer}
1346 Sets the flags used for GIF encoding.
1350 Enables picture offsetting.
1355 Enables transparency detection between frames.
1361 @item gifimage @var{integer}
1362 Enables encoding one full GIF image per frame, rather than an animated GIF.
1364 Default value is @option{0}.
1366 @item global_palette @var{integer}
1367 Writes a palette to the global GIF header where feasible.
1369 If disabled, every frame will always have a palette written, even if there
1370 is a global palette supplied.
1372 Default value is @option{1}.
1378 Vidvox Hap video encoder.
1383 @item format @var{integer}
1384 Specifies the Hap format to encode.
1392 Default value is @option{hap}.
1394 @item chunks @var{integer}
1395 Specifies the number of chunks to split frames into, between 1 and 64. This
1396 permits multithreaded decoding of large frames, potentially at the cost of
1397 data-rate. The encoder may modify this value to divide frames evenly.
1399 Default value is @var{1}.
1401 @item compressor @var{integer}
1402 Specifies the second-stage compressor to use. If set to @option{none},
1403 @option{chunks} will be limited to 1, as chunked uncompressed frames offer no
1411 Default value is @option{snappy}.
1417 The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
1418 option can be used to set the encoding quality. Lossless encoding
1419 can be selected with @code{-pred 1}.
1424 @item format @var{integer}
1425 Can be set to either @code{j2k} or @code{jp2} (the default) that
1426 makes it possible to store non-rgb pix_fmts.
1428 @item tile_width @var{integer}
1429 Sets tile width. Range is 1 to 1073741824. Default is 256.
1431 @item tile_height @var{integer}
1432 Sets tile height. Range is 1 to 1073741824. Default is 256.
1434 @item pred @var{integer}
1435 Allows setting the discrete wavelet transform (DWT) type
1437 @item dwt97int (Lossy)
1438 @item dwt53 (Lossless)
1440 Default is @code{dwt97int}
1442 @item sop @var{boolean}
1443 Enable this to add SOP marker at the start of each packet. Disabled by default.
1445 @item eph @var{boolean}
1446 Enable this to add EPH marker at the end of each packet header. Disabled by default.
1448 @item prog @var{integer}
1449 Sets the progression order to be used by the encoder.
1450 Possible values are:
1458 Set to @code{lrcp} by default.
1460 @item layer_rates @var{string}
1461 By default, when this option is not used, compression is done using the quality metric.
1462 This option allows for compression using compression ratio. The compression ratio for each
1463 level could be specified. The compression ratio of a layer @code{l} species the what ratio of
1464 total file size is contained in the first @code{l} layers.
1469 ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k
1472 This would compress the image to contain 3 layers, where the data contained in the
1473 first layer would be compressed by 1000 times, compressed by 100 in the first two layers,
1474 and shall contain all data while using all 3 layers.
1480 rav1e AV1 encoder wrapper.
1482 Requires the presence of the rav1e headers and library during configuration.
1483 You need to explicitly configure the build with @code{--enable-librav1e}.
1489 Sets the maximum quantizer to use when using bitrate mode.
1492 Sets the minimum quantizer to use when using bitrate mode.
1495 Uses quantizer mode to encode at the given quantizer (0-255).
1498 Selects the speed preset (0-10) to encode with.
1501 Selects how many tiles to encode with.
1504 Selects how many rows of tiles to encode with.
1507 Selects how many columns of tiles to encode with.
1510 Set rav1e options using a list of @var{key}=@var{value} pairs separated
1511 by ":". See @command{rav1e --help} for a list of options.
1513 For example to specify librav1e encoding options with @option{-rav1e-params}:
1516 ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
1523 libaom AV1 encoder wrapper.
1525 Requires the presence of the libaom headers and library during
1526 configuration. You need to explicitly configure the build with
1527 @code{--enable-libaom}.
1531 The wrapper supports the following standard libavcodec options:
1536 Set bitrate target in bits/second. By default this will use
1537 variable-bitrate mode. If @option{maxrate} and @option{minrate} are
1538 also set to the same value then it will use constant-bitrate mode,
1539 otherwise if @option{crf} is set as well then it will use
1540 constrained-quality mode.
1543 Set key frame placement. The GOP size sets the maximum distance between
1544 key frames; if zero the output stream will be intra-only. The minimum
1545 distance is ignored unless it is the same as the GOP size, in which case
1546 key frames will always appear at a fixed interval. Not set by default,
1547 so without this option the library has completely free choice about
1548 where to place key frames.
1551 Set minimum/maximum quantisation values. Valid range is from 0 to 63
1552 (warning: this does not match the quantiser values actually used by AV1
1553 - divide by four to map real quantiser values to this range). Defaults
1554 to min/max (no constraint).
1556 @item minrate maxrate bufsize rc_init_occupancy
1557 Set rate control buffering parameters. Not used if not set - defaults
1558 to unconstrained variable bitrate.
1561 Set the number of threads to use while encoding. This may require the
1562 @option{tiles} or @option{row-mt} options to also be set to actually
1563 use the specified number of threads fully. Defaults to the number of
1564 hardware threads supported by the host machine.
1567 Set the encoding profile. Defaults to using the profile which matches
1568 the bit depth and chroma subsampling of the input.
1572 The wrapper also has some specific options:
1577 Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
1578 higher numbers indicating greater speed and lower quality. The default
1579 value is 1, which will be slow and high quality.
1582 Enable use of alternate reference frames. Defaults to the internal
1583 default of the library.
1585 @item arnr-max-frames (@emph{frames})
1586 Set altref noise reduction max frame count. Default is -1.
1588 @item arnr-strength (@emph{strength})
1589 Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
1591 @item aq-mode (@emph{aq-mode})
1592 Set adaptive quantization mode. Possible values:
1595 @item none (@emph{0})
1598 @item variance (@emph{1})
1601 @item complexity (@emph{2})
1604 @item cyclic (@emph{3})
1608 @item tune (@emph{tune})
1609 Set the distortion metric the encoder is tuned with. Default is @code{psnr}.
1612 @item psnr (@emph{0})
1614 @item ssim (@emph{1})
1618 Set the maximum number of frames which the encoder may keep in flight
1619 at any one time for lookahead purposes. Defaults to the internal
1620 default of the library.
1622 @item error-resilience
1623 Enable error resilience features:
1626 Improve resilience against losses of whole frames.
1628 Not enabled by default.
1631 Set the quality/size tradeoff for constant-quality (no bitrate target)
1632 and constrained-quality (with maximum bitrate target) modes. Valid
1633 range is 0 to 63, higher numbers indicating lower quality and smaller
1634 output size. Only used if set; by default only the bitrate target is
1638 Set a change threshold on blocks below which they will be skipped by
1639 the encoder. Defined in arbitrary units as a nonnegative integer,
1640 defaulting to zero (no blocks are skipped).
1642 @item drop-threshold
1643 Set a threshold for dropping frames when close to rate control bounds.
1644 Defined as a percentage of the target buffer - when the rate control
1645 buffer falls below this percentage, frames will be dropped until it
1646 has refilled above the threshold. Defaults to zero (no frames are
1649 @item denoise-noise-level (@emph{level})
1650 Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
1651 this option is not set or set to 0.
1653 @item denoise-block-size (@emph{pixels})
1654 Block size used for denoising for grain synthesis. If not set, AV1 codec
1655 uses the default value of 32.
1657 @item undershoot-pct (@emph{pct})
1658 Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
1661 @item overshoot-pct (@emph{pct})
1662 Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
1665 @item minsection-pct (@emph{pct})
1666 Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
1667 is not set, the libaomenc wrapper computes it as follows: @code{(minrate * 100 / bitrate)}.
1668 Range is -1 to 100. Default is -1 (unset).
1670 @item maxsection-pct (@emph{pct})
1671 Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
1672 is not set, the libaomenc wrapper computes it as follows: @code{(maxrate * 100 / bitrate)}.
1673 Range is -1 to 5000. Default is -1 (unset).
1675 @item frame-parallel (@emph{boolean})
1676 Enable frame parallel decodability features. Default is true.
1679 Set the number of tiles to encode the input video with, as columns x
1680 rows. Larger numbers allow greater parallelism in both encoding and
1681 decoding, but may decrease coding efficiency. Defaults to the minimum
1682 number of tiles required by the size of the input video (this is 1x1
1683 (that is, a single tile) for sizes up to and including 4K).
1685 @item tile-columns tile-rows
1686 Set the number of tiles as log2 of the number of tile rows and columns.
1687 Provided for compatibility with libvpx/VP9.
1689 @item row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2)
1690 Enable row based multi-threading. Disabled by default.
1692 @item enable-cdef (@emph{boolean})
1693 Enable Constrained Directional Enhancement Filter. The libaom-av1
1694 encoder enables CDEF by default.
1696 @item enable-restoration (@emph{boolean})
1697 Enable Loop Restoration Filter. Default is true for libaom-av1.
1699 @item enable-global-motion (@emph{boolean})
1700 Enable the use of global motion for block prediction. Default is true.
1702 @item enable-intrabc (@emph{boolean})
1703 Enable block copy mode for intra block prediction. This mode is
1704 useful for screen content. Default is true.
1706 @item enable-rect-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
1707 Enable rectangular partitions. Default is true.
1709 @item enable-1to4-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
1710 Enable 1:4/4:1 partitions. Default is true.
1712 @item enable-ab-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
1713 Enable AB shape partitions. Default is true.
1715 @item enable-angle-delta (@emph{boolean}) (Requires libaom >= v2.0.0)
1716 Enable angle delta intra prediction. Default is true.
1718 @item enable-cfl-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
1719 Enable chroma predicted from luma intra prediction. Default is true.
1721 @item enable-filter-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
1722 Enable filter intra predictor. Default is true.
1724 @item enable-intra-edge-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
1725 Enable intra edge filter. Default is true.
1727 @item enable-smooth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
1728 Enable smooth intra prediction mode. Default is true.
1730 @item enable-paeth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
1731 Enable paeth predictor in intra prediction. Default is true.
1733 @item enable-palette (@emph{boolean}) (Requires libaom >= v2.0.0)
1734 Enable palette prediction mode. Default is true.
1736 @item enable-flip-idtx (@emph{boolean}) (Requires libaom >= v2.0.0)
1737 Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST,
1738 FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT,
1739 V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true.
1741 @item enable-tx64 (@emph{boolean}) (Requires libaom >= v2.0.0)
1742 Enable 64-pt transform. Default is true.
1744 @item reduced-tx-type-set (@emph{boolean}) (Requires libaom >= v2.0.0)
1745 Use reduced set of transform types. Default is false.
1747 @item use-intra-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
1748 Use DCT only for INTRA modes. Default is false.
1750 @item use-inter-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
1751 Use DCT only for INTER modes. Default is false.
1753 @item use-intra-default-tx-only (@emph{boolean}) (Requires libaom >= v2.0.0)
1754 Use Default-transform only for INTRA modes. Default is false.
1756 @item enable-ref-frame-mvs (@emph{boolean}) (Requires libaom >= v2.0.0)
1757 Enable temporal mv prediction. Default is true.
1759 @item enable-reduced-reference-set (@emph{boolean}) (Requires libaom >= v2.0.0)
1760 Use reduced set of single and compound references. Default is false.
1762 @item enable-obmc (@emph{boolean}) (Requires libaom >= v2.0.0)
1763 Enable obmc. Default is true.
1765 @item enable-dual-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
1766 Enable dual filter. Default is true.
1768 @item enable-diff-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1769 Enable difference-weighted compound. Default is true.
1771 @item enable-dist-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1772 Enable distance-weighted compound. Default is true.
1774 @item enable-onesided-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1775 Enable one sided compound. Default is true.
1777 @item enable-interinter-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
1778 Enable interinter wedge compound. Default is true.
1780 @item enable-interintra-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
1781 Enable interintra wedge compound. Default is true.
1783 @item enable-masked-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1784 Enable masked compound. Default is true.
1786 @item enable-interintra-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1787 Enable interintra compound. Default is true.
1789 @item enable-smooth-interintra (@emph{boolean}) (Requires libaom >= v2.0.0)
1790 Enable smooth interintra mode. Default is true.
1793 Set libaom options using a list of @var{key}=@var{value} pairs separated
1794 by ":". For a list of supported options, see @command{aomenc --help} under the
1795 section "AV1 Specific Options".
1797 For example to specify libaom encoding options with @option{-aom-params}:
1800 ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
1807 SVT-AV1 encoder wrapper.
1809 Requires the presence of the SVT-AV1 headers and library during configuration.
1810 You need to explicitly configure the build with @code{--enable-libsvtav1}.
1816 Set the encoding profile.
1824 Set the operating point level. For example: '4.0'
1827 Set the Hierarchical prediction levels.
1831 This is the default.
1835 Set the operating point tier.
1838 This is the default.
1843 Set the maximum quantizer to use when using a bitrate mode.
1846 Set the minimum quantizer to use when using a bitrate mode.
1849 Constant rate factor value used in crf rate control mode (0-63).
1852 Set the quantizer used in cqp rate control mode (0-63).
1855 Enable scene change detection.
1858 Set number of frames to look ahead (0-120).
1861 Set the quality-speed tradeoff, in the range 0 to 13. Higher values are
1862 faster but lower quality.
1865 Set log2 of the number of rows of tiles to use (0-6).
1868 Set log2 of the number of columns of tiles to use (0-4).
1871 Set SVT-AV1 options using a list of @var{key}=@var{value} pairs separated
1872 by ":". See the SVT-AV1 encoder user guide for a list of accepted parameters.
1878 libjxl JPEG XL encoder wrapper.
1880 Requires the presence of the libjxl headers and library during
1881 configuration. You need to explicitly configure the build with
1882 @code{--enable-libjxl}.
1886 The libjxl wrapper supports the following options:
1891 Set the target Butteraugli distance. This is a quality setting: lower
1892 distance yields higher quality, with distance=1.0 roughly comparable to
1893 libjpeg Quality 90 for photographic content. Setting distance=0.0 yields
1894 true lossless encoding. Valid values range between 0.0 and 15.0, and sane
1895 values rarely exceed 5.0. Setting distance=0.1 usually attains
1896 transparency for most input. The default is 1.0.
1899 Set the encoding effort used. Higher effort values produce more consistent
1900 quality and usually produces a better quality/bpp curve, at the cost of
1901 more CPU time required. Valid values range from 1 to 9, and the default is 7.
1904 Force the encoder to use Modular mode instead of choosing automatically. The
1905 default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT
1906 is generally superior to Modular for lossy encoding but does not support
1913 Kvazaar H.265/HEVC encoder.
1915 Requires the presence of the libkvazaar headers and library during
1916 configuration. You need to explicitly configure the build with
1917 @option{--enable-libkvazaar}.
1924 Set target video bitrate in bit/s and enable rate control.
1926 @item kvazaar-params
1927 Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
1928 by commas (,). See kvazaar documentation for a list of options.
1932 @section libopenh264
1934 Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
1936 This encoder requires the presence of the libopenh264 headers and
1937 library during configuration. You need to explicitly configure the
1938 build with @code{--enable-libopenh264}. The library is detected using
1939 @command{pkg-config}.
1941 For more information about the library see
1942 @url{http://www.openh264.org}.
1946 The following FFmpeg global options affect the configurations of the
1947 libopenh264 encoder.
1951 Set the bitrate (as a number of bits per second).
1957 Set the max bitrate (as a number of bits per second).
1959 @item flags +global_header
1960 Set global header in the bitstream.
1963 Set the number of slices, used in parallelized encoding. Default value
1964 is 0. This is only used when @option{slice_mode} is set to
1968 Enable loop filter, if set to 1 (automatically enabled). To disable
1972 Set profile restrictions. If set to the value of @samp{main} enable
1973 CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
1976 Set maximum NAL size in bytes.
1978 @item allow_skip_frames
1979 Allow skipping frames to hit the target bitrate if set to 1.
1984 libtheora Theora encoder wrapper.
1986 Requires the presence of the libtheora headers and library during
1987 configuration. You need to explicitly configure the build with
1988 @code{--enable-libtheora}.
1990 For more information about the libtheora project see
1991 @url{http://www.theora.org/}.
1995 The following global options are mapped to internal libtheora options
1996 which affect the quality and the bitrate of the encoded stream.
2000 Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
2001 case VBR (Variable Bit Rate) mode is enabled this option is ignored.
2004 Used to enable constant quality mode (VBR) encoding through the
2005 @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
2011 @item global_quality
2012 Set the global quality as an integer in lambda units.
2014 Only relevant when VBR mode is enabled with @code{flags +qscale}. The
2015 value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
2016 clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
2017 value in the native libtheora range [0-63]. A higher value corresponds
2018 to a higher quality.
2021 Enable VBR mode when set to a non-negative value, and set constant
2022 quality value as a double floating point value in QP units.
2024 The value is clipped in the [0-10] range, and then multiplied by 6.3
2025 to get a value in the native libtheora range [0-63].
2027 This option is valid only using the @command{ffmpeg} command-line
2028 tool. For library interface users, use @option{global_quality}.
2031 @subsection Examples
2035 Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
2037 ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
2041 Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
2043 ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
2049 VP8/VP9 format supported through libvpx.
2051 Requires the presence of the libvpx headers and library during configuration.
2052 You need to explicitly configure the build with @code{--enable-libvpx}.
2056 The following options are supported by the libvpx wrapper. The
2057 @command{vpxenc}-equivalent options or values are listed in parentheses
2060 To reduce the duplication of documentation, only the private options
2061 and some others requiring special attention are documented here. For
2062 the documentation of the undocumented generic options, see
2063 @ref{codec-options,,the Codec Options chapter}.
2065 To get more documentation of the libvpx options, invoke the command
2066 @command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
2067 @command{vpxenc --help}. Further information is available in the libvpx API
2072 @item b (@emph{target-bitrate})
2073 Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
2074 expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
2077 @item g (@emph{kf-max-dist})
2079 @item keyint_min (@emph{kf-min-dist})
2081 @item qmin (@emph{min-q})
2082 Minimum (Best Quality) Quantizer.
2084 @item qmax (@emph{max-q})
2085 Maximum (Worst Quality) Quantizer.
2086 Can be changed per-frame.
2088 @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
2089 Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
2090 specified in milliseconds, the libvpx wrapper converts this value as follows:
2091 @code{buf-sz = bufsize * 1000 / bitrate},
2092 @code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
2094 @item rc_init_occupancy (@emph{buf-initial-sz})
2095 Set number of bits which should be loaded into the rc buffer before decoding
2096 starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
2097 wrapper converts this value as follows:
2098 @code{rc_init_occupancy * 1000 / bitrate}.
2100 @item undershoot-pct
2101 Set datarate undershoot (min) percentage of the target bitrate.
2104 Set datarate overshoot (max) percentage of the target bitrate.
2106 @item skip_threshold (@emph{drop-frame})
2108 @item qcomp (@emph{bias-pct})
2110 @item maxrate (@emph{maxsection-pct})
2111 Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
2112 percentage of the target bitrate, the libvpx wrapper converts this value as
2113 follows: @code{(maxrate * 100 / bitrate)}.
2115 @item minrate (@emph{minsection-pct})
2116 Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
2117 percentage of the target bitrate, the libvpx wrapper converts this value as
2118 follows: @code{(minrate * 100 / bitrate)}.
2120 @item minrate, maxrate, b @emph{end-usage=cbr}
2121 @code{(minrate == maxrate == bitrate)}.
2123 @item crf (@emph{end-usage=cq}, @emph{cq-level})
2125 @item tune (@emph{tune})
2127 @item psnr (@emph{psnr})
2128 @item ssim (@emph{ssim})
2131 @item quality, deadline (@emph{deadline})
2134 Use best quality deadline. Poorly named and quite slow, this option should be
2135 avoided as it may give worse quality output than good.
2137 Use good quality deadline. This is a good trade-off between speed and quality
2138 when used with the @option{cpu-used} option.
2140 Use realtime quality deadline.
2143 @item speed, cpu-used (@emph{cpu-used})
2144 Set quality/speed ratio modifier. Higher values speed up the encode at the cost
2147 @item nr (@emph{noise-sensitivity})
2150 Set a change threshold on blocks below which they will be skipped by the
2153 @item slices (@emph{token-parts})
2154 Note that FFmpeg's @option{slices} option gives the total number of partitions,
2155 while @command{vpxenc}'s @option{token-parts} is given as
2156 @code{log2(partitions)}.
2158 @item max-intra-rate
2159 Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
2162 @item force_key_frames
2163 @code{VPX_EFLAG_FORCE_KF}
2165 @item Alternate reference frame related
2168 Enable use of alternate reference frames (2-pass only).
2169 Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
2170 @item arnr-maxframes
2171 Set altref noise reduction max frame count.
2173 Set altref noise reduction filter type: backward, forward, centered.
2175 Set altref noise reduction filter strength.
2176 @item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
2177 Set number of frames to look ahead for frametype and ratecontrol.
2178 @item min-gf-interval
2179 Set minimum golden/alternate reference frame interval (VP9 only).
2182 @item error-resilient
2183 Enable error resiliency features.
2185 @item sharpness @var{integer}
2186 Increase sharpness at the expense of lower PSNR.
2187 The valid range is [0, 7].
2190 Sets the temporal scalability configuration using a :-separated list of
2191 key=value pairs. For example, to specify temporal scalability parameters
2194 ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
2195 ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
2196 ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
2198 Below is a brief explanation of each of the parameters, please
2199 refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more
2202 @item ts_number_layers
2203 Number of temporal coding layers.
2204 @item ts_target_bitrate
2205 Target bitrate for each temporal layer (in kbps).
2206 (bitrate should be inclusive of the lower temporal layer).
2207 @item ts_rate_decimator
2208 Frame rate decimation factor for each temporal layer.
2209 @item ts_periodicity
2210 Length of the sequence defining frame temporal layer membership.
2212 Template defining the membership of frames to temporal layers.
2213 @item ts_layering_mode
2214 (optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
2215 Currently supports the following options.
2218 No temporal layering flags are provided internally,
2219 relies on flags being passed in using @code{metadata} field in @code{AVFrame}
2220 with following keys.
2223 Sets the flags passed into the encoder to indicate the referencing scheme for
2225 Refer to function @code{vpx_codec_encode} in @code{vpx/vpx_encoder.h} for more
2228 Explicitly sets the temporal id of the current frame to encode.
2231 Two temporal layers. 0-1...
2233 Three temporal layers. 0-2-1-2...; with single reference frame.
2235 Same as option "3", except there is a dependency between
2236 the two temporal layer 2 frames within the temporal period.
2240 @item VP9-specific options
2243 Enable lossless mode.
2245 Set number of tile columns to use. Note this is given as
2246 @code{log2(tile_columns)}. For example, 8 tile columns would be requested by
2247 setting the @option{tile-columns} option to 3.
2249 Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
2250 For example, 4 tile rows would be requested by setting the @option{tile-rows}
2252 @item frame-parallel
2253 Enable frame parallel decodability features.
2255 Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
2256 cyclic refresh, 4: equator360).
2257 @item colorspace @emph{color-space}
2258 Set input color space. The VP9 bitstream supports signaling the following
2261 @item @samp{rgb} @emph{sRGB}
2262 @item @samp{bt709} @emph{bt709}
2263 @item @samp{unspecified} @emph{unknown}
2264 @item @samp{bt470bg} @emph{bt601}
2265 @item @samp{smpte170m} @emph{smpte170}
2266 @item @samp{smpte240m} @emph{smpte240}
2267 @item @samp{bt2020_ncl} @emph{bt2020}
2269 @item row-mt @var{boolean}
2270 Enable row based multi-threading.
2272 Set content type: default (0), screen (1), film (2).
2273 @item corpus-complexity
2274 Corpus VBR mode is a variant of standard VBR where the complexity distribution
2275 midpoint is passed in rather than calculated for a specific clip or chunk.
2277 The valid range is [0, 10000]. 0 (default) uses standard VBR.
2278 @item enable-tpl @var{boolean}
2279 Enable temporal dependency model.
2280 @item ref-frame-config
2281 Using per-frame metadata, set members of the structure @code{vpx_svc_ref_frame_config_t} in @code{vpx/vp8cx.h} to fine-control referencing schemes and frame buffer management.
2282 @*Use a :-separated list of key=value pairs.
2285 av_dict_set(&av_frame->metadata, "ref-frame-config", \
2286 "rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0");
2289 @item rfc_update_buffer_slot
2290 Indicates the buffer slot number to update
2291 @item rfc_update_last
2292 Indicates whether to update the LAST frame
2293 @item rfc_update_golden
2294 Indicates whether to update GOLDEN frame
2295 @item rfc_update_alt_ref
2296 Indicates whether to update ALT_REF frame
2297 @item rfc_lst_fb_idx
2298 LAST frame buffer index
2299 @item rfc_gld_fb_idx
2300 GOLDEN frame buffer index
2301 @item rfc_alt_fb_idx
2302 ALT_REF frame buffer index
2303 @item rfc_reference_last
2304 Indicates whether to reference LAST frame
2305 @item rfc_reference_golden
2306 Indicates whether to reference GOLDEN frame
2307 @item rfc_reference_alt_ref
2308 Indicates whether to reference ALT_REF frame
2309 @item rfc_reference_duration
2310 Indicates frame duration
2316 For more information about libvpx see:
2317 @url{http://www.webmproject.org/}
2321 libwebp WebP Image encoder wrapper
2323 libwebp is Google's official encoder for WebP images. It can encode in either
2324 lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
2325 frame. Lossless images are a separate codec developed by Google.
2327 @subsection Pixel Format
2329 Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
2330 to limitations of the format and libwebp. Alpha is supported for either mode.
2331 Because of API limitations, if RGB is passed in when encoding lossy or YUV is
2332 passed in for encoding lossless, the pixel format will automatically be
2333 converted using functions from libwebp. This is not ideal and is done only for
2340 @item -lossless @var{boolean}
2341 Enables/Disables use of lossless mode. Default is 0.
2343 @item -compression_level @var{integer}
2344 For lossy, this is a quality/speed tradeoff. Higher values give better quality
2345 for a given size at the cost of increased encoding time. For lossless, this is
2346 a size/speed tradeoff. Higher values give smaller size at the cost of increased
2347 encoding time. More specifically, it controls the number of extra algorithms
2348 and compression tools used, and varies the combination of these tools. This
2349 maps to the @var{method} option in libwebp. The valid range is 0 to 6.
2352 @item -quality @var{float}
2353 For lossy encoding, this controls image quality. For lossless encoding, this
2354 controls the effort and time spent in compression.
2355 Range is 0 to 100. Default is 75.
2357 @item -preset @var{type}
2358 Configuration preset. This does some automatic settings based on the general
2362 Do not use a preset.
2364 Use the encoder default.
2366 Digital picture, like portrait, inner shot
2368 Outdoor photograph, with natural lighting
2370 Hand or line drawing, with high-contrast details
2372 Small-sized colorful images
2379 @section libx264, libx264rgb
2381 x264 H.264/MPEG-4 AVC encoder wrapper.
2383 This encoder requires the presence of the libx264 headers and library
2384 during configuration. You need to explicitly configure the build with
2385 @code{--enable-libx264}.
2387 libx264 supports an impressive number of features, including 8x8 and
2388 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
2389 entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
2390 for detail retention (adaptive quantization, psy-RD, psy-trellis).
2392 Many libx264 encoder options are mapped to FFmpeg global codec
2393 options, while unique encoder options are provided through private
2394 options. Additionally the @option{x264opts} and @option{x264-params}
2395 private options allows one to pass a list of key=value tuples as accepted
2396 by the libx264 @code{x264_param_parse} function.
2398 The x264 project website is at
2399 @url{http://www.videolan.org/developers/x264.html}.
2401 The libx264rgb encoder is the same as libx264, except it accepts packed RGB
2402 pixel formats as input instead of YUV.
2404 @subsection Supported Pixel Formats
2406 x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
2407 x264's configure time.
2411 The following options are supported by the libx264 wrapper. The
2412 @command{x264}-equivalent options or values are listed in parentheses
2415 To reduce the duplication of documentation, only the private options
2416 and some others requiring special attention are documented here. For
2417 the documentation of the undocumented generic options, see
2418 @ref{codec-options,,the Codec Options chapter}.
2420 To get a more accurate and extensive documentation of the libx264
2421 options, invoke the command @command{x264 --fullhelp} or consult
2422 the libx264 documentation.
2425 @item b (@emph{bitrate})
2426 Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
2427 expressed in bits/s, while @command{x264}'s @option{bitrate} is in
2430 @item bf (@emph{bframes})
2432 @item g (@emph{keyint})
2434 @item qmin (@emph{qpmin})
2435 Minimum quantizer scale.
2437 @item qmax (@emph{qpmax})
2438 Maximum quantizer scale.
2440 @item qdiff (@emph{qpstep})
2441 Maximum difference between quantizer scales.
2443 @item qblur (@emph{qblur})
2444 Quantizer curve blur
2446 @item qcomp (@emph{qcomp})
2447 Quantizer curve compression factor
2449 @item refs (@emph{ref})
2450 Number of reference frames each P-frame can use. The range is from @var{0-16}.
2452 @item level (@emph{level})
2453 Set the @code{x264_param_t.i_level_idc} value in case the value is
2454 positive, it is ignored otherwise.
2456 This value can be set using the @code{AVCodecContext} API (e.g. by
2457 setting the @code{AVCodecContext} value directly), and is specified as
2458 an integer mapped on a corresponding level (e.g. the value 31 maps
2459 to H.264 level IDC "3.1", as defined in the @code{x264_levels}
2460 table). It is ignored when set to a non positive value.
2462 Alternatively it can be set as a private option, overriding the value
2463 set in @code{AVCodecContext}, and in this case must be specified as
2464 the level IDC identifier (e.g. "3.1"), as defined by H.264 Annex A.
2466 @item sc_threshold (@emph{scenecut})
2467 Sets the threshold for the scene change detection.
2469 @item trellis (@emph{trellis})
2470 Performs Trellis quantization to increase efficiency. Enabled by default.
2472 @item nr (@emph{nr})
2474 @item me_range (@emph{merange})
2475 Maximum range of the motion search in pixels.
2477 @item me_method (@emph{me})
2478 Set motion estimation method. Possible values in the decreasing order
2482 @item dia (@emph{dia})
2483 @item epzs (@emph{dia})
2484 Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
2486 @item hex (@emph{hex})
2487 Hexagonal search with radius 2.
2488 @item umh (@emph{umh})
2489 Uneven multi-hexagon search.
2490 @item esa (@emph{esa})
2492 @item tesa (@emph{tesa})
2493 Hadamard exhaustive search (slowest).
2497 Normally, when forcing a I-frame type, the encoder can select any type
2498 of I-frame. This option forces it to choose an IDR-frame.
2500 @item subq (@emph{subme})
2501 Sub-pixel motion estimation method.
2503 @item b_strategy (@emph{b-adapt})
2504 Adaptive B-frame placement decision algorithm. Use only on first-pass.
2506 @item keyint_min (@emph{min-keyint})
2510 Set entropy encoder. Possible values:
2517 Enable CAVLC and disable CABAC. It generates the same effect as
2518 @command{x264}'s @option{--no-cabac} option.
2522 Set full pixel motion estimation comparison algorithm. Possible values:
2526 Enable chroma in motion estimation.
2529 Ignore chroma in motion estimation. It generates the same effect as
2530 @command{x264}'s @option{--no-chroma-me} option.
2533 @item threads (@emph{threads})
2534 Number of encoding threads.
2537 Set multithreading technique. Possible values:
2541 Slice-based multithreading. It generates the same effect as
2542 @command{x264}'s @option{--sliced-threads} option.
2544 Frame-based multithreading.
2548 Set encoding flags. It can be used to disable closed GOP and enable
2549 open GOP by setting it to @code{-cgop}. The result is similar to
2550 the behavior of @command{x264}'s @option{--open-gop} option.
2552 @item rc_init_occupancy (@emph{vbv-init})
2554 @item preset (@emph{preset})
2555 Set the encoding preset.
2557 @item tune (@emph{tune})
2558 Set tuning of the encoding params.
2560 @item profile (@emph{profile})
2561 Set profile restrictions.
2564 Enable fast settings when encoding first pass, when set to 1. When set
2565 to 0, it has the same effect of @command{x264}'s
2566 @option{--slow-firstpass} option.
2568 @item crf (@emph{crf})
2569 Set the quality for constant quality mode.
2571 @item crf_max (@emph{crf-max})
2572 In CRF mode, prevents VBV from lowering quality beyond this point.
2574 @item qp (@emph{qp})
2575 Set constant quantization rate control method parameter.
2577 @item aq-mode (@emph{aq-mode})
2578 Set AQ method. Possible values:
2581 @item none (@emph{0})
2584 @item variance (@emph{1})
2585 Variance AQ (complexity mask).
2587 @item autovariance (@emph{2})
2588 Auto-variance AQ (experimental).
2591 @item aq-strength (@emph{aq-strength})
2592 Set AQ strength, reduce blocking and blurring in flat and textured areas.
2595 Use psychovisual optimizations when set to 1. When set to 0, it has the
2596 same effect as @command{x264}'s @option{--no-psy} option.
2598 @item psy-rd (@emph{psy-rd})
2599 Set strength of psychovisual optimization, in
2600 @var{psy-rd}:@var{psy-trellis} format.
2602 @item rc-lookahead (@emph{rc-lookahead})
2603 Set number of frames to look ahead for frametype and ratecontrol.
2606 Enable weighted prediction for B-frames when set to 1. When set to 0,
2607 it has the same effect as @command{x264}'s @option{--no-weightb} option.
2609 @item weightp (@emph{weightp})
2610 Set weighted prediction method for P-frames. Possible values:
2613 @item none (@emph{0})
2615 @item simple (@emph{1})
2616 Enable only weighted refs
2617 @item smart (@emph{2})
2618 Enable both weighted refs and duplicates
2621 @item ssim (@emph{ssim})
2622 Enable calculation and printing SSIM stats after the encoding.
2624 @item intra-refresh (@emph{intra-refresh})
2625 Enable the use of Periodic Intra Refresh instead of IDR frames when set
2628 @item avcintra-class (@emph{class})
2629 Configure the encoder to generate AVC-Intra.
2630 Valid values are 50,100 and 200
2632 @item bluray-compat (@emph{bluray-compat})
2633 Configure the encoder to be compatible with the bluray standard.
2634 It is a shorthand for setting "bluray-compat=1 force-cfr=1".
2636 @item b-bias (@emph{b-bias})
2637 Set the influence on how often B-frames are used.
2639 @item b-pyramid (@emph{b-pyramid})
2640 Set method for keeping of some B-frames as references. Possible values:
2643 @item none (@emph{none})
2645 @item strict (@emph{strict})
2646 Strictly hierarchical pyramid.
2647 @item normal (@emph{normal})
2648 Non-strict (not Blu-ray compatible).
2652 Enable the use of one reference per partition, as opposed to one
2653 reference per macroblock when set to 1. When set to 0, it has the
2654 same effect as @command{x264}'s @option{--no-mixed-refs} option.
2657 Enable adaptive spatial transform (high profile 8x8 transform)
2658 when set to 1. When set to 0, it has the same effect as
2659 @command{x264}'s @option{--no-8x8dct} option.
2662 Enable early SKIP detection on P-frames when set to 1. When set
2663 to 0, it has the same effect as @command{x264}'s
2664 @option{--no-fast-pskip} option.
2666 @item aud (@emph{aud})
2667 Enable use of access unit delimiters when set to 1.
2670 Enable use macroblock tree ratecontrol when set to 1. When set
2671 to 0, it has the same effect as @command{x264}'s
2672 @option{--no-mbtree} option.
2674 @item deblock (@emph{deblock})
2675 Set loop filter parameters, in @var{alpha}:@var{beta} form.
2677 @item cplxblur (@emph{cplxblur})
2678 Set fluctuations reduction in QP (before curve compression).
2680 @item partitions (@emph{partitions})
2681 Set partitions to consider as a comma-separated list of. Possible
2686 8x8 P-frame partition.
2688 4x4 P-frame partition.
2690 4x4 B-frame partition.
2692 8x8 I-frame partition.
2694 4x4 I-frame partition.
2695 (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
2696 @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
2697 option) to be enabled.)
2698 @item none (@emph{none})
2699 Do not consider any partitions.
2700 @item all (@emph{all})
2701 Consider every partition.
2704 @item direct-pred (@emph{direct})
2705 Set direct MV prediction mode. Possible values:
2708 @item none (@emph{none})
2709 Disable MV prediction.
2710 @item spatial (@emph{spatial})
2711 Enable spatial predicting.
2712 @item temporal (@emph{temporal})
2713 Enable temporal predicting.
2714 @item auto (@emph{auto})
2715 Automatically decided.
2718 @item slice-max-size (@emph{slice-max-size})
2719 Set the limit of the size of each slice in bytes. If not specified
2720 but RTP payload size (@option{ps}) is specified, that is used.
2722 @item stats (@emph{stats})
2723 Set the file name for multi-pass stats.
2725 @item nal-hrd (@emph{nal-hrd})
2726 Set signal HRD information (requires @option{vbv-bufsize} to be set).
2730 @item none (@emph{none})
2731 Disable HRD information signaling.
2732 @item vbr (@emph{vbr})
2734 @item cbr (@emph{cbr})
2735 Constant bit rate (not allowed in MP4 container).
2738 @item x264opts (N.A.)
2739 Set any x264 option, see @command{x264 --fullhelp} for a list.
2741 Argument is a list of @var{key}=@var{value} couples separated by
2742 ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
2743 themselves, use "," instead. They accept it as well since long ago but this
2744 is kept undocumented for some reason.
2746 For example to specify libx264 encoding options with @command{ffmpeg}:
2748 ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
2751 @item a53cc @var{boolean}
2752 Import closed captions (which must be ATSC compatible format) into output.
2753 Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
2755 @item udu_sei @var{boolean}
2756 Import user data unregistered SEI if available into output. Default is 0 (off).
2758 @item mb_info @var{boolean}
2759 Set mb_info data through AVFrameSideData, only useful when used from the
2760 API. Default is 0 (off).
2762 @item x264-params (N.A.)
2763 Override the x264 configuration using a :-separated list of key=value
2766 This option is functionally the same as the @option{x264opts}, but is
2767 duplicated for compatibility with the Libav fork.
2769 For example to specify libx264 encoding options with @command{ffmpeg}:
2771 ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
2772 cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
2773 no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
2777 Encoding ffpresets for common usages are provided so they can be used with the
2778 general presets system (e.g. passing the @option{pre} option).
2782 x265 H.265/HEVC encoder wrapper.
2784 This encoder requires the presence of the libx265 headers and library
2785 during configuration. You need to explicitly configure the build with
2786 @option{--enable-libx265}.
2792 Sets target video bitrate.
2803 Number of reference frames each P-frame can use. The range is from @var{1-16}.
2806 Set the x265 preset.
2809 Set the x265 tune parameter.
2812 Set profile restrictions.
2815 Set the quality for constant quality mode.
2818 Set constant quantization rate control method parameter.
2821 Minimum quantizer scale.
2824 Maximum quantizer scale.
2827 Maximum difference between quantizer scales.
2830 Quantizer curve blur
2833 Quantizer curve compression factor
2840 Normally, when forcing a I-frame type, the encoder can select any type
2841 of I-frame. This option forces it to choose an IDR-frame.
2843 @item udu_sei @var{boolean}
2844 Import user data unregistered SEI if available into output. Default is 0 (off).
2847 Set x265 options using a list of @var{key}=@var{value} couples separated
2848 by ":". See @command{x265 --help} for a list of options.
2850 For example to specify libx265 encoding options with @option{-x265-params}:
2853 ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
2859 xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
2861 This encoder requires the presence of the libxavs2 headers and library
2862 during configuration. You need to explicitly configure the build with
2863 @option{--enable-libxavs2}.
2865 The following standard libavcodec options are used:
2868 @option{b} / @option{bit_rate}
2870 @option{g} / @option{gop_size}
2872 @option{bf} / @option{max_b_frames}
2875 The encoder also has its own specific options:
2879 @item lcu_row_threads
2880 Set the number of parallel threads for rows from 1 to 8 (default 5).
2883 Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
2884 used to set the initial qp for the first frame.
2887 Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
2888 used to set the qp value under constant-QP mode.
2891 Set the max qp for rate control from 1 to 63 (default 55).
2894 Set the min qp for rate control from 1 to 63 (default 20).
2897 Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
2900 Set the log level from -1 to 3 (default 0). -1: none, 0: error,
2901 1: warning, 2: info, 3: debug.
2904 Set xavs2 options using a list of @var{key}=@var{value} couples separated
2907 For example to specify libxavs2 encoding options with @option{-xavs2-params}:
2910 ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
2916 Xvid MPEG-4 Part 2 encoder wrapper.
2918 This encoder requires the presence of the libxvidcore headers and library
2919 during configuration. You need to explicitly configure the build with
2920 @code{--enable-libxvid --enable-gpl}.
2922 The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
2923 users can encode to this format without this library.
2927 The following options are supported by the libxvid wrapper. Some of
2928 the following options are listed but are not documented, and
2929 correspond to shared codec options. See @ref{codec-options,,the Codec
2930 Options chapter} for their documentation. The other shared options
2931 which are not listed have no effect for the libxvid encoder.
2953 Set specific encoding flags. Possible values:
2958 Use four motion vector by macroblock.
2961 Enable high quality AC prediction.
2964 Only encode grayscale.
2967 Enable the use of global motion compensation (GMC).
2970 Enable quarter-pixel motion compensation.
2976 Place global headers in extradata instead of every keyframe.
2983 Set motion estimation quality level. Possible values in decreasing order of
2984 speed and increasing order of quality:
2988 Use no motion estimation (default).
2991 Enable advanced diamond zonal search for 16x16 blocks and half-pixel
2992 refinement for 16x16 blocks.
2995 Enable all of the things described above, plus advanced diamond zonal
2996 search for 8x8 blocks and half-pixel refinement for 8x8 blocks, also
2997 enable motion estimation on chroma planes for P and B-frames.
3000 Enable all of the things described above, plus extended 16x16 and 8x8
3005 Set macroblock decision algorithm. Possible values in the increasing
3010 Use macroblock comparing function algorithm (default).
3013 Enable rate distortion-based half pixel and quarter pixel refinement for
3017 Enable all of the things described above, plus rate distortion-based
3018 half pixel and quarter pixel refinement for 8x8 blocks, and rate
3019 distortion-based search using square pattern.
3023 Enable lumi masking adaptive quantization when set to 1. Default is 0
3027 Enable variance adaptive quantization when set to 1. Default is 0
3030 When combined with @option{lumi_aq}, the resulting quality will not
3031 be better than any of the two specified individually. In other
3032 words, the resulting quality will be the worse one of the two
3036 Set structural similarity (SSIM) displaying method. Possible values:
3040 Disable displaying of SSIM information.
3043 Output average SSIM at the end of encoding to stdout. The format of
3044 showing the average SSIM is:
3050 For users who are not familiar with C, %f means a float number, or
3051 a decimal (e.g. 0.939232).
3054 Output both per-frame SSIM data during encoding and average SSIM at
3055 the end of encoding to stdout. The format of per-frame information
3059 SSIM: avg: %1.3f min: %1.3f max: %1.3f
3062 For users who are not familiar with C, %1.3f means a float number
3063 rounded to 3 digits after the dot (e.g. 0.932).
3068 Set SSIM accuracy. Valid options are integers within the range of
3069 0-4, while 0 gives the most accurate result and 4 computes the
3074 @section MediaFoundation
3076 This provides wrappers to encoders (both audio and video) in the
3077 MediaFoundation framework. It can access both SW and HW encoders.
3078 Video encoders can take input in either of nv12 or yuv420p form
3079 (some encoders support both, some support only either - in practice,
3080 nv12 is the safer choice, especially among HW encoders).
3082 @section Microsoft RLE
3084 Microsoft RLE aka MSRLE encoder.
3085 Only 8-bit palette mode supported.
3086 Compatible with Windows 3.1 and Windows 95.
3091 @item g @var{integer}
3093 A keyframe is inserted at least every @code{-g} frames, sometimes sooner.
3098 MPEG-2 video encoder.
3104 Select the mpeg2 profile to encode:
3118 Select the mpeg2 level to encode:
3127 @item seq_disp_ext @var{integer}
3128 Specifies if the encoder should write a sequence_display_extension to the
3133 Decide automatically to write it or not (this is the default) by checking if
3134 the data to be written is different from the default or unspecified values.
3142 @item video_format @var{integer}
3143 Specifies the video_format written into the sequence display extension
3144 indicating the source of the video pictures. The default is @samp{unspecified},
3145 can be @samp{component}, @samp{pal}, @samp{ntsc}, @samp{secam} or @samp{mac}.
3146 For maximum compatibility, use @samp{component}.
3147 @item a53cc @var{boolean}
3148 Import closed captions (which must be ATSC compatible format) into output.
3156 @subsection Private options
3159 @item dpi @var{integer}
3160 Set physical density of pixels, in dots per inch, unset by default
3161 @item dpm @var{integer}
3162 Set physical density of pixels, in dots per meter, unset by default
3167 Apple ProRes encoder.
3169 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
3170 The used encoder can be chosen with the @code{-vcodec} option.
3172 @subsection Private Options for prores-ks
3175 @item profile @var{integer}
3176 Select the ProRes profile to encode
3186 @item quant_mat @var{integer}
3187 Select quantization matrix.
3196 If set to @var{auto}, the matrix matching the profile will be picked.
3197 If not set, the matrix providing the highest quality, @var{default}, will be
3200 @item bits_per_mb @var{integer}
3201 How many bits to allot for coding one macroblock. Different profiles use
3202 between 200 and 2400 bits per macroblock, the maximum is 8000.
3204 @item mbs_per_slice @var{integer}
3205 Number of macroblocks in each slice (1-8); the default value (8)
3206 should be good in almost all situations.
3208 @item vendor @var{string}
3209 Override the 4-byte vendor ID.
3210 A custom vendor ID like @var{apl0} would claim the stream was produced by
3213 @item alpha_bits @var{integer}
3214 Specify number of bits for alpha component.
3215 Possible values are @var{0}, @var{8} and @var{16}.
3216 Use @var{0} to disable alpha plane coding.
3220 @subsection Speed considerations
3222 In the default mode of operation the encoder has to honor frame constraints
3223 (i.e. not produce frames with size bigger than requested) while still making
3224 output picture as good as possible.
3225 A frame containing a lot of small details is harder to compress and the encoder
3226 would spend more time searching for appropriate quantizers for each slice.
3228 Setting a higher @option{bits_per_mb} limit will improve the speed.
3230 For the fastest encoding speed set the @option{qscale} parameter (4 is the
3231 recommended value) and do not set a size constraint.
3233 @section QSV Encoders
3235 The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG,
3238 @subsection Ratecontrol Method
3239 The ratecontrol method is selected as follows:
3242 When @option{global_quality} is specified, a quality-based mode is used.
3243 Specifically this means either
3246 @var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
3247 also set (the @option{-qscale} ffmpeg option).
3250 @var{LA_ICQ} - intelligent constant quality with lookahead, when the
3251 @option{look_ahead} option is also set.
3254 @var{ICQ} -- intelligent constant quality otherwise. For the ICQ modes, global
3255 quality range is 1 to 51, with 1 being the best quality.
3259 Otherwise, a bitrate-based mode is used. For all of those, you should specify at
3260 least the desired average bitrate with the @option{b} option.
3263 @var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
3266 @var{VCM} - video conferencing mode, when the @option{vcm} option is set.
3269 @var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
3270 the average bitrate.
3273 @var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
3274 than the average bitrate.
3277 @var{AVBR} - average VBR mode, when @option{maxrate} is not specified, both
3278 @option{avbr_accuracy} and @option{avbr_convergence} are set to non-zero. This
3279 mode is available for H264 and HEVC on Windows.
3283 Note that depending on your system, a different mode than the one you specified
3284 may be selected by the encoder. Set the verbosity level to @var{verbose} or
3285 higher to see the actual settings used by the QSV runtime.
3287 @subsection Global Options -> MSDK Options
3288 Additional libavcodec global options are mapped to MSDK options as follows:
3292 @option{g/gop_size} -> @option{GopPicSize}
3295 @option{bf/max_b_frames}+1 -> @option{GopRefDist}
3298 @option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
3299 @option{InitialDelayInKB}
3302 @option{slices} -> @option{NumSlice}
3305 @option{refs} -> @option{NumRefFrame}
3308 @option{b_strategy/b_frame_strategy} -> @option{BRefType}
3311 @option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
3314 For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
3315 @option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
3316 and @var{QPP} and @var{QPB} respectively.
3319 Setting the @option{coder} option to the value @var{vlc} will make the H.264
3320 encoder use CAVLC instead of CABAC.
3324 @subsection Common Options
3325 Following options are used by all qsv encoders.
3328 @item @var{async_depth}
3329 Specifies how many asynchronous operations an application performs
3330 before the application explicitly synchronizes the result. If zero,
3331 the value is not specified.
3334 This option itemizes a range of choices from veryfast (best speed) to veryslow
3346 @item @var{forced_idr}
3347 Forcing I frames as IDR frames.
3349 @item @var{low_power}
3350 For encoders set this flag to ON to reduce power consumption and GPU usage.
3353 @subsection Runtime Options
3354 Following options can be used durning qsv encoding.
3357 @item @var{global_quality}
3358 @item @var{i_quant_factor}
3359 @item @var{i_quant_offset}
3360 @item @var{b_quant_factor}
3361 @item @var{b_quant_offset}
3362 Supported in h264_qsv and hevc_qsv.
3363 Change these value to reset qsv codec's qp configuration.
3365 @item @var{max_frame_size}
3366 Supported in h264_qsv and hevc_qsv.
3367 Change this value to reset qsv codec's MaxFrameSize configuration.
3369 @item @var{gop_size}
3370 Change this value to reset qsv codec's gop configuration.
3372 @item @var{int_ref_type}
3373 @item @var{int_ref_cycle_size}
3374 @item @var{int_ref_qp_delta}
3375 @item @var{int_ref_cycle_dist}
3376 Supported in h264_qsv and hevc_qsv.
3377 Change these value to reset qsv codec's Intra Refresh configuration.
3381 @item @var{max_qp_i}
3382 @item @var{min_qp_i}
3383 @item @var{max_qp_p}
3384 @item @var{min_qp_p}
3385 @item @var{max_qp_b}
3386 @item @var{min_qp_b}
3387 Supported in h264_qsv.
3388 Change these value to reset qsv codec's max/min qp configuration.
3390 @item @var{low_delay_brc}
3391 Supported in h264_qsv, hevc_qsv and av1_qsv.
3392 Change this value to reset qsv codec's low_delay_brc configuration.
3394 @item @var{framerate}
3395 Change this value to reset qsv codec's framerate configuration.
3397 @item @var{bit_rate}
3398 @item @var{rc_buffer_size}
3399 @item @var{rc_initial_buffer_occupancy}
3400 @item @var{rc_max_rate}
3401 Change these value to reset qsv codec's bitrate control configuration.
3403 @item @var{pic_timing_sei}
3404 Supported in h264_qsv and hevc_qsv.
3405 Change this value to reset qsv codec's pic_timing_sei configuration.
3408 @subsection H264 options
3409 These options are used by h264_qsv
3413 Extended bitrate control.
3415 @item @var{recovery_point_sei}
3416 Set this flag to insert the recovery point SEI message at the beginning of every
3417 intra refresh cycle.
3420 Enable rate distortion optimization.
3422 @item @var{max_frame_size}
3423 Maximum encoded frame size in bytes.
3425 @item @var{max_frame_size_i}
3426 Maximum encoded frame size for I frames in bytes. If this value is set as larger
3427 than zero, then for I frames the value set by max_frame_size is ignored.
3429 @item @var{max_frame_size_p}
3430 Maximum encoded frame size for P frames in bytes. If this value is set as larger
3431 than zero, then for P frames the value set by max_frame_size is ignored.
3433 @item @var{max_slice_size}
3434 Maximum encoded slice size in bytes.
3436 @item @var{bitrate_limit}
3437 Toggle bitrate limitations.
3438 Modifies bitrate to be in the range imposed by the QSV encoder. Setting this
3439 flag off may lead to violation of HRD conformance. Mind that specifying bitrate
3440 below the QSV encoder range might significantly affect quality. If on this
3441 option takes effect in non CQP modes: if bitrate is not in the range imposed
3442 by the QSV encoder, it will be changed to be in the range.
3445 Setting this flag enables macroblock level bitrate control that generally
3446 improves subjective visual quality. Enabling this flag may have negative impact
3447 on performance and objective visual quality metric.
3449 @item @var{low_delay_brc}
3450 Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
3451 more accurate bitrate control to minimize the variance of bitstream size frame
3452 by frame. Value: -1-default 0-off 1-on
3454 @item @var{adaptive_i}
3455 This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
3456 to allow changing of frame type from P and B to I.
3458 @item @var{adaptive_b}
3459 This flag controls changing of frame type from B to P.
3461 @item @var{p_strategy}
3462 Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
3464 @item @var{b_strategy}
3465 This option controls usage of B frames as reference.
3467 @item @var{dblk_idc}
3468 This option disable deblocking. It has value in range 0~2.
3471 If set, CAVLC is used; if unset, CABAC is used for encoding.
3474 Video conferencing mode, please see ratecontrol method.
3476 @item @var{idr_interval}
3477 Distance (in I-frames) between IDR frames.
3479 @item @var{pic_timing_sei}
3480 Insert picture timing SEI with pic_struct_syntax element.
3482 @item @var{single_sei_nal_unit}
3483 Put all the SEI messages into one NALU.
3485 @item @var{max_dec_frame_buffering}
3486 Maximum number of frames buffered in the DPB.
3488 @item @var{look_ahead}
3489 Use VBR algorithm with look ahead.
3491 @item @var{look_ahead_depth}
3492 Depth of look ahead in number frames.
3494 @item @var{look_ahead_downsampling}
3495 Downscaling factor for the frames saved for the lookahead analysis.
3504 @item @var{int_ref_type}
3505 Specifies intra refresh type. The major goal of intra refresh is improvement of
3506 error resilience without significant impact on encoded bitstream size caused by
3507 I frames. The SDK encoder achieves this by encoding part of each frame in
3508 refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means
3509 vertical refresh, by column of MBs. @var{horizontal} means horizontal refresh,
3510 by rows of MBs. @var{slice} means horizontal refresh by slices without
3511 overlapping. In case of @var{slice}, in_ref_cycle_size is ignored. To enable
3512 intra refresh, B frame should be set to 0.
3514 @item @var{int_ref_cycle_size}
3515 Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
3518 @item @var{int_ref_qp_delta}
3519 Specifies QP difference for inserted intra MBs. This is signed value in
3520 [-51, 51] range if target encoding bit-depth for luma samples is 8 and this
3521 range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
3523 @item @var{int_ref_cycle_dist}
3524 Distance between the beginnings of the intra-refresh cycles in frames.
3535 Use A53 Closed Captions (if available).
3538 Insert the Access Unit Delimiter NAL.
3547 @item @var{repeat_pps}
3548 Repeat pps for every frame.
3550 @item @var{max_qp_i}
3551 Maximum video quantizer scale for I frame.
3553 @item @var{min_qp_i}
3554 Minimum video quantizer scale for I frame.
3556 @item @var{max_qp_p}
3557 Maximum video quantizer scale for P frame.
3559 @item @var{min_qp_p}
3560 Minimum video quantizer scale for P frame.
3562 @item @var{max_qp_b}
3563 Maximum video quantizer scale for B frame.
3565 @item @var{min_qp_b}
3566 Minimum video quantizer scale for B frame.
3568 @item @var{scenario}
3569 Provides a hint to encoder about the scenario for the encoding session.
3572 @item displayremoting
3573 @item videoconference
3577 @item videosurveillance
3582 @item @var{avbr_accuracy}
3583 Accuracy of the AVBR ratecontrol (unit of tenth of percent).
3585 @item @var{avbr_convergence}
3586 Convergence of the AVBR ratecontrol (unit of 100 frames)
3588 The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the
3589 average variable bitrate control (AVBR) algorithm.
3590 The algorithm focuses on overall encoding quality while meeting the specified
3591 bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy},
3592 after a @var{avbr_Convergence} period. This method does not follow HRD and the
3593 instant bitrate is not capped or padded.
3595 @item @var{skip_frame}
3596 Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option
3597 defines the usage of this metadata.
3600 Frame skipping is disabled.
3602 Encoder inserts into bitstream frame where all macroblocks are encoded as
3604 @item insert_nothing
3605 Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped
3606 frames are still used in brc. For example, gop still include skipped frames, and
3607 the frames after skipped frames will be larger in size.
3609 skip_frame metadata indicates the number of missed frames before the current
3615 @subsection HEVC Options
3616 These options are used by hevc_qsv
3620 Extended bitrate control.
3622 @item @var{recovery_point_sei}
3623 Set this flag to insert the recovery point SEI message at the beginning of every
3624 intra refresh cycle.
3627 Enable rate distortion optimization.
3629 @item @var{max_frame_size}
3630 Maximum encoded frame size in bytes.
3632 @item @var{max_frame_size_i}
3633 Maximum encoded frame size for I frames in bytes. If this value is set as larger
3634 than zero, then for I frames the value set by max_frame_size is ignored.
3636 @item @var{max_frame_size_p}
3637 Maximum encoded frame size for P frames in bytes. If this value is set as larger
3638 than zero, then for P frames the value set by max_frame_size is ignored.
3640 @item @var{max_slice_size}
3641 Maximum encoded slice size in bytes.
3644 Setting this flag enables macroblock level bitrate control that generally
3645 improves subjective visual quality. Enabling this flag may have negative impact
3646 on performance and objective visual quality metric.
3648 @item @var{low_delay_brc}
3649 Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
3650 more accurate bitrate control to minimize the variance of bitstream size frame
3651 by frame. Value: -1-default 0-off 1-on
3653 @item @var{adaptive_i}
3654 This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
3655 to allow changing of frame type from P and B to I.
3657 @item @var{adaptive_b}
3658 This flag controls changing of frame type from B to P.
3660 @item @var{p_strategy}
3661 Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
3663 @item @var{b_strategy}
3664 This option controls usage of B frames as reference.
3666 @item @var{dblk_idc}
3667 This option disable deblocking. It has value in range 0~2.
3669 @item @var{idr_interval}
3670 Distance (in I-frames) between IDR frames.
3673 Output an IDR-frame only at the beginning of the stream.
3676 @item @var{load_plugin}
3677 A user plugin to load in an internal session.
3684 @item @var{load_plugins}
3685 A :-separate list of hexadecimal plugin UIDs to load in
3686 an internal session.
3688 @item @var{look_ahead_depth}
3689 Depth of look ahead in number frames, available when extbrc option is enabled.
3692 Set the encoding profile (scc requires libmfx >= 1.32).
3704 Set the encoding tier (only level >= 4 can support high tier).
3705 This option only takes effect when the level option is specified.
3713 1: GPB (generalized P/B frame)
3717 @item @var{tile_cols}
3718 Number of columns for tiled encoding.
3720 @item @var{tile_rows}
3721 Number of rows for tiled encoding.
3724 Insert the Access Unit Delimiter NAL.
3726 @item @var{pic_timing_sei}
3727 Insert picture timing SEI with pic_struct_syntax element.
3729 @item @var{transform_skip}
3730 Turn this option ON to enable transformskip. It is supported on platform equal
3733 @item @var{int_ref_type}
3734 Specifies intra refresh type. The major goal of intra refresh is improvement of
3735 error resilience without significant impact on encoded bitstream size caused by
3736 I frames. The SDK encoder achieves this by encoding part of each frame in
3737 refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means
3738 vertical refresh, by column of MBs. @var{horizontal} means horizontal refresh,
3739 by rows of MBs. @var{slice} means horizontal refresh by slices without
3740 overlapping. In case of @var{slice}, in_ref_cycle_size is ignored. To enable
3741 intra refresh, B frame should be set to 0.
3743 @item @var{int_ref_cycle_size}
3744 Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
3747 @item @var{int_ref_qp_delta}
3748 Specifies QP difference for inserted intra MBs. This is signed value in
3749 [-51, 51] range if target encoding bit-depth for luma samples is 8 and this
3750 range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
3752 @item @var{int_ref_cycle_dist}
3753 Distance between the beginnings of the intra-refresh cycles in frames.
3755 @item @var{max_qp_i}
3756 Maximum video quantizer scale for I frame.
3758 @item @var{min_qp_i}
3759 Minimum video quantizer scale for I frame.
3761 @item @var{max_qp_p}
3762 Maximum video quantizer scale for P frame.
3764 @item @var{min_qp_p}
3765 Minimum video quantizer scale for P frame.
3767 @item @var{max_qp_b}
3768 Maximum video quantizer scale for B frame.
3770 @item @var{min_qp_b}
3771 Minimum video quantizer scale for B frame.
3773 @item @var{scenario}
3774 Provides a hint to encoder about the scenario for the encoding session.
3777 @item displayremoting
3778 @item videoconference
3782 @item videosurveillance
3787 @item @var{avbr_accuracy}
3788 Accuracy of the AVBR ratecontrol (unit of tenth of percent).
3790 @item @var{avbr_convergence}
3791 Convergence of the AVBR ratecontrol (unit of 100 frames)
3793 The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the
3794 average variable bitrate control (AVBR) algorithm.
3795 The algorithm focuses on overall encoding quality while meeting the specified
3796 bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy},
3797 after a @var{avbr_Convergence} period. This method does not follow HRD and the
3798 instant bitrate is not capped or padded.
3800 @item @var{skip_frame}
3801 Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option
3802 defines the usage of this metadata.
3805 Frame skipping is disabled.
3807 Encoder inserts into bitstream frame where all macroblocks are encoded as
3809 @item insert_nothing
3810 Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped
3811 frames are still used in brc. For example, gop still include skipped frames, and
3812 the frames after skipped frames will be larger in size.
3814 skip_frame metadata indicates the number of missed frames before the current
3820 @subsection MPEG2 Options
3821 These options are used by mpeg2_qsv
3832 @subsection VP9 Options
3833 These options are used by vp9_qsv
3844 @item @var{tile_cols}
3845 Number of columns for tiled encoding (requires libmfx >= 1.29).
3847 @item @var{tile_rows}
3848 Number of rows for tiled encoding (requires libmfx >= 1.29).
3851 @subsection AV1 Options
3852 These options are used by av1_qsv (requires libvpl).
3860 @item @var{tile_cols}
3861 Number of columns for tiled encoding.
3863 @item @var{tile_rows}
3864 Number of rows for tiled encoding.
3866 @item @var{adaptive_i}
3867 This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
3868 to allow changing of frame type from P and B to I.
3870 @item @var{adaptive_b}
3871 This flag controls changing of frame type from B to P.
3873 @item @var{b_strategy}
3874 This option controls usage of B frames as reference.
3877 Extended bitrate control.
3879 @item @var{look_ahead_depth}
3880 Depth of look ahead in number frames, available when extbrc option is enabled.
3882 @item @var{low_delay_brc}
3883 Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
3884 more accurate bitrate control to minimize the variance of bitstream size frame
3885 by frame. Value: -1-default 0-off 1-on
3887 @item max_frame_size
3888 Set the allowed max size in bytes for each frame. If the frame size exceeds
3889 the limitation, encoder will adjust the QP value to control the frame size.
3890 Invalid in CQP rate control mode.
3898 @item iterative_dia_size
3899 dia size for the iterative motion estimation
3902 @section VAAPI encoders
3904 Wrappers for hardware encoders accessible via VAAPI.
3906 These encoders only accept input in VAAPI hardware surfaces. If you have input
3907 in software frames, use the @option{hwupload} filter to upload them to the GPU.
3909 The following standard libavcodec options are used:
3912 @option{g} / @option{gop_size}
3914 @option{bf} / @option{max_b_frames}
3918 If not set, this will be determined automatically from the format of the input
3919 frames and the profiles supported by the driver.
3923 @option{b} / @option{bit_rate}
3925 @option{maxrate} / @option{rc_max_rate}
3927 @option{bufsize} / @option{rc_buffer_size}
3929 @option{rc_init_occupancy} / @option{rc_initial_buffer_occupancy}
3931 @option{compression_level}
3933 Speed / quality tradeoff: higher values are faster / worse quality.
3935 @option{q} / @option{global_quality}
3937 Size / quality tradeoff: higher values are smaller / worse quality.
3943 @option{i_qfactor} / @option{i_quant_factor}
3945 @option{i_qoffset} / @option{i_quant_offset}
3947 @option{b_qfactor} / @option{b_quant_factor}
3949 @option{b_qoffset} / @option{b_quant_offset}
3954 All encoders support the following options:
3957 Some drivers/platforms offer a second encoder for some codecs intended to use
3958 less power than the default encoder; setting this option will attempt to use
3959 that encoder. Note that it may support a reduced feature set, so some other
3960 options may not be available in this mode.
3963 Set the number of normal intra frames between full-refresh (IDR) frames in
3964 open-GOP mode. The intra frames are still IRAPs, but will not include global
3965 headers and may have non-decodable leading pictures.
3968 Set the B-frame reference depth. When set to one (the default), all B-frames
3969 will refer only to P- or I-frames. When set to greater values multiple layers
3970 of B-frames will be present, frames in each layer only referring to frames in
3974 Maximum processing parallelism. Increase this to improve single channel
3975 performance. This option doesn't work if driver doesn't implement vaSyncBuffer
3976 function. Please make sure there are enough hw_frames allocated if a large
3977 number of async_depth is used.
3979 @item max_frame_size
3980 Set the allowed max size in bytes for each frame. If the frame size exceeds
3981 the limitation, encoder will adjust the QP value to control the frame size.
3982 Invalid in CQP rate control mode.
3985 Set the rate control mode to use. A given driver may only support a subset of
3991 Choose the mode automatically based on driver support and the other options.
3992 This is the default.
4000 Intelligent constant-quality.
4002 Quality-defined variable-bitrate.
4004 Average variable bitrate.
4009 Each encoder also has its own specific options:
4013 @option{profile} sets the value of @emph{seq_profile}.
4014 @option{tier} sets the value of @emph{seq_tier}.
4015 @option{level} sets the value of @emph{seq_level_idx}.
4019 Set the number of tiles to encode the input video with, as columns x rows.
4020 (default is auto, which means use minimal tile column/row number).
4022 Set tile groups number. All the tiles will be distributed as evenly as possible to
4023 each tile group. (default is 1).
4027 @option{profile} sets the value of @emph{profile_idc} and the @emph{constraint_set*_flag}s.
4028 @option{level} sets the value of @emph{level_idc}.
4032 Set entropy encoder (default is @emph{cabac}). Possible values:
4045 Include access unit delimiters in the stream (not included by default).
4048 Set SEI message types to include.
4049 Some combination of the following values:
4052 Include a @emph{user_data_unregistered} message containing information about
4055 Include picture timing parameters (@emph{buffering_period} and
4056 @emph{pic_timing} messages).
4057 @item recovery_point
4058 Include recovery points where appropriate (@emph{recovery_point} messages).
4064 @option{profile} and @option{level} set the values of
4065 @emph{general_profile_idc} and @emph{general_level_idc} respectively.
4069 Include access unit delimiters in the stream (not included by default).
4072 Set @emph{general_tier_flag}. This may affect the level chosen for the stream
4073 if it is not explicitly specified.
4076 Set SEI message types to include.
4077 Some combination of the following values:
4080 Include HDR metadata if the input frames have it
4081 (@emph{mastering_display_colour_volume} and @emph{content_light_level}
4086 Set the number of tiles to encode the input video with, as columns x rows.
4087 Larger numbers allow greater parallelism in both encoding and decoding, but
4088 may decrease coding efficiency.
4093 Only baseline DCT encoding is supported. The encoder always uses the standard
4094 quantisation and huffman tables - @option{global_quality} scales the standard
4095 quantisation table (range 1-100).
4097 For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
4098 supported, and will create an RGB JPEG.
4102 Include JFIF header in each frame (not included by default).
4104 Include standard huffman tables (on by default). Turning this off will save
4105 a few hundred bytes in each output frame, but may lose compatibility with some
4106 JPEG decoders which don't fully handle MJPEG.
4110 @option{profile} and @option{level} set the value of @emph{profile_and_level_indication}.
4113 B-frames are not supported.
4115 @option{global_quality} sets the @emph{q_idx} used for non-key frames (range 0-127).
4118 @item loop_filter_level
4119 @item loop_filter_sharpness
4120 Manually set the loop filter parameters.
4124 @option{global_quality} sets the @emph{q_idx} used for P-frames (range 0-255).
4127 @item loop_filter_level
4128 @item loop_filter_sharpness
4129 Manually set the loop filter parameters.
4132 B-frames are supported, but the output stream is always in encode order rather than display
4133 order. If B-frames are enabled, it may be necessary to use the @option{vp9_raw_reorder}
4134 bitstream filter to modify the output stream to display frames in the correct order.
4136 Only normal frames are produced - the @option{vp9_superframe} bitstream filter may be
4137 required to produce a stream usable with all decoders.
4143 Vizrt Binary Image encoder.
4145 This format is used by the broadcast vendor Vizrt for quick texture streaming.
4146 Advanced features of the format such as LZW compression of texture data or
4147 generation of mipmaps are not supported.
4152 @item format @var{string}
4153 Sets the texture compression used by the VBN file. Can be @var{dxt1},
4154 @var{dxt5} or @var{raw}. Default is @var{dxt5}.
4159 SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
4160 professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
4161 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
4162 other tasks which require low overhead and low compression (like screen
4170 Sets target video bitrate. Usually that's around 1:6 of the uncompressed
4171 video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
4172 values (close to the uncompressed bitrate) turn on lossless compression mode.
4175 Enables field coding when set (e.g. to tt - top field first) for interlaced
4176 inputs. Should increase compression with interlaced content as it splits the
4177 fields and encodes each separately.
4180 Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
4181 Lower values reduce compression and quality. Less capable decoders may not be
4182 able to handle values of @option{wavelet_depth} over 3.
4185 Sets the transform type. Currently only @var{5_3} (LeGall) and @var{9_7}
4187 are implemented, with 9_7 being the one with better compression and thus
4192 Sets the slice size for each slice. Larger values result in better compression.
4193 For compatibility with other more limited decoders use @option{slice_width} of
4194 32 and @option{slice_height} of 8.
4197 Sets the undershoot tolerance of the rate control system in percent. This is
4198 to prevent an expensive search from being run.
4201 Sets the quantization matrix preset to use by default or when @option{wavelet_depth}
4206 Uses the default quantization matrix from the specifications, extended with
4207 values for the fifth level. This provides a good balance between keeping detail
4208 and omitting artifacts.
4212 Use a completely zeroed out quantization matrix. This increases PSNR but might
4213 reduce perception. Use in bogus benchmarks.
4217 Reduces detail but attempts to preserve color at extremely low bitrates.
4222 @c man end VIDEO ENCODERS
4224 @chapter Subtitles Encoders
4225 @c man begin SUBTITLES ENCODERS
4229 This codec encodes the bitmap subtitle format that is used in DVDs.
4230 Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
4231 and they can also be used in Matroska files.
4237 Specify the global palette used by the bitmaps.
4239 The format for this option is a string containing 16 24-bits hexadecimal
4240 numbers (without 0x prefix) separated by commas, for example @code{0d00ee,
4241 ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
4242 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
4245 When set to 1, enable a work-around that makes the number of pixel rows
4246 even in all subtitles. This fixes a problem with some players that
4247 cut off the bottom row if the number is odd. The work-around just adds
4248 a fully transparent row if needed. The overhead is low, typically
4249 one byte per subtitle on average.
4251 By default, this work-around is disabled.
4254 @c man end SUBTITLES ENCODERS