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}.
423 @subsection Option Mapping
425 The following options are supported by the libmp3lame wrapper,
426 the LAME-equivalent options follow the FFmpeg ones.
428 @multitable @columnfractions .2 .2
429 @item FFmpeg @tab LAME
431 Set bitrate expressed in bits/s, LAME @code{bitrate} is expressed in
434 Set quality setting for VBR.
435 @item compression_level @tab q
436 Set algorithm quality. Valid arguments are integers in the 0-9 range.
437 @item reservoir @tab N.A.
438 Enable use of bit reservoir. LAME has this enabled by default.
439 @item joint_stereo @tab -m j
440 Enable the encoder to use (on a frame by frame basis) either L/R
441 stereo or mid/side stereo.
444 @section libopencore-amrnb
446 OpenCORE Adaptive Multi-Rate Narrowband encoder.
448 Requires the presence of the libopencore-amrnb headers and library during
449 configuration. You need to explicitly configure the build with
450 @code{--enable-libopencore-amrnb --enable-version3}.
452 This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
453 but you can override it by setting @option{strict} to @samp{unofficial} or
461 Set bitrate in bits per second. Only the following bitrates are supported,
462 otherwise libavcodec will round to the nearest valid bitrate.
476 Allow discontinuous transmission (generate comfort noise) when set to 1. The
477 default value is 0 (disabled).
483 TwoLAME MP2 encoder wrapper.
485 Requires the presence of the libtwolame headers and library during
486 configuration. You need to explicitly configure the build with
487 @code{--enable-libtwolame}.
489 @subsection Options Mapping
491 The following options are supported by the libtwolame wrapper. The
492 TwoLAME-equivalent options follow the FFmpeg ones and are in
497 (b) Set bitrate in bits/s. Note that FFmpeg @code{b} option is
498 expressed in bits/s, twolame @code{b} in kilobits/s. The default
502 (V) Set quality for experimental VBR support. Maximum value range is
503 from -50 to 50, useful range is from -10 to 10.
506 (mode) Set MPEG mode. Possible values:
510 Choose mode automatically based on the input. This is the default.
522 (psyc-mode) Set psychoacoustic model to use in encoding. The argument
523 must be an integer between -1 and 4, inclusive. The higher the value,
524 the better the quality. The default value is 3.
527 (energy) Enable energy levels extensions when set to 1. The default
528 value is 0 (disabled).
530 @item error_protection
531 (protect) Enable CRC error protection when set to 1. The default value
535 (copyright) Set MPEG audio copyright flag when set to 1. The default
536 value is 0 (disabled).
539 (original) Set MPEG audio original flag when set to 1. The default
540 value is 0 (disabled).
544 @section libvo-aacenc
546 VisualOn AAC encoder.
548 Requires the presence of the libvo-aacenc headers and library during
549 configuration. You need to explicitly configure the build with
550 @code{--enable-libvo-aacenc --enable-version3}.
554 The VisualOn AAC encoder only support encoding AAC-LC and up to 2
555 channels. It is also CBR-only. It is considered to be worse than the
556 native experimental FFmpeg AAC encoder.
565 @section libvo-amrwbenc
567 VisualOn Adaptive Multi-Rate Wideband encoder.
569 Requires the presence of the libvo-amrwbenc headers and library during
570 configuration. You need to explicitly configure the build with
571 @code{--enable-libvo-amrwbenc --enable-version3}.
573 This is a mono-only encoder. Officially it only supports 16000Hz sample
574 rate, but you can override it by setting @option{strict} to
575 @samp{unofficial} or lower.
582 Set bitrate in bits/s. Only the following bitrates are supported, otherwise
583 libavcodec will round to the nearest valid bitrate.
598 Allow discontinuous transmission (generate comfort noise) when set to 1. The
599 default value is 0 (disabled).
605 libopus Opus Interactive Audio Codec encoder wrapper.
607 Requires the presence of the libopus headers and library during
608 configuration. You need to explicitly configure the build with
609 @code{--enable-libopus}.
611 @subsection Option Mapping
613 Most libopus options are modeled after the @command{opusenc} utility from
614 opus-tools. The following is an option mapping chart describing options
615 supported by the libopus wrapper, and their @command{opusenc}-equivalent
620 @item b (@emph{bitrate})
621 Set the bit rate in bits/s. FFmpeg's @option{b} option is
622 expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
625 @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
626 Set VBR mode. The FFmpeg @option{vbr} option has the following
627 valid arguments, with the their @command{opusenc} equivalent options
631 @item off (@emph{hard-cbr})
632 Use constant bit rate encoding.
634 @item on (@emph{vbr})
635 Use variable bit rate encoding (the default).
637 @item constrained (@emph{cvbr})
638 Use constrained variable bit rate encoding.
641 @item compression_level (@emph{comp})
642 Set encoding algorithm complexity. Valid options are integers in
643 the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
644 gives the highest quality but slowest encoding. The default is 10.
646 @item frame_duration (@emph{framesize})
647 Set maximum frame size, or duration of a frame in milliseconds. The
648 argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
649 frame sizes achieve lower latency but less quality at a given bitrate.
650 Sizes greater than 20ms are only interesting at fairly low bitrates.
651 The default of FFmpeg is 10ms, but is 20ms in @command{opusenc}.
653 @item packet_loss (@emph{expect-loss})
654 Set expected packet loss percentage. The default is 0.
656 @item application (N.A.)
657 Set intended application type. Valid options are listed below:
661 Favor improved speech intelligibility.
663 Favor faithfulness to the input (the default).
665 Restrict to only the lowest delay modes.
669 Set cutoff bandwidth in Hz. The argument must be exactly one of the
670 following: 4000, 6000, 8000, 12000, or 20000, corresponding to
671 narrowband, mediumband, wideband, super wideband, and fullband
672 respectively. The default is 0 (cutoff disabled).
678 A wrapper providing WavPack encoding through libwavpack.
680 Only lossless mode using 32-bit integer samples is supported currently.
681 The @option{compression_level} option can be used to control speed vs.
682 compression tradeoff, with the values mapped to libwavpack as follows:
687 Fast mode - corresponding to the wavpack @option{-f} option.
690 Normal (default) settings.
693 High quality - corresponding to the wavpack @option{-h} option.
696 Very high quality - corresponding to the wavpack @option{-hh} option.
699 Same as 3, but with extra processing enabled - corresponding to the wavpack
700 @option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
705 @c man end AUDIO ENCODERS
707 @chapter Video Encoders
708 @c man begin VIDEO ENCODERS
710 A description of some of the currently available video encoders
715 Theora format supported through libtheora.
717 Requires the presence of the libtheora headers and library during
718 configuration. You need to explicitly configure the build with
719 @code{--enable-libtheora}.
723 The following global options are mapped to internal libtheora options
724 which affect the quality and the bitrate of the encoded stream.
728 Set the video bitrate, only works if the @code{qscale} flag in
729 @option{flags} is not enabled.
732 Used to enable constant quality mode encoding through the
733 @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
740 Set the global quality in lambda units, only works if the
741 @code{qscale} flag in @option{flags} is enabled. The value is clipped
742 in the [0 - 10*@code{FF_QP2LAMBDA}] range, and then multiplied for 6.3
743 to get a value in the native libtheora range [0-63]. A higher value
744 corresponds to a higher quality.
746 For example, to set maximum constant quality encoding with
749 ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
755 VP8 format supported through libvpx.
757 Requires the presence of the libvpx headers and library during configuration.
758 You need to explicitly configure the build with @code{--enable-libvpx}.
762 Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
789 @code{(bufsize * 1000 / vb)}
792 @code{(bufsize * 1000 / vb * 5 / 6)}
794 @item rc_init_occupancy, vb
796 @code{(rc_init_occupancy * 1000 / vb)}
798 @item rc_buffer_aggressivity
805 rc_2pass_vbr_bias_pct
808 rc_2pass_vbr_maxsection_pct
809 @code{(maxrate * 100 / vb)}
812 rc_2pass_vbr_minsection_pct
813 @code{(minrate * 100 / vb)}
815 @item minrate, maxrate, vb
817 @code{(minrate == maxrate == vb)}
820 @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
825 @code{VPX_DL_BEST_QUALITY}
827 @code{VPX_DL_GOOD_QUALITY}
829 @code{VPX_DL_REALTIME}
833 @code{VP8E_SET_CPUUSED}
836 @code{VP8E_SET_NOISE_SENSITIVITY}
839 @code{VP8E_SET_STATIC_THRESHOLD}
842 @code{VP8E_SET_TOKEN_PARTITIONS}
845 @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
847 @item force_key_frames
848 @code{VPX_EFLAG_FORCE_KF}
850 @item Alternate reference frame related
852 @item vp8flags altref
853 @code{VP8E_SET_ENABLEAUTOALTREF}
854 @item @var{arnr_max_frames}
855 @code{VP8E_SET_ARNR_MAXFRAMES}
856 @item @var{arnr_type}
857 @code{VP8E_SET_ARNR_TYPE}
858 @item @var{arnr_strength}
859 @code{VP8E_SET_ARNR_STRENGTH}
860 @item @var{rc_lookahead}
864 @item vp8flags error_resilient
869 For more information about libvpx see:
870 @url{http://www.webmproject.org/}
874 x264 H.264/MPEG-4 AVC encoder wrapper.
876 This encoder requires the presence of the libx264 headers and library
877 during configuration. You need to explicitly configure the build with
878 @code{--enable-libx264}.
880 libx264 supports an impressive number of features, including 8x8 and
881 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
882 entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
883 for detail retention (adaptive quantization, psy-RD, psy-trellis).
885 Many libx264 encoder options are mapped to FFmpeg global codec
886 options, while unique encoder options are provided through private
887 options. Additionally the @option{x264opts} and @option{x264-params}
888 private options allows to pass a list of key=value tuples as accepted
889 by the libx264 @code{x264_param_parse} function.
891 The x264 project website is at
892 @url{http://www.videolan.org/developers/x264.html}.
896 The following options are supported by the libx264 wrapper. The
897 @command{x264}-equivalent options or values are listed in parentheses
900 To reduce the duplication of documentation, only the private options
901 and some others requiring special attention are documented here. For
902 the documentation of the undocumented generic options, see
903 @ref{codec-options,,the Codec Options chapter}.
905 To get a more accurate and extensive documentation of the libx264
906 options, invoke the command @command{x264 --full-help} or consult
907 the libx264 documentation.
910 @item b (@emph{bitrate})
911 Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
912 expressed in bits/s, while @command{x264}'s @option{bitrate} is in
915 @item bf (@emph{bframes})
917 @item g (@emph{keyint})
919 @item qmax (@emph{qpmax})
921 @item qmin (@emph{qpmin})
923 @item qdiff (@emph{qpstep})
925 @item qblur (@emph{qblur})
927 @item qcomp (@emph{qcomp})
929 @item refs (@emph{ref})
931 @item sc_threshold (@emph{scenecut})
933 @item trellis (@emph{trellis})
937 @item me_range (@emph{merange})
939 @item me_method (@emph{me})
940 Set motion estimation method. Possible values in the decreasing order
944 @item dia (@emph{dia})
945 @item epzs (@emph{dia})
946 Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
948 @item hex (@emph{hex})
949 Hexagonal search with radius 2.
950 @item umh (@emph{umh})
951 Uneven multi-hexagon search.
952 @item esa (@emph{esa})
954 @item tesa (@emph{tesa})
955 Hadamard exhaustive search (slowest).
958 @item subq (@emph{subme})
960 @item b_strategy (@emph{b-adapt})
962 @item keyint_min (@emph{min-keyint})
965 Set entropy encoder. Possible values:
972 Enable CAVLC and disable CABAC. It generates the same effect as
973 @command{x264}'s @option{--no-cabac} option.
977 Set full pixel motion estimation comparation algorithm. Possible values:
981 Enable chroma in motion estimation.
984 Ignore chroma in motion estimation. It generates the same effect as
985 @command{x264}'s @option{--no-chroma-me} option.
988 @item threads (@emph{threads})
991 Set multithreading technique. Possible values:
995 Slice-based multithreading. It generates the same effect as
996 @command{x264}'s @option{--sliced-threads} option.
998 Frame-based multithreading.
1002 Set encoding flags. It can be used to disable closed GOP and enable
1003 open GOP by setting it to @code{-cgop}. The result is similar to
1004 the behavior of @command{x264}'s @option{--open-gop} option.
1006 @item rc_init_occupancy (@emph{vbv-init})
1008 @item preset (@emph{preset})
1009 Set the encoding preset.
1011 @item tune (@emph{tune})
1012 Set tuning of the encoding params.
1014 @item profile (@emph{profile})
1015 Set profile restrictions.
1018 Enable fast settings when encoding first pass, when set to 1. When set
1019 to 0, it has the same effect of @command{x264}'s
1020 @option{--slow-firstpass} option.
1022 @item crf (@emph{crf})
1023 Set the quality for constant quality mode.
1025 @item crf_max (@emph{crf-max})
1026 In CRF mode, prevents VBV from lowering quality beyond this point.
1028 @item qp (@emph{qp})
1029 Set constant quantization rate control method parameter.
1031 @item aq-mode (@emph{aq-mode})
1032 Set AQ method. Possible values:
1035 @item none (@emph{0})
1038 @item variance (@emph{1})
1039 Variance AQ (complexity mask).
1041 @item autovariance (@emph{2})
1042 Auto-variance AQ (experimental).
1045 @item aq-strength (@emph{aq-strength})
1046 Set AQ strength, reduce blocking and blurring in flat and textured areas.
1049 Use psychovisual optimizations when set to 1. When set to 0, it has the
1050 same effect as @command{x264}'s @option{--no-psy} option.
1052 @item psy-rd (@emph{psy-rd})
1053 Set strength of psychovisual optimization, in
1054 @var{psy-rd}:@var{psy-trellis} format.
1056 @item rc-lookahead (@emph{rc-lookahead})
1057 Set number of frames to look ahead for frametype and ratecontrol.
1060 Enable weighted prediction for B-frames when set to 1. When set to 0,
1061 it has the same effect as @command{x264}'s @option{--no-weightb} option.
1063 @item weightp (@emph{weightp})
1064 Set weighted prediction method for P-frames. Possible values:
1067 @item none (@emph{0})
1069 @item simple (@emph{1})
1070 Enable only weighted refs
1071 @item smart (@emph{2})
1072 Enable both weighted refs and duplicates
1075 @item ssim (@emph{ssim})
1076 Enable calculation and printing SSIM stats after the encoding.
1078 @item intra-refresh (@emph{intra-refresh})
1079 Enable the use of Periodic Intra Refresh instead of IDR frames when set
1082 @item bluray-compat (@emph{bluray-compat})
1083 Configure the encoder to be compatible with the bluray standard.
1084 It is a shorthand for setting "bluray-compat=1 force-cfr=1".
1086 @item b-bias (@emph{b-bias})
1087 Set the influence on how often B-frames are used.
1089 @item b-pyramid (@emph{b-pyramid})
1090 Set method for keeping of some B-frames as references. Possible values:
1093 @item none (@emph{none})
1095 @item strict (@emph{strict})
1096 Strictly hierarchical pyramid.
1097 @item normal (@emph{normal})
1098 Non-strict (not Blu-ray compatible).
1102 Enable the use of one reference per partition, as opposed to one
1103 reference per macroblock when set to 1. When set to 0, it has the
1104 same effect as @command{x264}'s @option{--no-mixed-refs} option.
1107 Enable adaptive spatial transform (high profile 8x8 transform)
1108 when set to 1. When set to 0, it has the same effect as
1109 @command{x264}'s @option{--no-8x8dct} option.
1112 Enable early SKIP detection on P-frames when set to 1. When set
1113 to 0, it has the same effect as @command{x264}'s
1114 @option{--no-fast-pskip} option.
1116 @item aud (@emph{aud})
1117 Enable use of access unit delimiters when set to 1.
1120 Enable use macroblock tree ratecontrol when set to 1. When set
1121 to 0, it has the same effect as @command{x264}'s
1122 @option{--no-mbtree} option.
1124 @item deblock (@emph{deblock})
1125 Set loop filter parameters, in @var{alpha}:@var{beta} form.
1127 @item cplxblur (@emph{cplxblur})
1128 Set fluctuations reduction in QP (before curve compression).
1130 @item partitions (@emph{partitions})
1131 Set partitions to consider as a comma-separated list of. Possible
1136 8x8 P-frame partition.
1138 4x4 P-frame partition.
1140 4x4 B-frame partition.
1142 8x8 I-frame partition.
1144 4x4 I-frame partition.
1145 (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
1146 @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
1147 option) to be enabled.)
1148 @item none (@emph{none})
1149 Do not consider any partitions.
1150 @item all (@emph{all})
1151 Consider every partition.
1154 @item direct-pred (@emph{direct})
1155 Set direct MV prediction mode. Possible values:
1158 @item none (@emph{none})
1159 Disable MV prediction.
1160 @item spatial (@emph{spatial})
1161 Enable spatial predicting.
1162 @item temporal (@emph{temporal})
1163 Enable temporal predicting.
1164 @item auto (@emph{auto})
1165 Automatically decided.
1168 @item slice-max-size (@emph{slice-max-size})
1169 Set the limit of the size of each slice in bytes. If not specified
1170 but RTP payload size (@option{ps}) is specified, that is used.
1172 @item stats (@emph{stats})
1173 Set the file name for multi-pass stats.
1175 @item nal-hrd (@emph{nal-hrd})
1176 Set signal HRD information (requires @option{vbv-bufsize} to be set).
1180 @item none (@emph{none})
1181 Disable HRD information signaling.
1182 @item vbr (@emph{vbr})
1184 @item cbr (@emph{cbr})
1185 Constant bit rate (not allowed in MP4 container).
1188 @item x264opts (N.A.)
1189 Set any x264 option, see @command{x264 --fullhelp} for a list.
1191 Argument is a list of @var{key}=@var{value} couples separated by
1192 ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
1193 themselves, use "," instead. They accept it as well since long ago but this
1194 is kept undocumented for some reason.
1196 For example to specify libx264 encoding options with @command{ffmpeg}:
1198 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
1201 @item x264-params (N.A.)
1202 Override the x264 configuration using a :-separated list of key=value
1205 This option is functionally the same as the @option{x264opts}, but is
1206 duplicated for compability with the Libav fork.
1208 For example to specify libx264 encoding options with @command{ffmpeg}:
1210 ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
1211 cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
1212 no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
1216 Encoding ffpresets for common usages are provided so they can be used with the
1217 general presets system (e.g. passing the @option{pre} option).
1221 Xvid MPEG-4 Part 2 encoder wrapper.
1223 This encoder requires the presence of the libxvidcore headers and library
1224 during configuration. You need to explicitly configure the build with
1225 @code{--enable-libxvid --enable-gpl}.
1227 The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
1228 users can encode to this format without this library.
1232 The following options are supported by the libxvid wrapper. Some of
1233 the following options are listed but are not documented, and
1234 correspond to shared codec options. See @ref{codec-options,,the Codec
1235 Options chapter} for their documentation. The other shared options
1236 which are not listed have no effect for the libxvid encoder.
1258 Set specific encoding flags. Possible values:
1263 Use four motion vector by macroblock.
1266 Enable high quality AC prediction.
1269 Only encode grayscale.
1272 Enable the use of global motion compensation (GMC).
1275 Enable quarter-pixel motion compensation.
1281 Place global headers in extradata instead of every keyframe.
1288 Set motion estimation method. Possible values in decreasing order of
1289 speed and increasing order of quality:
1293 Use no motion estimation (default).
1298 Enable advanced diamond zonal search for 16x16 blocks and half-pixel
1299 refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
1303 Enable all of the things described above, plus advanced diamond zonal
1304 search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
1305 estimation on chroma planes.
1308 Enable all of the things described above, plus extended 16x16 and 8x8
1313 Set macroblock decision algorithm. Possible values in the increasing
1318 Use macroblock comparing function algorithm (default).
1321 Enable rate distortion-based half pixel and quarter pixel refinement for
1325 Enable all of the things described above, plus rate distortion-based
1326 half pixel and quarter pixel refinement for 8x8 blocks, and rate
1327 distortion-based search using square pattern.
1331 Enable lumi masking adaptive quantization when set to 1. Default is 0
1335 Enable variance adaptive quantization when set to 1. Default is 0
1338 When combined with @option{lumi_aq}, the resulting quality will not
1339 be better than any of the two specified individually. In other
1340 words, the resulting quality will be the worse one of the two
1344 Set structural similarity (SSIM) displaying method. Possible values:
1348 Disable displaying of SSIM information.
1351 Output average SSIM at the end of encoding to stdout. The format of
1352 showing the average SSIM is:
1358 For users who are not familiar with C, %f means a float number, or
1359 a decimal (e.g. 0.939232).
1362 Output both per-frame SSIM data during encoding and average SSIM at
1363 the end of encoding to stdout. The format of per-frame information
1367 SSIM: avg: %1.3f min: %1.3f max: %1.3f
1370 For users who are not familiar with C, %1.3f means a float number
1371 rounded to 3 digits after the dot (e.g. 0.932).
1376 Set SSIM accuracy. Valid options are integers within the range of
1377 0-4, while 0 gives the most accurate result and 4 computes the
1386 @subsection Private options
1389 @item dpi @var{integer}
1390 Set physical density of pixels, in dots per inch, unset by default
1391 @item dpm @var{integer}
1392 Set physical density of pixels, in dots per meter, unset by default
1397 Apple ProRes encoder.
1399 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
1400 The used encoder can be choosen with the @code{-vcodec} option.
1402 @subsection Private Options for prores-ks
1405 @item profile @var{integer}
1406 Select the ProRes profile to encode
1415 @item quant_mat @var{integer}
1416 Select quantization matrix.
1425 If set to @var{auto}, the matrix matching the profile will be picked.
1426 If not set, the matrix providing the highest quality, @var{default}, will be
1429 @item bits_per_mb @var{integer}
1430 How many bits to allot for coding one macroblock. Different profiles use
1431 between 200 and 2400 bits per macroblock, the maximum is 8000.
1433 @item mbs_per_slice @var{integer}
1434 Number of macroblocks in each slice (1-8); the default value (8)
1435 should be good in almost all situations.
1437 @item vendor @var{string}
1438 Override the 4-byte vendor ID.
1439 A custom vendor ID like @var{apl0} would claim the stream was produced by
1442 @item alpha_bits @var{integer}
1443 Specify number of bits for alpha component.
1444 Possible values are @var{0}, @var{8} and @var{16}.
1445 Use @var{0} to disable alpha plane coding.
1449 @subsection Speed considerations
1451 In the default mode of operation the encoder has to honor frame constraints
1452 (i.e. not produc frames with size bigger than requested) while still making
1453 output picture as good as possible.
1454 A frame containing a lot of small details is harder to compress and the encoder
1455 would spend more time searching for appropriate quantizers for each slice.
1457 Setting a higher @option{bits_per_mb} limit will improve the speed.
1459 For the fastest encoding speed set the @option{qscale} parameter (4 is the
1460 recommended value) and do not set a size constraint.
1462 @c man end VIDEO ENCODERS