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