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{-codecs} 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
28 @section ac3 and ac3_fixed
32 These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
33 the undocumented RealAudio 3 (a.k.a. dnet).
35 The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
36 encoder only uses fixed-point integer math. This does not mean that one is
37 always faster, just that one or the other may be better suited to a
38 particular system. The floating-point encoder will generally produce better
39 quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
40 default codec for any of the output formats, so it must be specified explicitly
41 using the option @code{-acodec ac3_fixed} in order to use it.
43 @subsection AC-3 Metadata
45 The AC-3 metadata options are used to set parameters that describe the audio,
46 but in most cases do not affect the audio encoding itself. Some of the options
47 do directly affect or influence the decoding and playback of the resulting
48 bitstream, while others are just for informational purposes. A few of the
49 options will add bits to the output stream that could otherwise be used for
50 audio data, and will thus affect the quality of the output. Those will be
51 indicated accordingly with a note in the option list below.
53 These parameters are described in detail in several publicly-available
56 @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
57 @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}
58 @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
59 @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
62 @subsubsection Metadata Control Options
66 @item -per_frame_metadata @var{boolean}
67 Allow Per-Frame Metadata. Specifies if the encoder should check for changing
68 metadata for each frame.
71 The metadata values set at initialization will be used for every frame in the
74 Metadata values can be changed before encoding each frame.
79 @subsubsection Downmix Levels
83 @item -center_mixlev @var{level}
84 Center Mix Level. The amount of gain the decoder should apply to the center
85 channel when downmixing to stereo. This field will only be written to the
86 bitstream if a center channel is present. The value is specified as a scale
87 factor. There are 3 valid values:
92 Apply -4.5dB gain (default)
97 @item -surround_mixlev @var{level}
98 Surround Mix Level. The amount of gain the decoder should apply to the surround
99 channel(s) when downmixing to stereo. This field will only be written to the
100 bitstream if one or more surround channels are present. The value is specified
101 as a scale factor. There are 3 valid values:
106 Apply -6dB gain (default)
108 Silence Surround Channel(s)
113 @subsubsection Audio Production Information
114 Audio Production Information is optional information describing the mixing
115 environment. Either none or both of the fields are written to the bitstream.
119 @item -mixing_level @var{number}
120 Mixing Level. Specifies peak sound pressure level (SPL) in the production
121 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
122 unknown or not indicated. The default value is -1, but that value cannot be
123 used if the Audio Production Information is written to the bitstream. Therefore,
124 if the @code{room_type} option is not the default value, the @code{mixing_level}
125 option must not be -1.
127 @item -room_type @var{type}
128 Room Type. Describes the equalization used during the final mixing session at
129 the studio or on the dubbing stage. A large room is a dubbing stage with the
130 industry standard X-curve equalization; a small room has flat equalization.
131 This field will not be written to the bitstream if both the @code{mixing_level}
132 option and the @code{room_type} option have the default values.
136 Not Indicated (default)
147 @subsubsection Other Metadata Options
151 @item -copyright @var{boolean}
152 Copyright Indicator. Specifies whether a copyright exists for this audio.
156 No Copyright Exists (default)
162 @item -dialnorm @var{value}
163 Dialogue Normalization. Indicates how far the average dialogue level of the
164 program is below digital 100% full scale (0 dBFS). This parameter determines a
165 level shift during audio reproduction that sets the average volume of the
166 dialogue to a preset level. The goal is to match volume level between program
167 sources. A value of -31dB will result in no volume level change, relative to
168 the source volume, during audio reproduction. Valid values are whole numbers in
169 the range -31 to -1, with -31 being the default.
171 @item -dsur_mode @var{mode}
172 Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
173 (Pro Logic). This field will only be written to the bitstream if the audio
174 stream is stereo. Using this option does @b{NOT} mean the encoder will actually
175 apply Dolby Surround processing.
179 Not Indicated (default)
182 Not Dolby Surround Encoded
185 Dolby Surround Encoded
188 @item -original @var{boolean}
189 Original Bit Stream Indicator. Specifies whether this audio is from the
190 original source and not a copy.
197 Original Source (default)
202 @subsection Extended Bitstream Information
203 The extended bitstream options are part of the Alternate Bit Stream Syntax as
204 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
205 If any one parameter in a group is specified, all values in that group will be
206 written to the bitstream. Default values are used for those that are written
207 but have not been specified. If the mixing levels are written, the decoder
208 will use these values instead of the ones specified in the @code{center_mixlev}
209 and @code{surround_mixlev} options if it supports the Alternate Bit Stream
212 @subsubsection Extended Bitstream Information - Part 1
216 @item -dmix_mode @var{mode}
217 Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
218 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
222 Not Indicated (default)
225 Lt/Rt Downmix Preferred
228 Lo/Ro Downmix Preferred
231 @item -ltrt_cmixlev @var{level}
232 Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
233 center channel when downmixing to stereo in Lt/Rt mode.
246 Apply -4.5dB gain (default)
250 Silence Center Channel
253 @item -ltrt_surmixlev @var{level}
254 Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
255 surround channel(s) when downmixing to stereo in Lt/Rt mode.
264 Apply -6.0dB gain (default)
266 Silence Surround Channel(s)
269 @item -loro_cmixlev @var{level}
270 Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
271 center channel when downmixing to stereo in Lo/Ro mode.
284 Apply -4.5dB gain (default)
288 Silence Center Channel
291 @item -loro_surmixlev @var{level}
292 Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
293 surround channel(s) when downmixing to stereo in Lo/Ro mode.
302 Apply -6.0dB gain (default)
304 Silence Surround Channel(s)
309 @subsubsection Extended Bitstream Information - Part 2
313 @item -dsurex_mode @var{mode}
314 Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
315 (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
316 apply Dolby Surround EX processing.
320 Not Indicated (default)
323 Dolby Surround EX Off
329 @item -dheadphone_mode @var{mode}
330 Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
331 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
332 option does @b{NOT} mean the encoder will actually apply Dolby Headphone
337 Not Indicated (default)
346 @item -ad_conv_type @var{type}
347 A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
352 Standard A/D Converter (default)
360 @subsection Other AC-3 Encoding Options
364 @item -stereo_rematrixing @var{boolean}
365 Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
366 is an optional AC-3 feature that increases quality by selectively encoding
367 the left/right channels as mid/side. This option is enabled by default, and it
368 is highly recommended that it be left as enabled except for testing purposes.
372 @subsection Floating-Point-Only AC-3 Encoding Options
374 These options are only valid for the floating-point encoder and do not exist
375 for the fixed-point encoder due to the corresponding features not being
376 implemented in fixed-point.
380 @item -channel_coupling @var{boolean}
381 Enables/Disables use of channel coupling, which is an optional AC-3 feature
382 that increases quality by combining high frequency information from multiple
383 channels into a single channel. The per-channel high frequency information is
384 sent with less accuracy in both the frequency and time domains. This allows
385 more bits to be used for lower frequencies while preserving enough information
386 to reconstruct the high frequencies. This option is enabled by default for the
387 floating-point encoder and should generally be left as enabled except for
388 testing purposes or to increase encoding speed.
392 Selected by Encoder (default)
395 Disable Channel Coupling
398 Enable Channel Coupling
401 @item -cpl_start_band @var{number}
402 Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
403 value higher than the bandwidth is used, it will be reduced to 1 less than the
404 coupling end band. If @var{auto} is used, the start band will be determined by
405 the encoder based on the bit rate, sample rate, and channel layout. This option
406 has no effect if channel coupling is disabled.
410 Selected by Encoder (default)
417 LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
419 Requires the presence of the libmp3lame headers and library during
420 configuration. You need to explicitly configure the build with
421 @code{--enable-libmp3lame}.
425 The following options are supported by the libmp3lame wrapper. The
426 @command{lame}-equivalent of the options are listed in parentheses.
430 Set bitrate expressed in bits/s for CBR. LAME @code{bitrate} is
431 expressed in kilobits/s.
434 Set constant quality setting for VBR. This option is valid only
435 using the @command{ffmpeg} command-line tool. For library interface
436 users, use @option{global_quality}.
438 @item compression_level (@emph{-q})
439 Set algorithm quality. Valid arguments are integers in the 0-9 range,
440 with 0 meaning highest quality but slowest, and 9 meaning fastest
441 while producing the worst quality.
444 Enable use of bit reservoir when set to 1. Default value is 1. LAME
445 has this enabled by default, but can be overriden by use
446 @option{--nores} option.
448 @item joint_stereo (@emph{-m j})
449 Enable the encoder to use (on a frame by frame basis) either L/R
450 stereo or mid/side stereo. Default value is 1.
454 @section libopencore-amrnb
456 OpenCORE Adaptive Multi-Rate Narrowband encoder.
458 Requires the presence of the libopencore-amrnb headers and library during
459 configuration. You need to explicitly configure the build with
460 @code{--enable-libopencore-amrnb --enable-version3}.
462 This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
463 but you can override it by setting @option{strict} to @samp{unofficial} or
471 Set bitrate in bits per second. Only the following bitrates are supported,
472 otherwise libavcodec will round to the nearest valid bitrate.
486 Allow discontinuous transmission (generate comfort noise) when set to 1. The
487 default value is 0 (disabled).
493 TwoLAME MP2 encoder wrapper.
495 Requires the presence of the libtwolame headers and library during
496 configuration. You need to explicitly configure the build with
497 @code{--enable-libtwolame}.
501 The following options are supported by the libtwolame wrapper. The
502 @command{twolame}-equivalent options follow the FFmpeg ones and are in
507 Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
508 option is expressed in kilobits/s. Default value is 128k.
511 Set quality for experimental VBR support. Maximum value range is
512 from -50 to 50, useful range is from -10 to 10. The higher the
513 value, the better the quality. This option is valid only using the
514 @command{ffmpeg} command-line tool. For library interface users,
515 use @option{global_quality}.
517 @item mode (@emph{--mode})
518 Set the mode of the resulting audio. Possible values:
522 Choose mode automatically based on the input. This is the default.
533 @item psymodel (@emph{--psyc-mode})
534 Set psychoacoustic model to use in encoding. The argument must be
535 an integer between -1 and 4, inclusive. The higher the value, the
536 better the quality. The default value is 3.
538 @item energy_levels (@emph{--energy})
539 Enable energy levels extensions when set to 1. The default value is
542 @item error_protection (@emph{--protect})
543 Enable CRC error protection when set to 1. The default value is 0
546 @item copyright (@emph{--copyright})
547 Set MPEG audio copyright flag when set to 1. The default value is 0
550 @item original (@emph{--original})
551 Set MPEG audio original flag when set to 1. The default value is 0
556 @section libvo-aacenc
558 VisualOn AAC encoder.
560 Requires the presence of the libvo-aacenc headers and library during
561 configuration. You need to explicitly configure the build with
562 @code{--enable-libvo-aacenc --enable-version3}.
566 The VisualOn AAC encoder only support encoding AAC-LC and up to 2
567 channels. It is also CBR-only. It is considered to be worse than the
568 native experimental FFmpeg AAC encoder.
577 @section libvo-amrwbenc
579 VisualOn Adaptive Multi-Rate Wideband encoder.
581 Requires the presence of the libvo-amrwbenc headers and library during
582 configuration. You need to explicitly configure the build with
583 @code{--enable-libvo-amrwbenc --enable-version3}.
585 This is a mono-only encoder. Officially it only supports 16000Hz sample
586 rate, but you can override it by setting @option{strict} to
587 @samp{unofficial} or lower.
594 Set bitrate in bits/s. Only the following bitrates are supported, otherwise
595 libavcodec will round to the nearest valid bitrate.
610 Allow discontinuous transmission (generate comfort noise) when set to 1. The
611 default value is 0 (disabled).
617 libopus Opus Interactive Audio Codec encoder wrapper.
619 Requires the presence of the libopus headers and library during
620 configuration. You need to explicitly configure the build with
621 @code{--enable-libopus}.
623 @subsection Option Mapping
625 Most libopus options are modeled after the @command{opusenc} utility from
626 opus-tools. The following is an option mapping chart describing options
627 supported by the libopus wrapper, and their @command{opusenc}-equivalent
632 @item b (@emph{bitrate})
633 Set the bit rate in bits/s. FFmpeg's @option{b} option is
634 expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
637 @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
638 Set VBR mode. The FFmpeg @option{vbr} option has the following
639 valid arguments, with the their @command{opusenc} equivalent options
643 @item off (@emph{hard-cbr})
644 Use constant bit rate encoding.
646 @item on (@emph{vbr})
647 Use variable bit rate encoding (the default).
649 @item constrained (@emph{cvbr})
650 Use constrained variable bit rate encoding.
653 @item compression_level (@emph{comp})
654 Set encoding algorithm complexity. Valid options are integers in
655 the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
656 gives the highest quality but slowest encoding. The default is 10.
658 @item frame_duration (@emph{framesize})
659 Set maximum frame size, or duration of a frame in milliseconds. The
660 argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
661 frame sizes achieve lower latency but less quality at a given bitrate.
662 Sizes greater than 20ms are only interesting at fairly low bitrates.
663 The default of FFmpeg is 10ms, but is 20ms in @command{opusenc}.
665 @item packet_loss (@emph{expect-loss})
666 Set expected packet loss percentage. The default is 0.
668 @item application (N.A.)
669 Set intended application type. Valid options are listed below:
673 Favor improved speech intelligibility.
675 Favor faithfulness to the input (the default).
677 Restrict to only the lowest delay modes.
681 Set cutoff bandwidth in Hz. The argument must be exactly one of the
682 following: 4000, 6000, 8000, 12000, or 20000, corresponding to
683 narrowband, mediumband, wideband, super wideband, and fullband
684 respectively. The default is 0 (cutoff disabled).
690 A wrapper providing WavPack encoding through libwavpack.
692 Only lossless mode using 32-bit integer samples is supported currently.
693 The @option{compression_level} option can be used to control speed vs.
694 compression tradeoff, with the values mapped to libwavpack as follows:
699 Fast mode - corresponding to the wavpack @option{-f} option.
702 Normal (default) settings.
705 High quality - corresponding to the wavpack @option{-h} option.
708 Very high quality - corresponding to the wavpack @option{-hh} option.
711 Same as 3, but with extra processing enabled - corresponding to the wavpack
712 @option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
717 @c man end AUDIO ENCODERS
719 @chapter Video Encoders
720 @c man begin VIDEO ENCODERS
722 A description of some of the currently available video encoders
727 Theora format supported through libtheora.
729 Requires the presence of the libtheora headers and library during
730 configuration. You need to explicitly configure the build with
731 @code{--enable-libtheora}.
735 The following global options are mapped to internal libtheora options
736 which affect the quality and the bitrate of the encoded stream.
740 Set the video bitrate, only works if the @code{qscale} flag in
741 @option{flags} is not enabled.
744 Used to enable constant quality mode encoding through the
745 @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
752 Set the global quality in lambda units, only works if the
753 @code{qscale} flag in @option{flags} is enabled. The value is clipped
754 in the [0 - 10*@code{FF_QP2LAMBDA}] range, and then multiplied for 6.3
755 to get a value in the native libtheora range [0-63]. A higher value
756 corresponds to a higher quality.
758 For example, to set maximum constant quality encoding with
761 ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
767 VP8 format supported through libvpx.
769 Requires the presence of the libvpx headers and library during configuration.
770 You need to explicitly configure the build with @code{--enable-libvpx}.
774 Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
801 @code{(bufsize * 1000 / vb)}
804 @code{(bufsize * 1000 / vb * 5 / 6)}
806 @item rc_init_occupancy, vb
808 @code{(rc_init_occupancy * 1000 / vb)}
810 @item rc_buffer_aggressivity
817 rc_2pass_vbr_bias_pct
820 rc_2pass_vbr_maxsection_pct
821 @code{(maxrate * 100 / vb)}
824 rc_2pass_vbr_minsection_pct
825 @code{(minrate * 100 / vb)}
827 @item minrate, maxrate, vb
829 @code{(minrate == maxrate == vb)}
832 @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
837 @code{VPX_DL_BEST_QUALITY}
839 @code{VPX_DL_GOOD_QUALITY}
841 @code{VPX_DL_REALTIME}
845 @code{VP8E_SET_CPUUSED}
848 @code{VP8E_SET_NOISE_SENSITIVITY}
851 @code{VP8E_SET_STATIC_THRESHOLD}
854 @code{VP8E_SET_TOKEN_PARTITIONS}
857 @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
859 @item force_key_frames
860 @code{VPX_EFLAG_FORCE_KF}
862 @item Alternate reference frame related
864 @item vp8flags altref
865 @code{VP8E_SET_ENABLEAUTOALTREF}
866 @item @var{arnr_max_frames}
867 @code{VP8E_SET_ARNR_MAXFRAMES}
868 @item @var{arnr_type}
869 @code{VP8E_SET_ARNR_TYPE}
870 @item @var{arnr_strength}
871 @code{VP8E_SET_ARNR_STRENGTH}
872 @item @var{rc_lookahead}
876 @item vp8flags error_resilient
881 For more information about libvpx see:
882 @url{http://www.webmproject.org/}
886 x264 H.264/MPEG-4 AVC encoder wrapper.
888 This encoder requires the presence of the libx264 headers and library
889 during configuration. You need to explicitly configure the build with
890 @code{--enable-libx264}.
892 libx264 supports an impressive number of features, including 8x8 and
893 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
894 entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
895 for detail retention (adaptive quantization, psy-RD, psy-trellis).
897 Many libx264 encoder options are mapped to FFmpeg global codec
898 options, while unique encoder options are provided through private
899 options. Additionally the @option{x264opts} and @option{x264-params}
900 private options allows to pass a list of key=value tuples as accepted
901 by the libx264 @code{x264_param_parse} function.
903 The x264 project website is at
904 @url{http://www.videolan.org/developers/x264.html}.
908 The following options are supported by the libx264 wrapper. The
909 @command{x264}-equivalent options or values are listed in parentheses
912 To reduce the duplication of documentation, only the private options
913 and some others requiring special attention are documented here. For
914 the documentation of the undocumented generic options, see
915 @ref{codec-options,,the Codec Options chapter}.
917 To get a more accurate and extensive documentation of the libx264
918 options, invoke the command @command{x264 --full-help} or consult
919 the libx264 documentation.
922 @item b (@emph{bitrate})
923 Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
924 expressed in bits/s, while @command{x264}'s @option{bitrate} is in
927 @item bf (@emph{bframes})
929 @item g (@emph{keyint})
931 @item qmax (@emph{qpmax})
933 @item qmin (@emph{qpmin})
935 @item qdiff (@emph{qpstep})
937 @item qblur (@emph{qblur})
939 @item qcomp (@emph{qcomp})
941 @item refs (@emph{ref})
943 @item sc_threshold (@emph{scenecut})
945 @item trellis (@emph{trellis})
949 @item me_range (@emph{merange})
951 @item me_method (@emph{me})
952 Set motion estimation method. Possible values in the decreasing order
956 @item dia (@emph{dia})
957 @item epzs (@emph{dia})
958 Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
960 @item hex (@emph{hex})
961 Hexagonal search with radius 2.
962 @item umh (@emph{umh})
963 Uneven multi-hexagon search.
964 @item esa (@emph{esa})
966 @item tesa (@emph{tesa})
967 Hadamard exhaustive search (slowest).
970 @item subq (@emph{subme})
972 @item b_strategy (@emph{b-adapt})
974 @item keyint_min (@emph{min-keyint})
977 Set entropy encoder. Possible values:
984 Enable CAVLC and disable CABAC. It generates the same effect as
985 @command{x264}'s @option{--no-cabac} option.
989 Set full pixel motion estimation comparation algorithm. Possible values:
993 Enable chroma in motion estimation.
996 Ignore chroma in motion estimation. It generates the same effect as
997 @command{x264}'s @option{--no-chroma-me} option.
1000 @item threads (@emph{threads})
1003 Set multithreading technique. Possible values:
1007 Slice-based multithreading. It generates the same effect as
1008 @command{x264}'s @option{--sliced-threads} option.
1010 Frame-based multithreading.
1014 Set encoding flags. It can be used to disable closed GOP and enable
1015 open GOP by setting it to @code{-cgop}. The result is similar to
1016 the behavior of @command{x264}'s @option{--open-gop} option.
1018 @item rc_init_occupancy (@emph{vbv-init})
1020 @item preset (@emph{preset})
1021 Set the encoding preset.
1023 @item tune (@emph{tune})
1024 Set tuning of the encoding params.
1026 @item profile (@emph{profile})
1027 Set profile restrictions.
1030 Enable fast settings when encoding first pass, when set to 1. When set
1031 to 0, it has the same effect of @command{x264}'s
1032 @option{--slow-firstpass} option.
1034 @item crf (@emph{crf})
1035 Set the quality for constant quality mode.
1037 @item crf_max (@emph{crf-max})
1038 In CRF mode, prevents VBV from lowering quality beyond this point.
1040 @item qp (@emph{qp})
1041 Set constant quantization rate control method parameter.
1043 @item aq-mode (@emph{aq-mode})
1044 Set AQ method. Possible values:
1047 @item none (@emph{0})
1050 @item variance (@emph{1})
1051 Variance AQ (complexity mask).
1053 @item autovariance (@emph{2})
1054 Auto-variance AQ (experimental).
1057 @item aq-strength (@emph{aq-strength})
1058 Set AQ strength, reduce blocking and blurring in flat and textured areas.
1061 Use psychovisual optimizations when set to 1. When set to 0, it has the
1062 same effect as @command{x264}'s @option{--no-psy} option.
1064 @item psy-rd (@emph{psy-rd})
1065 Set strength of psychovisual optimization, in
1066 @var{psy-rd}:@var{psy-trellis} format.
1068 @item rc-lookahead (@emph{rc-lookahead})
1069 Set number of frames to look ahead for frametype and ratecontrol.
1072 Enable weighted prediction for B-frames when set to 1. When set to 0,
1073 it has the same effect as @command{x264}'s @option{--no-weightb} option.
1075 @item weightp (@emph{weightp})
1076 Set weighted prediction method for P-frames. Possible values:
1079 @item none (@emph{0})
1081 @item simple (@emph{1})
1082 Enable only weighted refs
1083 @item smart (@emph{2})
1084 Enable both weighted refs and duplicates
1087 @item ssim (@emph{ssim})
1088 Enable calculation and printing SSIM stats after the encoding.
1090 @item intra-refresh (@emph{intra-refresh})
1091 Enable the use of Periodic Intra Refresh instead of IDR frames when set
1094 @item bluray-compat (@emph{bluray-compat})
1095 Configure the encoder to be compatible with the bluray standard.
1096 It is a shorthand for setting "bluray-compat=1 force-cfr=1".
1098 @item b-bias (@emph{b-bias})
1099 Set the influence on how often B-frames are used.
1101 @item b-pyramid (@emph{b-pyramid})
1102 Set method for keeping of some B-frames as references. Possible values:
1105 @item none (@emph{none})
1107 @item strict (@emph{strict})
1108 Strictly hierarchical pyramid.
1109 @item normal (@emph{normal})
1110 Non-strict (not Blu-ray compatible).
1114 Enable the use of one reference per partition, as opposed to one
1115 reference per macroblock when set to 1. When set to 0, it has the
1116 same effect as @command{x264}'s @option{--no-mixed-refs} option.
1119 Enable adaptive spatial transform (high profile 8x8 transform)
1120 when set to 1. When set to 0, it has the same effect as
1121 @command{x264}'s @option{--no-8x8dct} option.
1124 Enable early SKIP detection on P-frames when set to 1. When set
1125 to 0, it has the same effect as @command{x264}'s
1126 @option{--no-fast-pskip} option.
1128 @item aud (@emph{aud})
1129 Enable use of access unit delimiters when set to 1.
1132 Enable use macroblock tree ratecontrol when set to 1. When set
1133 to 0, it has the same effect as @command{x264}'s
1134 @option{--no-mbtree} option.
1136 @item deblock (@emph{deblock})
1137 Set loop filter parameters, in @var{alpha}:@var{beta} form.
1139 @item cplxblur (@emph{cplxblur})
1140 Set fluctuations reduction in QP (before curve compression).
1142 @item partitions (@emph{partitions})
1143 Set partitions to consider as a comma-separated list of. Possible
1148 8x8 P-frame partition.
1150 4x4 P-frame partition.
1152 4x4 B-frame partition.
1154 8x8 I-frame partition.
1156 4x4 I-frame partition.
1157 (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
1158 @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
1159 option) to be enabled.)
1160 @item none (@emph{none})
1161 Do not consider any partitions.
1162 @item all (@emph{all})
1163 Consider every partition.
1166 @item direct-pred (@emph{direct})
1167 Set direct MV prediction mode. Possible values:
1170 @item none (@emph{none})
1171 Disable MV prediction.
1172 @item spatial (@emph{spatial})
1173 Enable spatial predicting.
1174 @item temporal (@emph{temporal})
1175 Enable temporal predicting.
1176 @item auto (@emph{auto})
1177 Automatically decided.
1180 @item slice-max-size (@emph{slice-max-size})
1181 Set the limit of the size of each slice in bytes. If not specified
1182 but RTP payload size (@option{ps}) is specified, that is used.
1184 @item stats (@emph{stats})
1185 Set the file name for multi-pass stats.
1187 @item nal-hrd (@emph{nal-hrd})
1188 Set signal HRD information (requires @option{vbv-bufsize} to be set).
1192 @item none (@emph{none})
1193 Disable HRD information signaling.
1194 @item vbr (@emph{vbr})
1196 @item cbr (@emph{cbr})
1197 Constant bit rate (not allowed in MP4 container).
1200 @item x264opts (N.A.)
1201 Set any x264 option, see @command{x264 --fullhelp} for a list.
1203 Argument is a list of @var{key}=@var{value} couples separated by
1204 ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
1205 themselves, use "," instead. They accept it as well since long ago but this
1206 is kept undocumented for some reason.
1208 For example to specify libx264 encoding options with @command{ffmpeg}:
1210 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
1213 @item x264-params (N.A.)
1214 Override the x264 configuration using a :-separated list of key=value
1217 This option is functionally the same as the @option{x264opts}, but is
1218 duplicated for compability with the Libav fork.
1220 For example to specify libx264 encoding options with @command{ffmpeg}:
1222 ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
1223 cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
1224 no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
1228 Encoding ffpresets for common usages are provided so they can be used with the
1229 general presets system (e.g. passing the @option{pre} option).
1233 Xvid MPEG-4 Part 2 encoder wrapper.
1235 This encoder requires the presence of the libxvidcore headers and library
1236 during configuration. You need to explicitly configure the build with
1237 @code{--enable-libxvid --enable-gpl}.
1239 The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
1240 users can encode to this format without this library.
1244 The following options are supported by the libxvid wrapper. Some of
1245 the following options are listed but are not documented, and
1246 correspond to shared codec options. See @ref{codec-options,,the Codec
1247 Options chapter} for their documentation. The other shared options
1248 which are not listed have no effect for the libxvid encoder.
1270 Set specific encoding flags. Possible values:
1275 Use four motion vector by macroblock.
1278 Enable high quality AC prediction.
1281 Only encode grayscale.
1284 Enable the use of global motion compensation (GMC).
1287 Enable quarter-pixel motion compensation.
1293 Place global headers in extradata instead of every keyframe.
1300 Set motion estimation method. Possible values in decreasing order of
1301 speed and increasing order of quality:
1305 Use no motion estimation (default).
1310 Enable advanced diamond zonal search for 16x16 blocks and half-pixel
1311 refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
1315 Enable all of the things described above, plus advanced diamond zonal
1316 search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
1317 estimation on chroma planes.
1320 Enable all of the things described above, plus extended 16x16 and 8x8
1325 Set macroblock decision algorithm. Possible values in the increasing
1330 Use macroblock comparing function algorithm (default).
1333 Enable rate distortion-based half pixel and quarter pixel refinement for
1337 Enable all of the things described above, plus rate distortion-based
1338 half pixel and quarter pixel refinement for 8x8 blocks, and rate
1339 distortion-based search using square pattern.
1343 Enable lumi masking adaptive quantization when set to 1. Default is 0
1347 Enable variance adaptive quantization when set to 1. Default is 0
1350 When combined with @option{lumi_aq}, the resulting quality will not
1351 be better than any of the two specified individually. In other
1352 words, the resulting quality will be the worse one of the two
1356 Set structural similarity (SSIM) displaying method. Possible values:
1360 Disable displaying of SSIM information.
1363 Output average SSIM at the end of encoding to stdout. The format of
1364 showing the average SSIM is:
1370 For users who are not familiar with C, %f means a float number, or
1371 a decimal (e.g. 0.939232).
1374 Output both per-frame SSIM data during encoding and average SSIM at
1375 the end of encoding to stdout. The format of per-frame information
1379 SSIM: avg: %1.3f min: %1.3f max: %1.3f
1382 For users who are not familiar with C, %1.3f means a float number
1383 rounded to 3 digits after the dot (e.g. 0.932).
1388 Set SSIM accuracy. Valid options are integers within the range of
1389 0-4, while 0 gives the most accurate result and 4 computes the
1398 @subsection Private options
1401 @item dpi @var{integer}
1402 Set physical density of pixels, in dots per inch, unset by default
1403 @item dpm @var{integer}
1404 Set physical density of pixels, in dots per meter, unset by default
1409 Apple ProRes encoder.
1411 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
1412 The used encoder can be choosen with the @code{-vcodec} option.
1414 @subsection Private Options for prores-ks
1417 @item profile @var{integer}
1418 Select the ProRes profile to encode
1427 @item quant_mat @var{integer}
1428 Select quantization matrix.
1437 If set to @var{auto}, the matrix matching the profile will be picked.
1438 If not set, the matrix providing the highest quality, @var{default}, will be
1441 @item bits_per_mb @var{integer}
1442 How many bits to allot for coding one macroblock. Different profiles use
1443 between 200 and 2400 bits per macroblock, the maximum is 8000.
1445 @item mbs_per_slice @var{integer}
1446 Number of macroblocks in each slice (1-8); the default value (8)
1447 should be good in almost all situations.
1449 @item vendor @var{string}
1450 Override the 4-byte vendor ID.
1451 A custom vendor ID like @var{apl0} would claim the stream was produced by
1454 @item alpha_bits @var{integer}
1455 Specify number of bits for alpha component.
1456 Possible values are @var{0}, @var{8} and @var{16}.
1457 Use @var{0} to disable alpha plane coding.
1461 @subsection Speed considerations
1463 In the default mode of operation the encoder has to honor frame constraints
1464 (i.e. not produc frames with size bigger than requested) while still making
1465 output picture as good as possible.
1466 A frame containing a lot of small details is harder to compress and the encoder
1467 would spend more time searching for appropriate quantizers for each slice.
1469 Setting a higher @option{bits_per_mb} limit will improve the speed.
1471 For the fastest encoding speed set the @option{qscale} parameter (4 is the
1472 recommended value) and do not set a size constraint.
1474 @c man end VIDEO ENCODERS