]> git.sesse.net Git - ffmpeg/blob - doc/encoders.texi
Merge commit '38e15df1489d86c016515223ee693e7d0326c56a'
[ffmpeg] / doc / encoders.texi
1 @chapter Encoders
2 @c man begin ENCODERS
3
4 Encoders are configured elements in FFmpeg which allow the encoding of
5 multimedia streams.
6
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}.
11
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}}.
16
17 The option @code{-codecs} of the ff* tools will display the list of
18 enabled encoders.
19
20 @c man end ENCODERS
21
22 @chapter Audio Encoders
23 @c man begin AUDIO ENCODERS
24
25 A description of some of the currently available audio encoders
26 follows.
27
28 @anchor{aacenc}
29 @section aac
30
31 Advanced Audio Coding (AAC) encoder.
32
33 This encoder is an experimental FFmpeg-native AAC encoder. Currently only the
34 low complexity (AAC-LC) profile is supported. To use this encoder, you must set
35 @option{strict} option to @samp{experimental} or lower.
36
37 As this encoder is experimental, unexpected behavior may exist from time to
38 time. For a more stable AAC encoder, see @ref{libvo-aacenc}. However, be warned
39 that it has a worse quality reported by some users.
40
41 @c Comment this out until somebody writes the respective documentation.
42 @c See also @ref{libfaac}, @ref{libaacplus}, and @ref{libfdk-aac-enc}.
43
44 @subsection Options
45
46 @table @option
47 @item b
48 Set bit rate in bits/s. Setting this automatically activates constant bit rate
49 (CBR) mode.
50
51 @item q
52 Set quality for variable bit rate (VBR) mode. This option is valid only using
53 the @command{ffmpeg} command-line tool. For library interface users, use
54 @option{global_quality}.
55
56 @item stereo_mode
57 Set stereo encoding mode. Possible values:
58
59 @table @samp
60 @item auto
61 Automatically selected by the encoder.
62
63 @item ms_off
64 Disable middle/side encoding. This is the default.
65
66 @item ms_force
67 Force middle/side encoding.
68 @end table
69
70 @item aac_coder
71 Set AAC encoder coding method. Possible values:
72
73 @table @samp
74 @item faac
75 FAAC-inspired method.
76
77 This method is a simplified reimplementation of the method used in FAAC, which
78 sets thresholds proportional to the band energies, and then decreases all the
79 thresholds with quantizer steps to find the appropriate quantization with
80 distortion below threshold band by band.
81
82 The quality of this method is comparable to the two loop searching method
83 descibed below, but somewhat a little better and slower.
84
85 @item anmr
86 Average noise to mask ratio (ANMR) trellis-based solution.
87
88 This has a theoretic best quality out of all the coding methods, but at the
89 cost of the slowest speed.
90
91 @item twoloop
92 Two loop searching (TLS) method.
93
94 This method first sets quantizers depending on band thresholds and then tries
95 to find an optimal combination by adding or subtracting a specific value from
96 all quantizers and adjusting some individual quantizer a little.
97
98 This method produces similar quality with the FAAC method and is the default.
99
100 @item fast
101 Constant quantizer method.
102
103 This method sets a constant quantizer for all bands. This is the fastest of all
104 the methods, yet produces the worst quality.
105
106 @end table
107
108 @end table
109
110 @subsection Tips and Tricks
111
112 According to some reports
113 (e.g. @url{http://d.hatena.ne.jp/kamedo2/20120729/1343545890}), setting the
114 @option{cutoff} option to 15000 Hz greatly improves the quality of the output
115 quality. As a result, we encourage you to do the same.
116
117 @section ac3 and ac3_fixed
118
119 AC-3 audio encoders.
120
121 These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
122 the undocumented RealAudio 3 (a.k.a. dnet).
123
124 The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
125 encoder only uses fixed-point integer math. This does not mean that one is
126 always faster, just that one or the other may be better suited to a
127 particular system. The floating-point encoder will generally produce better
128 quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
129 default codec for any of the output formats, so it must be specified explicitly
130 using the option @code{-acodec ac3_fixed} in order to use it.
131
132 @subsection AC-3 Metadata
133
134 The AC-3 metadata options are used to set parameters that describe the audio,
135 but in most cases do not affect the audio encoding itself. Some of the options
136 do directly affect or influence the decoding and playback of the resulting
137 bitstream, while others are just for informational purposes. A few of the
138 options will add bits to the output stream that could otherwise be used for
139 audio data, and will thus affect the quality of the output. Those will be
140 indicated accordingly with a note in the option list below.
141
142 These parameters are described in detail in several publicly-available
143 documents.
144 @itemize
145 @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
146 @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}
147 @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
148 @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
149 @end itemize
150
151 @subsubsection Metadata Control Options
152
153 @table @option
154
155 @item -per_frame_metadata @var{boolean}
156 Allow Per-Frame Metadata. Specifies if the encoder should check for changing
157 metadata for each frame.
158 @table @option
159 @item 0
160 The metadata values set at initialization will be used for every frame in the
161 stream. (default)
162 @item 1
163 Metadata values can be changed before encoding each frame.
164 @end table
165
166 @end table
167
168 @subsubsection Downmix Levels
169
170 @table @option
171
172 @item -center_mixlev @var{level}
173 Center Mix Level. The amount of gain the decoder should apply to the center
174 channel when downmixing to stereo. This field will only be written to the
175 bitstream if a center channel is present. The value is specified as a scale
176 factor. There are 3 valid values:
177 @table @option
178 @item 0.707
179 Apply -3dB gain
180 @item 0.595
181 Apply -4.5dB gain (default)
182 @item 0.500
183 Apply -6dB gain
184 @end table
185
186 @item -surround_mixlev @var{level}
187 Surround Mix Level. The amount of gain the decoder should apply to the surround
188 channel(s) when downmixing to stereo. This field will only be written to the
189 bitstream if one or more surround channels are present. The value is specified
190 as a scale factor.  There are 3 valid values:
191 @table @option
192 @item 0.707
193 Apply -3dB gain
194 @item 0.500
195 Apply -6dB gain (default)
196 @item 0.000
197 Silence Surround Channel(s)
198 @end table
199
200 @end table
201
202 @subsubsection Audio Production Information
203 Audio Production Information is optional information describing the mixing
204 environment.  Either none or both of the fields are written to the bitstream.
205
206 @table @option
207
208 @item -mixing_level @var{number}
209 Mixing Level. Specifies peak sound pressure level (SPL) in the production
210 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
211 unknown or not indicated. The default value is -1, but that value cannot be
212 used if the Audio Production Information is written to the bitstream. Therefore,
213 if the @code{room_type} option is not the default value, the @code{mixing_level}
214 option must not be -1.
215
216 @item -room_type @var{type}
217 Room Type. Describes the equalization used during the final mixing session at
218 the studio or on the dubbing stage. A large room is a dubbing stage with the
219 industry standard X-curve equalization; a small room has flat equalization.
220 This field will not be written to the bitstream if both the @code{mixing_level}
221 option and the @code{room_type} option have the default values.
222 @table @option
223 @item 0
224 @itemx notindicated
225 Not Indicated (default)
226 @item 1
227 @itemx large
228 Large Room
229 @item 2
230 @itemx small
231 Small Room
232 @end table
233
234 @end table
235
236 @subsubsection Other Metadata Options
237
238 @table @option
239
240 @item -copyright @var{boolean}
241 Copyright Indicator. Specifies whether a copyright exists for this audio.
242 @table @option
243 @item 0
244 @itemx off
245 No Copyright Exists (default)
246 @item 1
247 @itemx on
248 Copyright Exists
249 @end table
250
251 @item -dialnorm @var{value}
252 Dialogue Normalization. Indicates how far the average dialogue level of the
253 program is below digital 100% full scale (0 dBFS). This parameter determines a
254 level shift during audio reproduction that sets the average volume of the
255 dialogue to a preset level. The goal is to match volume level between program
256 sources. A value of -31dB will result in no volume level change, relative to
257 the source volume, during audio reproduction. Valid values are whole numbers in
258 the range -31 to -1, with -31 being the default.
259
260 @item -dsur_mode @var{mode}
261 Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
262 (Pro Logic). This field will only be written to the bitstream if the audio
263 stream is stereo. Using this option does @b{NOT} mean the encoder will actually
264 apply Dolby Surround processing.
265 @table @option
266 @item 0
267 @itemx notindicated
268 Not Indicated (default)
269 @item 1
270 @itemx off
271 Not Dolby Surround Encoded
272 @item 2
273 @itemx on
274 Dolby Surround Encoded
275 @end table
276
277 @item -original @var{boolean}
278 Original Bit Stream Indicator. Specifies whether this audio is from the
279 original source and not a copy.
280 @table @option
281 @item 0
282 @itemx off
283 Not Original Source
284 @item 1
285 @itemx on
286 Original Source (default)
287 @end table
288
289 @end table
290
291 @subsection Extended Bitstream Information
292 The extended bitstream options are part of the Alternate Bit Stream Syntax as
293 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
294 If any one parameter in a group is specified, all values in that group will be
295 written to the bitstream.  Default values are used for those that are written
296 but have not been specified.  If the mixing levels are written, the decoder
297 will use these values instead of the ones specified in the @code{center_mixlev}
298 and @code{surround_mixlev} options if it supports the Alternate Bit Stream
299 Syntax.
300
301 @subsubsection Extended Bitstream Information - Part 1
302
303 @table @option
304
305 @item -dmix_mode @var{mode}
306 Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
307 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
308 @table @option
309 @item 0
310 @itemx notindicated
311 Not Indicated (default)
312 @item 1
313 @itemx ltrt
314 Lt/Rt Downmix Preferred
315 @item 2
316 @itemx loro
317 Lo/Ro Downmix Preferred
318 @end table
319
320 @item -ltrt_cmixlev @var{level}
321 Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
322 center channel when downmixing to stereo in Lt/Rt mode.
323 @table @option
324 @item 1.414
325 Apply +3dB gain
326 @item 1.189
327 Apply +1.5dB gain
328 @item 1.000
329 Apply 0dB gain
330 @item 0.841
331 Apply -1.5dB gain
332 @item 0.707
333 Apply -3.0dB gain
334 @item 0.595
335 Apply -4.5dB gain (default)
336 @item 0.500
337 Apply -6.0dB gain
338 @item 0.000
339 Silence Center Channel
340 @end table
341
342 @item -ltrt_surmixlev @var{level}
343 Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
344 surround channel(s) when downmixing to stereo in Lt/Rt mode.
345 @table @option
346 @item 0.841
347 Apply -1.5dB gain
348 @item 0.707
349 Apply -3.0dB gain
350 @item 0.595
351 Apply -4.5dB gain
352 @item 0.500
353 Apply -6.0dB gain (default)
354 @item 0.000
355 Silence Surround Channel(s)
356 @end table
357
358 @item -loro_cmixlev @var{level}
359 Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
360 center channel when downmixing to stereo in Lo/Ro mode.
361 @table @option
362 @item 1.414
363 Apply +3dB gain
364 @item 1.189
365 Apply +1.5dB gain
366 @item 1.000
367 Apply 0dB gain
368 @item 0.841
369 Apply -1.5dB gain
370 @item 0.707
371 Apply -3.0dB gain
372 @item 0.595
373 Apply -4.5dB gain (default)
374 @item 0.500
375 Apply -6.0dB gain
376 @item 0.000
377 Silence Center Channel
378 @end table
379
380 @item -loro_surmixlev @var{level}
381 Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
382 surround channel(s) when downmixing to stereo in Lo/Ro mode.
383 @table @option
384 @item 0.841
385 Apply -1.5dB gain
386 @item 0.707
387 Apply -3.0dB gain
388 @item 0.595
389 Apply -4.5dB gain
390 @item 0.500
391 Apply -6.0dB gain (default)
392 @item 0.000
393 Silence Surround Channel(s)
394 @end table
395
396 @end table
397
398 @subsubsection Extended Bitstream Information - Part 2
399
400 @table @option
401
402 @item -dsurex_mode @var{mode}
403 Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
404 (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
405 apply Dolby Surround EX processing.
406 @table @option
407 @item 0
408 @itemx notindicated
409 Not Indicated (default)
410 @item 1
411 @itemx on
412 Dolby Surround EX Off
413 @item 2
414 @itemx off
415 Dolby Surround EX On
416 @end table
417
418 @item -dheadphone_mode @var{mode}
419 Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
420 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
421 option does @b{NOT} mean the encoder will actually apply Dolby Headphone
422 processing.
423 @table @option
424 @item 0
425 @itemx notindicated
426 Not Indicated (default)
427 @item 1
428 @itemx on
429 Dolby Headphone Off
430 @item 2
431 @itemx off
432 Dolby Headphone On
433 @end table
434
435 @item -ad_conv_type @var{type}
436 A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
437 conversion.
438 @table @option
439 @item 0
440 @itemx standard
441 Standard A/D Converter (default)
442 @item 1
443 @itemx hdcd
444 HDCD A/D Converter
445 @end table
446
447 @end table
448
449 @subsection Other AC-3 Encoding Options
450
451 @table @option
452
453 @item -stereo_rematrixing @var{boolean}
454 Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
455 is an optional AC-3 feature that increases quality by selectively encoding
456 the left/right channels as mid/side. This option is enabled by default, and it
457 is highly recommended that it be left as enabled except for testing purposes.
458
459 @end table
460
461 @subsection Floating-Point-Only AC-3 Encoding Options
462
463 These options are only valid for the floating-point encoder and do not exist
464 for the fixed-point encoder due to the corresponding features not being
465 implemented in fixed-point.
466
467 @table @option
468
469 @item -channel_coupling @var{boolean}
470 Enables/Disables use of channel coupling, which is an optional AC-3 feature
471 that increases quality by combining high frequency information from multiple
472 channels into a single channel. The per-channel high frequency information is
473 sent with less accuracy in both the frequency and time domains. This allows
474 more bits to be used for lower frequencies while preserving enough information
475 to reconstruct the high frequencies. This option is enabled by default for the
476 floating-point encoder and should generally be left as enabled except for
477 testing purposes or to increase encoding speed.
478 @table @option
479 @item -1
480 @itemx auto
481 Selected by Encoder (default)
482 @item 0
483 @itemx off
484 Disable Channel Coupling
485 @item 1
486 @itemx on
487 Enable Channel Coupling
488 @end table
489
490 @item -cpl_start_band @var{number}
491 Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
492 value higher than the bandwidth is used, it will be reduced to 1 less than the
493 coupling end band. If @var{auto} is used, the start band will be determined by
494 the encoder based on the bit rate, sample rate, and channel layout. This option
495 has no effect if channel coupling is disabled.
496 @table @option
497 @item -1
498 @itemx auto
499 Selected by Encoder (default)
500 @end table
501
502 @end table
503
504 @section libmp3lame
505
506 LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
507
508 Requires the presence of the libmp3lame headers and library during
509 configuration. You need to explicitly configure the build with
510 @code{--enable-libmp3lame}.
511
512 @subsection Options
513
514 The following options are supported by the libmp3lame wrapper. The
515 @command{lame}-equivalent of the options are listed in parentheses.
516
517 @table @option
518 @item b (@emph{-b})
519 Set bitrate expressed in bits/s for CBR. LAME @code{bitrate} is
520 expressed in kilobits/s.
521
522 @item q (@emph{-V})
523 Set constant quality setting for VBR. This option is valid only
524 using the @command{ffmpeg} command-line tool. For library interface
525 users, use @option{global_quality}.
526
527 @item compression_level (@emph{-q})
528 Set algorithm quality. Valid arguments are integers in the 0-9 range,
529 with 0 meaning highest quality but slowest, and 9 meaning fastest
530 while producing the worst quality.
531
532 @item reservoir
533 Enable use of bit reservoir when set to 1. Default value is 1. LAME
534 has this enabled by default, but can be overriden by use
535 @option{--nores} option.
536
537 @item joint_stereo (@emph{-m j})
538 Enable the encoder to use (on a frame by frame basis) either L/R
539 stereo or mid/side stereo. Default value is 1.
540
541 @end table
542
543 @section libopencore-amrnb
544
545 OpenCORE Adaptive Multi-Rate Narrowband encoder.
546
547 Requires the presence of the libopencore-amrnb headers and library during
548 configuration. You need to explicitly configure the build with
549 @code{--enable-libopencore-amrnb --enable-version3}.
550
551 This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
552 but you can override it by setting @option{strict} to @samp{unofficial} or
553 lower.
554
555 @subsection Options
556
557 @table @option
558
559 @item b
560 Set bitrate in bits per second. Only the following bitrates are supported,
561 otherwise libavcodec will round to the nearest valid bitrate.
562
563 @table @option
564 @item 4750
565 @item 5150
566 @item 5900
567 @item 6700
568 @item 7400
569 @item 7950
570 @item 10200
571 @item 12200
572 @end table
573
574 @item dtx
575 Allow discontinuous transmission (generate comfort noise) when set to 1. The
576 default value is 0 (disabled).
577
578 @end table
579
580 @section libtwolame
581
582 TwoLAME MP2 encoder wrapper.
583
584 Requires the presence of the libtwolame headers and library during
585 configuration. You need to explicitly configure the build with
586 @code{--enable-libtwolame}.
587
588 @subsection Options
589
590 The following options are supported by the libtwolame wrapper. The
591 @command{twolame}-equivalent options follow the FFmpeg ones and are in
592 parentheses.
593
594 @table @option
595 @item b (@emph{-b})
596 Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
597 option is expressed in kilobits/s. Default value is 128k.
598
599 @item q (@emph{-V})
600 Set quality for experimental VBR support. Maximum value range is
601 from -50 to 50, useful range is from -10 to 10. The higher the
602 value, the better the quality. This option is valid only using the
603 @command{ffmpeg} command-line tool. For library interface users,
604 use @option{global_quality}.
605
606 @item mode (@emph{--mode})
607 Set the mode of the resulting audio. Possible values:
608
609 @table @samp
610 @item auto
611 Choose mode automatically based on the input. This is the default.
612 @item stereo
613 Stereo
614 @item joint_stereo
615 Joint stereo
616 @item dual_channel
617 Dual channel
618 @item mono
619 Mono
620 @end table
621
622 @item psymodel (@emph{--psyc-mode})
623 Set psychoacoustic model to use in encoding. The argument must be
624 an integer between -1 and 4, inclusive. The higher the value, the
625 better the quality. The default value is 3.
626
627 @item energy_levels (@emph{--energy})
628 Enable energy levels extensions when set to 1. The default value is
629 0 (disabled).
630
631 @item error_protection (@emph{--protect})
632 Enable CRC error protection when set to 1. The default value is 0
633 (disabled).
634
635 @item copyright (@emph{--copyright})
636 Set MPEG audio copyright flag when set to 1. The default value is 0
637 (disabled).
638
639 @item original (@emph{--original})
640 Set MPEG audio original flag when set to 1. The default value is 0
641 (disabled).
642
643 @end table
644
645 @anchor{libvo-aacenc}
646 @section libvo-aacenc
647
648 VisualOn AAC encoder.
649
650 Requires the presence of the libvo-aacenc headers and library during
651 configuration. You need to explicitly configure the build with
652 @code{--enable-libvo-aacenc --enable-version3}.
653
654 This encoder is considered to be worse than the
655 @ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
656 multiple sources.
657
658 @subsection Options
659
660 The VisualOn AAC encoder only support encoding AAC-LC and up to 2
661 channels. It is also CBR-only.
662
663 @table @option
664
665 @item b
666 Set bit rate in bits/s.
667
668 @end table
669
670 @section libvo-amrwbenc
671
672 VisualOn Adaptive Multi-Rate Wideband encoder.
673
674 Requires the presence of the libvo-amrwbenc headers and library during
675 configuration. You need to explicitly configure the build with
676 @code{--enable-libvo-amrwbenc --enable-version3}.
677
678 This is a mono-only encoder. Officially it only supports 16000Hz sample
679 rate, but you can override it by setting @option{strict} to
680 @samp{unofficial} or lower.
681
682 @subsection Options
683
684 @table @option
685
686 @item b
687 Set bitrate in bits/s. Only the following bitrates are supported, otherwise
688 libavcodec will round to the nearest valid bitrate.
689
690 @table @samp
691 @item 6600
692 @item 8850
693 @item 12650
694 @item 14250
695 @item 15850
696 @item 18250
697 @item 19850
698 @item 23050
699 @item 23850
700 @end table
701
702 @item dtx
703 Allow discontinuous transmission (generate comfort noise) when set to 1. The
704 default value is 0 (disabled).
705
706 @end table
707
708 @section libopus
709
710 libopus Opus Interactive Audio Codec encoder wrapper.
711
712 Requires the presence of the libopus headers and library during
713 configuration. You need to explicitly configure the build with
714 @code{--enable-libopus}.
715
716 @subsection Option Mapping
717
718 Most libopus options are modeled after the @command{opusenc} utility from
719 opus-tools. The following is an option mapping chart describing options
720 supported by the libopus wrapper, and their @command{opusenc}-equivalent
721 in parentheses.
722
723 @table @option
724
725 @item b (@emph{bitrate})
726 Set the bit rate in bits/s.  FFmpeg's @option{b} option is
727 expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
728 kilobits/s.
729
730 @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
731 Set VBR mode. The FFmpeg @option{vbr} option has the following
732 valid arguments, with the their @command{opusenc} equivalent options
733 in parentheses:
734
735 @table @samp
736 @item off (@emph{hard-cbr})
737 Use constant bit rate encoding.
738
739 @item on (@emph{vbr})
740 Use variable bit rate encoding (the default).
741
742 @item constrained (@emph{cvbr})
743 Use constrained variable bit rate encoding.
744 @end table
745
746 @item compression_level (@emph{comp})
747 Set encoding algorithm complexity. Valid options are integers in
748 the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
749 gives the highest quality but slowest encoding. The default is 10.
750
751 @item frame_duration (@emph{framesize})
752 Set maximum frame size, or duration of a frame in milliseconds. The
753 argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
754 frame sizes achieve lower latency but less quality at a given bitrate.
755 Sizes greater than 20ms are only interesting at fairly low bitrates.
756 The default of FFmpeg is 10ms, but is 20ms in @command{opusenc}.
757
758 @item packet_loss (@emph{expect-loss})
759 Set expected packet loss percentage. The default is 0.
760
761 @item application (N.A.)
762 Set intended application type. Valid options are listed below:
763
764 @table @samp
765 @item voip
766 Favor improved speech intelligibility.
767 @item audio
768 Favor faithfulness to the input (the default).
769 @item lowdelay
770 Restrict to only the lowest delay modes.
771 @end table
772
773 @item cutoff (N.A.)
774 Set cutoff bandwidth in Hz. The argument must be exactly one of the
775 following: 4000, 6000, 8000, 12000, or 20000, corresponding to
776 narrowband, mediumband, wideband, super wideband, and fullband
777 respectively. The default is 0 (cutoff disabled).
778
779 @end table
780
781 @section libwavpack
782
783 A wrapper providing WavPack encoding through libwavpack.
784
785 Only lossless mode using 32-bit integer samples is supported currently.
786 The @option{compression_level} option can be used to control speed vs.
787 compression tradeoff, with the values mapped to libwavpack as follows:
788
789 @table @option
790
791 @item 0
792 Fast mode - corresponding to the wavpack @option{-f} option.
793
794 @item 1
795 Normal (default) settings.
796
797 @item 2
798 High quality - corresponding to the wavpack @option{-h} option.
799
800 @item 3
801 Very high quality - corresponding to the wavpack @option{-hh} option.
802
803 @item 4-8
804 Same as 3, but with extra processing enabled - corresponding to the wavpack
805 @option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
806 @option{-x6}.
807
808 @end table
809
810 @c man end AUDIO ENCODERS
811
812 @chapter Video Encoders
813 @c man begin VIDEO ENCODERS
814
815 A description of some of the currently available video encoders
816 follows.
817
818 @section libtheora
819
820 Theora format supported through libtheora.
821
822 Requires the presence of the libtheora headers and library during
823 configuration. You need to explicitly configure the build with
824 @code{--enable-libtheora}.
825
826 @subsection Options
827
828 The following global options are mapped to internal libtheora options
829 which affect the quality and the bitrate of the encoded stream.
830
831 @table @option
832 @item b
833 Set the video bitrate, only works if the @code{qscale} flag in
834 @option{flags} is not enabled.
835
836 @item flags
837 Used to enable constant quality mode encoding through the
838 @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
839 modes.
840
841 @item g
842 Set the GOP size.
843
844 @item global_quality
845 Set the global quality in lambda units, only works if the
846 @code{qscale} flag in @option{flags} is enabled. The value is clipped
847 in the [0 - 10*@code{FF_QP2LAMBDA}] range, and then multiplied for 6.3
848 to get a value in the native libtheora range [0-63]. A higher value
849 corresponds to a higher quality.
850
851 For example, to set maximum constant quality encoding with
852 @command{ffmpeg}:
853 @example
854 ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
855 @end example
856 @end table
857
858 @section libvpx
859
860 VP8 format supported through libvpx.
861
862 Requires the presence of the libvpx headers and library during configuration.
863 You need to explicitly configure the build with @code{--enable-libvpx}.
864
865 @subsection Options
866
867 Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
868
869 @table @option
870
871 @item threads
872 g_threads
873
874 @item profile
875 g_profile
876
877 @item vb
878 rc_target_bitrate
879
880 @item g
881 kf_max_dist
882
883 @item keyint_min
884 kf_min_dist
885
886 @item qmin
887 rc_min_quantizer
888
889 @item qmax
890 rc_max_quantizer
891
892 @item bufsize, vb
893 rc_buf_sz
894 @code{(bufsize * 1000 / vb)}
895
896 rc_buf_optimal_sz
897 @code{(bufsize * 1000 / vb * 5 / 6)}
898
899 @item rc_init_occupancy, vb
900 rc_buf_initial_sz
901 @code{(rc_init_occupancy * 1000 / vb)}
902
903 @item rc_buffer_aggressivity
904 rc_undershoot_pct
905
906 @item skip_threshold
907 rc_dropframe_thresh
908
909 @item qcomp
910 rc_2pass_vbr_bias_pct
911
912 @item maxrate, vb
913 rc_2pass_vbr_maxsection_pct
914 @code{(maxrate * 100 / vb)}
915
916 @item minrate, vb
917 rc_2pass_vbr_minsection_pct
918 @code{(minrate * 100 / vb)}
919
920 @item minrate, maxrate, vb
921 @code{VPX_CBR}
922 @code{(minrate == maxrate == vb)}
923
924 @item crf
925 @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
926
927 @item quality
928 @table @option
929 @item @var{best}
930 @code{VPX_DL_BEST_QUALITY}
931 @item @var{good}
932 @code{VPX_DL_GOOD_QUALITY}
933 @item @var{realtime}
934 @code{VPX_DL_REALTIME}
935 @end table
936
937 @item speed
938 @code{VP8E_SET_CPUUSED}
939
940 @item nr
941 @code{VP8E_SET_NOISE_SENSITIVITY}
942
943 @item mb_threshold
944 @code{VP8E_SET_STATIC_THRESHOLD}
945
946 @item slices
947 @code{VP8E_SET_TOKEN_PARTITIONS}
948
949 @item max-intra-rate
950 @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
951
952 @item force_key_frames
953 @code{VPX_EFLAG_FORCE_KF}
954
955 @item Alternate reference frame related
956 @table @option
957 @item vp8flags altref
958 @code{VP8E_SET_ENABLEAUTOALTREF}
959 @item @var{arnr_max_frames}
960 @code{VP8E_SET_ARNR_MAXFRAMES}
961 @item @var{arnr_type}
962 @code{VP8E_SET_ARNR_TYPE}
963 @item @var{arnr_strength}
964 @code{VP8E_SET_ARNR_STRENGTH}
965 @item @var{rc_lookahead}
966 g_lag_in_frames
967 @end table
968
969 @item vp8flags error_resilient
970 g_error_resilient
971
972 @end table
973
974 For more information about libvpx see:
975 @url{http://www.webmproject.org/}
976
977 @section libx264
978
979 x264 H.264/MPEG-4 AVC encoder wrapper.
980
981 This encoder requires the presence of the libx264 headers and library
982 during configuration. You need to explicitly configure the build with
983 @code{--enable-libx264}.
984
985 libx264 supports an impressive number of features, including 8x8 and
986 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
987 entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
988 for detail retention (adaptive quantization, psy-RD, psy-trellis).
989
990 Many libx264 encoder options are mapped to FFmpeg global codec
991 options, while unique encoder options are provided through private
992 options. Additionally the @option{x264opts} and @option{x264-params}
993 private options allows to pass a list of key=value tuples as accepted
994 by the libx264 @code{x264_param_parse} function.
995
996 The x264 project website is at
997 @url{http://www.videolan.org/developers/x264.html}.
998
999 @subsection Options
1000
1001 The following options are supported by the libx264 wrapper. The
1002 @command{x264}-equivalent options or values are listed in parentheses
1003 for easy migration.
1004
1005 To reduce the duplication of documentation, only the private options
1006 and some others requiring special attention are documented here. For
1007 the documentation of the undocumented generic options, see
1008 @ref{codec-options,,the Codec Options chapter}.
1009
1010 To get a more accurate and extensive documentation of the libx264
1011 options, invoke the command @command{x264 --full-help} or consult
1012 the libx264 documentation.
1013
1014 @table @option
1015 @item b (@emph{bitrate})
1016 Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
1017 expressed in bits/s, while @command{x264}'s @option{bitrate} is in
1018 kilobits/s.
1019
1020 @item bf (@emph{bframes})
1021
1022 @item g (@emph{keyint})
1023
1024 @item qmax (@emph{qpmax})
1025
1026 @item qmin (@emph{qpmin})
1027
1028 @item qdiff (@emph{qpstep})
1029
1030 @item qblur (@emph{qblur})
1031
1032 @item qcomp (@emph{qcomp})
1033
1034 @item refs (@emph{ref})
1035
1036 @item sc_threshold (@emph{scenecut})
1037
1038 @item trellis (@emph{trellis})
1039
1040 @item nr  (@emph{nr})
1041
1042 @item me_range (@emph{merange})
1043
1044 @item me_method (@emph{me})
1045 Set motion estimation method. Possible values in the decreasing order
1046 of speed:
1047
1048 @table @samp
1049 @item dia (@emph{dia})
1050 @item epzs (@emph{dia})
1051 Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
1052 @samp{dia}.
1053 @item hex (@emph{hex})
1054 Hexagonal search with radius 2.
1055 @item umh (@emph{umh})
1056 Uneven multi-hexagon search.
1057 @item esa (@emph{esa})
1058 Exhaustive search.
1059 @item tesa (@emph{tesa})
1060 Hadamard exhaustive search (slowest).
1061 @end table
1062
1063 @item subq (@emph{subme})
1064
1065 @item b_strategy (@emph{b-adapt})
1066
1067 @item keyint_min (@emph{min-keyint})
1068
1069 @item coder
1070 Set entropy encoder. Possible values:
1071
1072 @table @samp
1073 @item ac
1074 Enable CABAC.
1075
1076 @item vlc
1077 Enable CAVLC and disable CABAC. It generates the same effect as
1078 @command{x264}'s @option{--no-cabac} option.
1079 @end table
1080
1081 @item cmp
1082 Set full pixel motion estimation comparation algorithm. Possible values:
1083
1084 @table @samp
1085 @item chroma
1086 Enable chroma in motion estimation.
1087
1088 @item sad
1089 Ignore chroma in motion estimation. It generates the same effect as
1090 @command{x264}'s @option{--no-chroma-me} option.
1091 @end table
1092
1093 @item threads (@emph{threads})
1094
1095 @item thread_type
1096 Set multithreading technique. Possible values:
1097
1098 @table @samp
1099 @item slice
1100 Slice-based multithreading. It generates the same effect as
1101 @command{x264}'s @option{--sliced-threads} option.
1102 @item frame
1103 Frame-based multithreading.
1104 @end table
1105
1106 @item flags
1107 Set encoding flags. It can be used to disable closed GOP and enable
1108 open GOP by setting it to @code{-cgop}. The result is similar to
1109 the behavior of @command{x264}'s @option{--open-gop} option.
1110
1111 @item rc_init_occupancy (@emph{vbv-init})
1112
1113 @item preset (@emph{preset})
1114 Set the encoding preset.
1115
1116 @item tune (@emph{tune})
1117 Set tuning of the encoding params.
1118
1119 @item profile (@emph{profile})
1120 Set profile restrictions.
1121
1122 @item fastfirstpass
1123 Enable fast settings when encoding first pass, when set to 1. When set
1124 to 0, it has the same effect of @command{x264}'s
1125 @option{--slow-firstpass} option.
1126
1127 @item crf (@emph{crf})
1128 Set the quality for constant quality mode.
1129
1130 @item crf_max (@emph{crf-max})
1131 In CRF mode, prevents VBV from lowering quality beyond this point.
1132
1133 @item qp (@emph{qp})
1134 Set constant quantization rate control method parameter.
1135
1136 @item aq-mode (@emph{aq-mode})
1137 Set AQ method. Possible values:
1138
1139 @table @samp
1140 @item none (@emph{0})
1141 Disabled.
1142
1143 @item variance (@emph{1})
1144 Variance AQ (complexity mask).
1145
1146 @item autovariance (@emph{2})
1147 Auto-variance AQ (experimental).
1148 @end table
1149
1150 @item aq-strength (@emph{aq-strength})
1151 Set AQ strength, reduce blocking and blurring in flat and textured areas.
1152
1153 @item psy
1154 Use psychovisual optimizations when set to 1. When set to 0, it has the
1155 same effect as @command{x264}'s @option{--no-psy} option.
1156
1157 @item psy-rd  (@emph{psy-rd})
1158 Set strength of psychovisual optimization, in
1159 @var{psy-rd}:@var{psy-trellis} format.
1160
1161 @item rc-lookahead (@emph{rc-lookahead})
1162 Set number of frames to look ahead for frametype and ratecontrol.
1163
1164 @item weightb
1165 Enable weighted prediction for B-frames when set to 1. When set to 0,
1166 it has the same effect as @command{x264}'s @option{--no-weightb} option.
1167
1168 @item weightp (@emph{weightp})
1169 Set weighted prediction method for P-frames. Possible values:
1170
1171 @table @samp
1172 @item none (@emph{0})
1173 Disabled
1174 @item simple (@emph{1})
1175 Enable only weighted refs
1176 @item smart (@emph{2})
1177 Enable both weighted refs and duplicates
1178 @end table
1179
1180 @item ssim (@emph{ssim})
1181 Enable calculation and printing SSIM stats after the encoding.
1182
1183 @item intra-refresh (@emph{intra-refresh})
1184 Enable the use of Periodic Intra Refresh instead of IDR frames when set
1185 to 1.
1186
1187 @item bluray-compat (@emph{bluray-compat})
1188 Configure the encoder to be compatible with the bluray standard.
1189 It is a shorthand for setting "bluray-compat=1 force-cfr=1".
1190
1191 @item b-bias (@emph{b-bias})
1192 Set the influence on how often B-frames are used.
1193
1194 @item b-pyramid (@emph{b-pyramid})
1195 Set method for keeping of some B-frames as references. Possible values:
1196
1197 @table @samp
1198 @item none (@emph{none})
1199 Disabled.
1200 @item strict (@emph{strict})
1201 Strictly hierarchical pyramid.
1202 @item normal (@emph{normal})
1203 Non-strict (not Blu-ray compatible).
1204 @end table
1205
1206 @item mixed-refs
1207 Enable the use of one reference per partition, as opposed to one
1208 reference per macroblock when set to 1. When set to 0, it has the
1209 same effect as @command{x264}'s @option{--no-mixed-refs} option.
1210
1211 @item 8x8dct
1212 Enable adaptive spatial transform (high profile 8x8 transform)
1213 when set to 1. When set to 0, it has the same effect as
1214 @command{x264}'s @option{--no-8x8dct} option.
1215
1216 @item fast-pskip
1217 Enable early SKIP detection on P-frames when set to 1. When set
1218 to 0, it has the same effect as @command{x264}'s
1219 @option{--no-fast-pskip} option.
1220
1221 @item aud (@emph{aud})
1222 Enable use of access unit delimiters when set to 1.
1223
1224 @item mbtree
1225 Enable use macroblock tree ratecontrol when set to 1. When set
1226 to 0, it has the same effect as @command{x264}'s
1227 @option{--no-mbtree} option.
1228
1229 @item deblock (@emph{deblock})
1230 Set loop filter parameters, in @var{alpha}:@var{beta} form.
1231
1232 @item cplxblur (@emph{cplxblur})
1233 Set fluctuations reduction in QP (before curve compression).
1234
1235 @item partitions (@emph{partitions})
1236 Set partitions to consider as a comma-separated list of. Possible
1237 values in the list:
1238
1239 @table @samp
1240 @item p8x8
1241 8x8 P-frame partition.
1242 @item p4x4
1243 4x4 P-frame partition.
1244 @item b8x8
1245 4x4 B-frame partition.
1246 @item i8x8
1247 8x8 I-frame partition.
1248 @item i4x4
1249 4x4 I-frame partition.
1250 (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
1251 @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
1252 option) to be enabled.)
1253 @item none (@emph{none})
1254 Do not consider any partitions.
1255 @item all (@emph{all})
1256 Consider every partition.
1257 @end table
1258
1259 @item direct-pred (@emph{direct})
1260 Set direct MV prediction mode. Possible values:
1261
1262 @table @samp
1263 @item none (@emph{none})
1264 Disable MV prediction.
1265 @item spatial (@emph{spatial})
1266 Enable spatial predicting.
1267 @item temporal (@emph{temporal})
1268 Enable temporal predicting.
1269 @item auto (@emph{auto})
1270 Automatically decided.
1271 @end table
1272
1273 @item slice-max-size (@emph{slice-max-size})
1274 Set the limit of the size of each slice in bytes. If not specified
1275 but RTP payload size (@option{ps}) is specified, that is used.
1276
1277 @item stats (@emph{stats})
1278 Set the file name for multi-pass stats.
1279
1280 @item nal-hrd (@emph{nal-hrd})
1281 Set signal HRD information (requires @option{vbv-bufsize} to be set).
1282 Possible values:
1283
1284 @table @samp
1285 @item none (@emph{none})
1286 Disable HRD information signaling.
1287 @item vbr (@emph{vbr})
1288 Variable bit rate.
1289 @item cbr (@emph{cbr})
1290 Constant bit rate (not allowed in MP4 container).
1291 @end table
1292
1293 @item x264opts (N.A.)
1294 Set any x264 option, see @command{x264 --fullhelp} for a list.
1295
1296 Argument is a list of @var{key}=@var{value} couples separated by
1297 ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
1298 themselves, use "," instead. They accept it as well since long ago but this
1299 is kept undocumented for some reason.
1300
1301 For example to specify libx264 encoding options with @command{ffmpeg}:
1302 @example
1303 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
1304 @end example
1305
1306 @item x264-params (N.A.)
1307 Override the x264 configuration using a :-separated list of key=value
1308 parameters.
1309
1310 This option is functionally the same as the @option{x264opts}, but is
1311 duplicated for compability with the Libav fork.
1312
1313 For example to specify libx264 encoding options with @command{ffmpeg}:
1314 @example
1315 ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
1316 cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
1317 no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
1318 @end example
1319 @end table
1320
1321 Encoding ffpresets for common usages are provided so they can be used with the
1322 general presets system (e.g. passing the @option{pre} option).
1323
1324 @section libxvid
1325
1326 Xvid MPEG-4 Part 2 encoder wrapper.
1327
1328 This encoder requires the presence of the libxvidcore headers and library
1329 during configuration. You need to explicitly configure the build with
1330 @code{--enable-libxvid --enable-gpl}.
1331
1332 The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
1333 users can encode to this format without this library.
1334
1335 @subsection Options
1336
1337 The following options are supported by the libxvid wrapper. Some of
1338 the following options are listed but are not documented, and
1339 correspond to shared codec options. See @ref{codec-options,,the Codec
1340 Options chapter} for their documentation. The other shared options
1341 which are not listed have no effect for the libxvid encoder.
1342
1343 @table @option
1344 @item b
1345
1346 @item g
1347
1348 @item qmin
1349
1350 @item qmax
1351
1352 @item mpeg_quant
1353
1354 @item threads
1355
1356 @item bf
1357
1358 @item b_qfactor
1359
1360 @item b_qoffset
1361
1362 @item flags
1363 Set specific encoding flags. Possible values:
1364
1365 @table @samp
1366
1367 @item mv4
1368 Use four motion vector by macroblock.
1369
1370 @item aic
1371 Enable high quality AC prediction.
1372
1373 @item gray
1374 Only encode grayscale.
1375
1376 @item gmc
1377 Enable the use of global motion compensation (GMC).
1378
1379 @item qpel
1380 Enable quarter-pixel motion compensation.
1381
1382 @item cgop
1383 Enable closed GOP.
1384
1385 @item global_header
1386 Place global headers in extradata instead of every keyframe.
1387
1388 @end table
1389
1390 @item trellis
1391
1392 @item me_method
1393 Set motion estimation method. Possible values in decreasing order of
1394 speed and increasing order of quality:
1395
1396 @table @samp
1397 @item zero
1398 Use no motion estimation (default).
1399
1400 @item phods
1401 @item x1
1402 @item log
1403 Enable advanced diamond zonal search for 16x16 blocks and half-pixel
1404 refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
1405 @samp{phods}.
1406
1407 @item epzs
1408 Enable all of the things described above, plus advanced diamond zonal
1409 search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
1410 estimation on chroma planes.
1411
1412 @item full
1413 Enable all of the things described above, plus extended 16x16 and 8x8
1414 blocks search.
1415 @end table
1416
1417 @item mbd
1418 Set macroblock decision algorithm. Possible values in the increasing
1419 order of quality:
1420
1421 @table @samp
1422 @item simple
1423 Use macroblock comparing function algorithm (default).
1424
1425 @item bits
1426 Enable rate distortion-based half pixel and quarter pixel refinement for
1427 16x16 blocks.
1428
1429 @item rd
1430 Enable all of the things described above, plus rate distortion-based
1431 half pixel and quarter pixel refinement for 8x8 blocks, and rate
1432 distortion-based search using square pattern.
1433 @end table
1434
1435 @item lumi_aq
1436 Enable lumi masking adaptive quantization when set to 1. Default is 0
1437 (disabled).
1438
1439 @item variance_aq
1440 Enable variance adaptive quantization when set to 1. Default is 0
1441 (disabled).
1442
1443 When combined with @option{lumi_aq}, the resulting quality will not
1444 be better than any of the two specified individually. In other
1445 words, the resulting quality will be the worse one of the two
1446 effects.
1447
1448 @item ssim
1449 Set structural similarity (SSIM) displaying method. Possible values:
1450
1451 @table @samp
1452 @item off
1453 Disable displaying of SSIM information.
1454
1455 @item avg
1456 Output average SSIM at the end of encoding to stdout. The format of
1457 showing the average SSIM is:
1458
1459 @example
1460 Average SSIM: %f
1461 @end example
1462
1463 For users who are not familiar with C, %f means a float number, or
1464 a decimal (e.g. 0.939232).
1465
1466 @item frame
1467 Output both per-frame SSIM data during encoding and average SSIM at
1468 the end of encoding to stdout. The format of per-frame information
1469 is:
1470
1471 @example
1472        SSIM: avg: %1.3f min: %1.3f max: %1.3f
1473 @end example
1474
1475 For users who are not familiar with C, %1.3f means a float number
1476 rounded to 3 digits after the dot (e.g. 0.932).
1477
1478 @end table
1479
1480 @item ssim_acc
1481 Set SSIM accuracy. Valid options are integers within the range of
1482 0-4, while 0 gives the most accurate result and 4 computes the
1483 fastest.
1484
1485 @end table
1486
1487 @section png
1488
1489 PNG image encoder.
1490
1491 @subsection Private options
1492
1493 @table @option
1494 @item dpi @var{integer}
1495 Set physical density of pixels, in dots per inch, unset by default
1496 @item dpm @var{integer}
1497 Set physical density of pixels, in dots per meter, unset by default
1498 @end table
1499
1500 @section ProRes
1501
1502 Apple ProRes encoder.
1503
1504 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
1505 The used encoder can be choosen with the @code{-vcodec} option.
1506
1507 @subsection Private Options for prores-ks
1508
1509 @table @option
1510 @item profile @var{integer}
1511 Select the ProRes profile to encode
1512 @table @samp
1513 @item proxy
1514 @item lt
1515 @item standard
1516 @item hq
1517 @item 4444
1518 @end table
1519
1520 @item quant_mat @var{integer}
1521 Select quantization matrix.
1522 @table @samp
1523 @item auto
1524 @item default
1525 @item proxy
1526 @item lt
1527 @item standard
1528 @item hq
1529 @end table
1530 If set to @var{auto}, the matrix matching the profile will be picked.
1531 If not set, the matrix providing the highest quality, @var{default}, will be
1532 picked.
1533
1534 @item bits_per_mb @var{integer}
1535 How many bits to allot for coding one macroblock. Different profiles use
1536 between 200 and 2400 bits per macroblock, the maximum is 8000.
1537
1538 @item mbs_per_slice @var{integer}
1539 Number of macroblocks in each slice (1-8); the default value (8)
1540 should be good in almost all situations.
1541
1542 @item vendor @var{string}
1543 Override the 4-byte vendor ID.
1544 A custom vendor ID like @var{apl0} would claim the stream was produced by
1545 the Apple encoder.
1546
1547 @item alpha_bits @var{integer}
1548 Specify number of bits for alpha component.
1549 Possible values are @var{0}, @var{8} and @var{16}.
1550 Use @var{0} to disable alpha plane coding.
1551
1552 @end table
1553
1554 @subsection Speed considerations
1555
1556 In the default mode of operation the encoder has to honor frame constraints
1557 (i.e. not produc frames with size bigger than requested) while still making
1558 output picture as good as possible.
1559 A frame containing a lot of small details is harder to compress and the encoder
1560 would spend more time searching for appropriate quantizers for each slice.
1561
1562 Setting a higher @option{bits_per_mb} limit will improve the speed.
1563
1564 For the fastest encoding speed set the @option{qscale} parameter (4 is the
1565 recommended value) and do not set a size constraint.
1566
1567 @c man end VIDEO ENCODERS