]> git.sesse.net Git - ffmpeg/blob - doc/encoders.texi
Merge commit 'bf52f773913cf74bdf0d2c8c2cb4473fa1b7801e'
[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{-encoders} 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 todo @ref{libaacplus}
42 See also @ref{libfdk-aac-enc,,libfdk_aac} and @ref{libfaac}.
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 described 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 @anchor{flac}
498 @section flac
499
500 FLAC (Free Lossless Audio Codec) Encoder
501
502 @subsection Options
503
504 The following options are supported by FFmpeg's flac encoder.
505
506 @table @option
507 @item compression_level
508 Sets the compression level, which chooses defaults for many other options
509 if they are not set explicitly.
510
511 @item frame_size
512 Sets the size of the frames in samples per channel.
513
514 @item lpc_coeff_precision
515 Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
516 default.
517
518 @item lpc_type
519 Sets the first stage LPC algorithm
520 @table @samp
521 @item none
522 LPC is not used
523
524 @item fixed
525 fixed LPC coefficients
526
527 @item levinson
528
529 @item cholesky
530 @end table
531
532 @item lpc_passes
533 Number of passes to use for Cholesky factorization during LPC analysis
534
535 @item min_partition_order
536 The minimum partition order
537
538 @item max_partition_order
539 The maximum partition order
540
541 @item prediction_order_method
542 @table @samp
543 @item estimation
544 @item 2level
545 @item 4level
546 @item 8level
547 @item search
548 Bruteforce search
549 @item log
550 @end table
551
552 @item ch_mode
553 Channel mode
554 @table @samp
555 @item auto
556 The mode is chosen automatically for each frame
557 @item indep
558 Chanels are independently coded
559 @item left_side
560 @item right_side
561 @item mid_side
562 @end table
563
564 @item exact_rice_parameters
565 Chooses if rice parameters are calculated exactly or approximately.
566 if set to 1 then they are chosen exactly, which slows the code down slightly and
567 improves compression slightly.
568
569 @item multi_dim_quant
570 Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
571 applied after the first stage to finetune the coefficients. This is quite slow
572 and slightly improves compression.
573
574 @end table
575
576 @anchor{libfaac}
577 @section libfaac
578
579 libfaac AAC (Advanced Audio Coding) encoder wrapper.
580
581 Requires the presence of the libfaac headers and library during
582 configuration. You need to explicitly configure the build with
583 @code{--enable-libfaac --enable-nonfree}.
584
585 This encoder is considered to be of higher quality with respect to the
586 @ref{aacenc,,the native experimental FFmpeg AAC encoder}.
587
588 For more information see the libfaac project at
589 @url{http://www.audiocoding.com/faac.html/}.
590
591 @subsection Options
592
593 The following shared FFmpeg codec options are recognized.
594
595 The following options are supported by the libfaac wrapper. The
596 @command{faac}-equivalent of the options are listed in parentheses.
597
598 @table @option
599 @item b (@emph{-b})
600 Set bit rate in bits/s for ABR (Average Bit Rate) mode. If the bit rate
601 is not explicitly specified, it is automatically set to a suitable
602 value depending on the selected profile. @command{faac} bitrate is
603 expressed in kilobits/s.
604
605 Note that libfaac does not support CBR (Constant Bit Rate) but only
606 ABR (Average Bit Rate).
607
608 If VBR mode is enabled this option is ignored.
609
610 @item ar (@emph{-R})
611 Set audio sampling rate (in Hz).
612
613 @item ac (@emph{-c})
614 Set the number of audio channels.
615
616 @item cutoff (@emph{-C})
617 Set cutoff frequency. If not specified (or explicitly set to 0) it
618 will use a value automatically computed by the library. Default value
619 is 0.
620
621 @item profile
622 Set audio profile.
623
624 The following profiles are recognized:
625 @table @samp
626 @item aac_main
627 Main AAC (Main)
628
629 @item aac_low
630 Low Complexity AAC (LC)
631
632 @item aac_ssr
633 Scalable Sample Rate (SSR)
634
635 @item aac_ltp
636 Long Term Prediction (LTP)
637 @end table
638
639 If not specified it is set to @samp{aac_low}.
640
641 @item flags +qscale
642 Set constant quality VBR (Variable Bit Rate) mode.
643
644 @item global_quality
645 Set quality in VBR mode as an integer number of lambda units.
646
647 Only relevant when VBR mode is enabled with @code{flags +qscale}.  The
648 value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
649 and used to set the quality value used by libfaac. A reasonable range
650 for the option value in QP units is [10-500], the higher the value the
651 higher the quality.
652
653 @item q (@emph{-q})
654 Enable VBR mode when set to a non-negative value, and set constant
655 quality value as a double floating point value in QP units.
656
657 The value sets the quality value used by libfaac. A reasonable range
658 for the option value is [10-500], the higher the value the higher the
659 quality.
660
661 This option is valid only using the @command{ffmpeg} command-line
662 tool. For library interface users, use @option{global_quality}.
663 @end table
664
665 @subsection Examples
666
667 @itemize
668 @item
669 Use @command{ffmpeg} to convert an audio file to ABR 128 kbps AAC in an M4A (MP4)
670 container:
671 @example
672 ffmpeg -i input.wav -codec:a libfaac -b:a 128k -output.m4a
673 @end example
674
675 @item
676 Use @command{ffmpeg} to convert an audio file to VBR AAC, using the
677 LTP AAC profile:
678 @example
679 ffmpeg -i input.wav -c:a libfaac -profile:a aac_ltp -q:a 100 output.m4a
680 @end example
681 @end itemize
682
683 @anchor{libfdk-aac-enc}
684 @section libfdk_aac
685
686 libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
687
688 The libfdk-aac library is based on the Fraunhofer FDK AAC code from
689 the Android project.
690
691 Requires the presence of the libfdk-aac headers and library during
692 configuration. You need to explicitly configure the build with
693 @code{--enable-libfdk-aac}. The library is also incompatible with GPL,
694 so if you allow the use of GPL, you should configure with
695 @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
696
697 This encoder is considered to be of higher quality with respect to
698 both @ref{aacenc,,the native experimental FFmpeg AAC encoder} and
699 @ref{libfaac}.
700
701 VBR encoding, enabled through the @option{vbr} or @option{flags
702 +qscale} options, is experimental and only works with some
703 combinations of parameters.
704
705 Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
706 higher.
707
708 For more information see the fdk-aac project at
709 @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
710
711 @subsection Options
712
713 The following options are mapped on the shared FFmpeg codec options.
714
715 @table @option
716 @item b
717 Set bit rate in bits/s. If the bitrate is not explicitly specified, it
718 is automatically set to a suitable value depending on the selected
719 profile.
720
721 In case VBR mode is enabled the option is ignored.
722
723 @item ar
724 Set audio sampling rate (in Hz).
725
726 @item channels
727 Set the number of audio channels.
728
729 @item flags +qscale
730 Enable fixed quality, VBR (Variable Bit Rate) mode.
731 Note that VBR is implicitly enabled when the @option{vbr} value is
732 positive.
733
734 @item cutoff
735 Set cutoff frequency. If not specified (or explicitly set to 0) it
736 will use a value automatically computed by the library. Default value
737 is 0.
738
739 @item profile
740 Set audio profile.
741
742 The following profiles are recognized:
743 @table @samp
744 @item aac_low
745 Low Complexity AAC (LC)
746
747 @item aac_he
748 High Efficiency AAC (HE-AAC)
749
750 @item aac_he_v2
751 High Efficiency AAC version 2 (HE-AACv2)
752
753 @item aac_ld
754 Low Delay AAC (LD)
755
756 @item aac_eld
757 Enhanced Low Delay AAC (ELD)
758 @end table
759
760 If not specified it is set to @samp{aac_low}.
761 @end table
762
763 The following are private options of the libfdk_aac encoder.
764
765 @table @option
766 @item afterburner
767 Enable afterburner feature if set to 1, disabled if set to 0. This
768 improves the quality but also the required processing power.
769
770 Default value is 1.
771
772 @item eld_sbr
773 Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
774 if set to 0.
775
776 Default value is 0.
777
778 @item signaling
779 Set SBR/PS signaling style.
780
781 It can assume one of the following values:
782 @table @samp
783 @item default
784 choose signaling implicitly (explicit hierarchical by default,
785 implicit if global header is disabled)
786
787 @item implicit
788 implicit backwards compatible signaling
789
790 @item explicit_sbr
791 explicit SBR, implicit PS signaling
792
793 @item explicit_hierarchical
794 explicit hierarchical signaling
795 @end table
796
797 Default value is @samp{default}.
798
799 @item latm
800 Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
801
802 Default value is 0.
803
804 @item header_period
805 Set StreamMuxConfig and PCE repetition period (in frames) for sending
806 in-band configuration buffers within LATM/LOAS transport layer.
807
808 Must be a 16-bits non-negative integer.
809
810 Default value is 0.
811
812 @item vbr
813 Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
814 good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
815 (Constant Bit Rate) is enabled.
816
817 Currently only the @samp{aac_low} profile supports VBR encoding.
818
819 VBR modes 1-5 correspond to roughly the following average bit rates:
820
821 @table @samp
822 @item 1
823 32 kbps/channel
824 @item 2
825 40 kbps/channel
826 @item 3
827 48-56 kbps/channel
828 @item 4
829 64 kbps/channel
830 @item 5
831 about 80-96 kbps/channel
832 @end table
833
834 Default value is 0.
835 @end table
836
837 @subsection Examples
838
839 @itemize
840 @item
841 Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
842 container:
843 @example
844 ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
845 @end example
846
847 @item
848 Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
849 High-Efficiency AAC profile:
850 @example
851 ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
852 @end example
853 @end itemize
854
855 @anchor{libmp3lame}
856 @section libmp3lame
857
858 LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
859
860 Requires the presence of the libmp3lame headers and library during
861 configuration. You need to explicitly configure the build with
862 @code{--enable-libmp3lame}.
863
864 See @ref{libshine} for a fixed-point MP3 encoder, although with a
865 lower quality.
866
867 @subsection Options
868
869 The following options are supported by the libmp3lame wrapper. The
870 @command{lame}-equivalent of the options are listed in parentheses.
871
872 @table @option
873 @item b (@emph{-b})
874 Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
875 expressed in kilobits/s.
876
877 @item q (@emph{-V})
878 Set constant quality setting for VBR. This option is valid only
879 using the @command{ffmpeg} command-line tool. For library interface
880 users, use @option{global_quality}.
881
882 @item compression_level (@emph{-q})
883 Set algorithm quality. Valid arguments are integers in the 0-9 range,
884 with 0 meaning highest quality but slowest, and 9 meaning fastest
885 while producing the worst quality.
886
887 @item reservoir
888 Enable use of bit reservoir when set to 1. Default value is 1. LAME
889 has this enabled by default, but can be overridden by use
890 @option{--nores} option.
891
892 @item joint_stereo (@emph{-m j})
893 Enable the encoder to use (on a frame by frame basis) either L/R
894 stereo or mid/side stereo. Default value is 1.
895
896 @item abr (@emph{--abr})
897 Enable the encoder to use ABR when set to 1. The @command{lame}
898 @option{--abr} sets the target bitrate, while this options only
899 tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
900
901 @end table
902
903 @section libopencore-amrnb
904
905 OpenCORE Adaptive Multi-Rate Narrowband encoder.
906
907 Requires the presence of the libopencore-amrnb headers and library during
908 configuration. You need to explicitly configure the build with
909 @code{--enable-libopencore-amrnb --enable-version3}.
910
911 This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
912 but you can override it by setting @option{strict} to @samp{unofficial} or
913 lower.
914
915 @subsection Options
916
917 @table @option
918
919 @item b
920 Set bitrate in bits per second. Only the following bitrates are supported,
921 otherwise libavcodec will round to the nearest valid bitrate.
922
923 @table @option
924 @item 4750
925 @item 5150
926 @item 5900
927 @item 6700
928 @item 7400
929 @item 7950
930 @item 10200
931 @item 12200
932 @end table
933
934 @item dtx
935 Allow discontinuous transmission (generate comfort noise) when set to 1. The
936 default value is 0 (disabled).
937
938 @end table
939
940 @anchor{libshine}
941 @section libshine
942
943 Shine Fixed-Point MP3 encoder wrapper.
944
945 Shine is a fixed-point MP3 encoder. It has a far better performance on
946 platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
947 However, as it is more targeted on performance than quality, it is not on par
948 with LAME and other production-grade encoders quality-wise. Also, according to
949 the project's homepage, this encoder may not be free of bugs as the code was
950 written a long time ago and the project was dead for at least 5 years.
951
952 This encoder only supports stereo and mono input. This is also CBR-only.
953
954 The original project (last updated in early 2007) is at
955 @url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
956 updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
957
958 Requires the presence of the libshine headers and library during
959 configuration. You need to explicitly configure the build with
960 @code{--enable-libshine}.
961
962 See also @ref{libmp3lame}.
963
964 @subsection Options
965
966 The following options are supported by the libshine wrapper. The
967 @command{shineenc}-equivalent of the options are listed in parentheses.
968
969 @table @option
970 @item b (@emph{-b})
971 Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
972 is expressed in kilobits/s.
973
974 @end table
975
976 @section libtwolame
977
978 TwoLAME MP2 encoder wrapper.
979
980 Requires the presence of the libtwolame headers and library during
981 configuration. You need to explicitly configure the build with
982 @code{--enable-libtwolame}.
983
984 @subsection Options
985
986 The following options are supported by the libtwolame wrapper. The
987 @command{twolame}-equivalent options follow the FFmpeg ones and are in
988 parentheses.
989
990 @table @option
991 @item b (@emph{-b})
992 Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
993 option is expressed in kilobits/s. Default value is 128k.
994
995 @item q (@emph{-V})
996 Set quality for experimental VBR support. Maximum value range is
997 from -50 to 50, useful range is from -10 to 10. The higher the
998 value, the better the quality. This option is valid only using the
999 @command{ffmpeg} command-line tool. For library interface users,
1000 use @option{global_quality}.
1001
1002 @item mode (@emph{--mode})
1003 Set the mode of the resulting audio. Possible values:
1004
1005 @table @samp
1006 @item auto
1007 Choose mode automatically based on the input. This is the default.
1008 @item stereo
1009 Stereo
1010 @item joint_stereo
1011 Joint stereo
1012 @item dual_channel
1013 Dual channel
1014 @item mono
1015 Mono
1016 @end table
1017
1018 @item psymodel (@emph{--psyc-mode})
1019 Set psychoacoustic model to use in encoding. The argument must be
1020 an integer between -1 and 4, inclusive. The higher the value, the
1021 better the quality. The default value is 3.
1022
1023 @item energy_levels (@emph{--energy})
1024 Enable energy levels extensions when set to 1. The default value is
1025 0 (disabled).
1026
1027 @item error_protection (@emph{--protect})
1028 Enable CRC error protection when set to 1. The default value is 0
1029 (disabled).
1030
1031 @item copyright (@emph{--copyright})
1032 Set MPEG audio copyright flag when set to 1. The default value is 0
1033 (disabled).
1034
1035 @item original (@emph{--original})
1036 Set MPEG audio original flag when set to 1. The default value is 0
1037 (disabled).
1038
1039 @end table
1040
1041 @anchor{libvo-aacenc}
1042 @section libvo-aacenc
1043
1044 VisualOn AAC encoder.
1045
1046 Requires the presence of the libvo-aacenc headers and library during
1047 configuration. You need to explicitly configure the build with
1048 @code{--enable-libvo-aacenc --enable-version3}.
1049
1050 This encoder is considered to be worse than the
1051 @ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
1052 multiple sources.
1053
1054 @subsection Options
1055
1056 The VisualOn AAC encoder only support encoding AAC-LC and up to 2
1057 channels. It is also CBR-only.
1058
1059 @table @option
1060
1061 @item b
1062 Set bit rate in bits/s.
1063
1064 @end table
1065
1066 @section libvo-amrwbenc
1067
1068 VisualOn Adaptive Multi-Rate Wideband encoder.
1069
1070 Requires the presence of the libvo-amrwbenc headers and library during
1071 configuration. You need to explicitly configure the build with
1072 @code{--enable-libvo-amrwbenc --enable-version3}.
1073
1074 This is a mono-only encoder. Officially it only supports 16000Hz sample
1075 rate, but you can override it by setting @option{strict} to
1076 @samp{unofficial} or lower.
1077
1078 @subsection Options
1079
1080 @table @option
1081
1082 @item b
1083 Set bitrate in bits/s. Only the following bitrates are supported, otherwise
1084 libavcodec will round to the nearest valid bitrate.
1085
1086 @table @samp
1087 @item 6600
1088 @item 8850
1089 @item 12650
1090 @item 14250
1091 @item 15850
1092 @item 18250
1093 @item 19850
1094 @item 23050
1095 @item 23850
1096 @end table
1097
1098 @item dtx
1099 Allow discontinuous transmission (generate comfort noise) when set to 1. The
1100 default value is 0 (disabled).
1101
1102 @end table
1103
1104 @section libopus
1105
1106 libopus Opus Interactive Audio Codec encoder wrapper.
1107
1108 Requires the presence of the libopus headers and library during
1109 configuration. You need to explicitly configure the build with
1110 @code{--enable-libopus}.
1111
1112 @subsection Option Mapping
1113
1114 Most libopus options are modelled after the @command{opusenc} utility from
1115 opus-tools. The following is an option mapping chart describing options
1116 supported by the libopus wrapper, and their @command{opusenc}-equivalent
1117 in parentheses.
1118
1119 @table @option
1120
1121 @item b (@emph{bitrate})
1122 Set the bit rate in bits/s.  FFmpeg's @option{b} option is
1123 expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
1124 kilobits/s.
1125
1126 @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
1127 Set VBR mode. The FFmpeg @option{vbr} option has the following
1128 valid arguments, with the their @command{opusenc} equivalent options
1129 in parentheses:
1130
1131 @table @samp
1132 @item off (@emph{hard-cbr})
1133 Use constant bit rate encoding.
1134
1135 @item on (@emph{vbr})
1136 Use variable bit rate encoding (the default).
1137
1138 @item constrained (@emph{cvbr})
1139 Use constrained variable bit rate encoding.
1140 @end table
1141
1142 @item compression_level (@emph{comp})
1143 Set encoding algorithm complexity. Valid options are integers in
1144 the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
1145 gives the highest quality but slowest encoding. The default is 10.
1146
1147 @item frame_duration (@emph{framesize})
1148 Set maximum frame size, or duration of a frame in milliseconds. The
1149 argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
1150 frame sizes achieve lower latency but less quality at a given bitrate.
1151 Sizes greater than 20ms are only interesting at fairly low bitrates.
1152 The default is 20ms.
1153
1154 @item packet_loss (@emph{expect-loss})
1155 Set expected packet loss percentage. The default is 0.
1156
1157 @item application (N.A.)
1158 Set intended application type. Valid options are listed below:
1159
1160 @table @samp
1161 @item voip
1162 Favor improved speech intelligibility.
1163 @item audio
1164 Favor faithfulness to the input (the default).
1165 @item lowdelay
1166 Restrict to only the lowest delay modes.
1167 @end table
1168
1169 @item cutoff (N.A.)
1170 Set cutoff bandwidth in Hz. The argument must be exactly one of the
1171 following: 4000, 6000, 8000, 12000, or 20000, corresponding to
1172 narrowband, mediumband, wideband, super wideband, and fullband
1173 respectively. The default is 0 (cutoff disabled).
1174
1175 @end table
1176
1177 @section libvorbis
1178
1179 libvorbis encoder wrapper.
1180
1181 Requires the presence of the libvorbisenc headers and library during
1182 configuration. You need to explicitly configure the build with
1183 @code{--enable-libvorbis}.
1184
1185 @subsection Options
1186
1187 The following options are supported by the libvorbis wrapper. The
1188 @command{oggenc}-equivalent of the options are listed in parentheses.
1189
1190 To get a more accurate and extensive documentation of the libvorbis
1191 options, consult the libvorbisenc's and @command{oggenc}'s documentations.
1192 See @url{http://xiph.org/vorbis/},
1193 @url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
1194
1195 @table @option
1196 @item b (@emph{-b})
1197 Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
1198 expressed in kilobits/s.
1199
1200 @item q (@emph{-q})
1201 Set constant quality setting for VBR. The value should be a float
1202 number in the range of -1.0 to 10.0. The higher the value, the better
1203 the quality. The default value is @samp{3.0}.
1204
1205 This option is valid only using the @command{ffmpeg} command-line tool.
1206 For library interface users, use @option{global_quality}.
1207
1208 @item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
1209 Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
1210 related option is expressed in kHz. The default value is @samp{0} (cutoff
1211 disabled).
1212
1213 @item minrate (@emph{-m})
1214 Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
1215 expressed in kilobits/s.
1216
1217 @item maxrate (@emph{-M})
1218 Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
1219 expressed in kilobits/s. This only has effect on ABR mode.
1220
1221 @item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
1222 Set noise floor bias for impulse blocks. The value is a float number from
1223 -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
1224 to the crispness of transients in the encoded audio. The tradeoff for better
1225 transient response is a higher bitrate.
1226
1227 @end table
1228
1229 @anchor{libwavpack}
1230 @section libwavpack
1231
1232 A wrapper providing WavPack encoding through libwavpack.
1233
1234 Only lossless mode using 32-bit integer samples is supported currently.
1235
1236 Requires the presence of the libwavpack headers and library during
1237 configuration. You need to explicitly configure the build with
1238 @code{--enable-libwavpack}.
1239
1240 Note that a libavcodec-native encoder for the WavPack codec exists so users can
1241 encode audios with this codec without using this encoder. See @ref{wavpackenc}.
1242
1243 @subsection Options
1244
1245 @command{wavpack} command line utility's corresponding options are listed in
1246 parentheses, if any.
1247
1248 @table @option
1249 @item frame_size (@emph{--blocksize})
1250 Default is 32768.
1251
1252 @item compression_level
1253 Set speed vs. compression tradeoff. Acceptable arguments are listed below:
1254
1255 @table @samp
1256 @item 0 (@emph{-f})
1257 Fast mode.
1258
1259 @item 1
1260 Normal (default) settings.
1261
1262 @item 2 (@emph{-h})
1263 High quality.
1264
1265 @item 3 (@emph{-hh})
1266 Very high quality.
1267
1268 @item 4-8 (@emph{-hh -x}@var{EXTRAPROC})
1269 Same as @samp{3}, but with extra processing enabled.
1270
1271 @samp{4} is the same as @option{-x2} and @samp{8} is the same as @option{-x6}.
1272
1273 @end table
1274 @end table
1275
1276 @anchor{wavpackenc}
1277 @section wavpack
1278
1279 WavPack lossless audio encoder.
1280
1281 This is a libavcodec-native WavPack encoder. There is also an encoder based on
1282 libwavpack, but there is virtually no reason to use that encoder.
1283
1284 See also @ref{libwavpack}.
1285
1286 @subsection Options
1287
1288 The equivalent options for @command{wavpack} command line utility are listed in
1289 parentheses.
1290
1291 @subsubsection Shared options
1292
1293 The following shared options are effective for this encoder. Only special notes
1294 about this particular encoder will be documented here. For the general meaning
1295 of the options, see @ref{codec-options,,the Codec Options chapter}.
1296
1297 @table @option
1298 @item frame_size (@emph{--blocksize})
1299 For this encoder, the range for this option is between 128 and 131072. Default
1300 is automatically decided based on sample rate and number of channel.
1301
1302 For the complete formula of calculating default, see
1303 @file{libavcodec/wavpackenc.c}.
1304
1305 @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
1306 This option's syntax is consistent with @ref{libwavpack}'s.
1307 @end table
1308
1309 @subsubsection Private options
1310
1311 @table @option
1312 @item joint_stereo (@emph{-j})
1313 Set whether to enable joint stereo. Valid values are:
1314
1315 @table @samp
1316 @item on (@emph{1})
1317 Force mid/side audio encoding.
1318 @item off (@emph{0})
1319 Force left/right audio encoding.
1320 @item auto
1321 Let the encoder decide automatically.
1322 @end table
1323
1324 @item optimize_mono
1325 Set whether to enable optimization for mono. This option is only effective for
1326 non-mono streams. Available values:
1327
1328 @table @samp
1329 @item on
1330 enabled
1331 @item off
1332 disabled
1333 @end table
1334
1335 @end table
1336
1337 @c man end AUDIO ENCODERS
1338
1339 @chapter Video Encoders
1340 @c man begin VIDEO ENCODERS
1341
1342 A description of some of the currently available video encoders
1343 follows.
1344
1345 @section jpeg2000
1346
1347 The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
1348 option can be used to set the encoding quality. Lossless encoding
1349 can be selected with @code{-pred 1}.
1350
1351 @subsection Options
1352
1353 @table @option
1354 @item format
1355 Can be set to either @code{j2k} or @code{jp2} (the default) that
1356 allows to store non-rgb pix_fmts.
1357
1358 @end table
1359
1360 @section libtheora
1361
1362 libtheora Theora encoder wrapper.
1363
1364 Requires the presence of the libtheora headers and library during
1365 configuration. You need to explicitly configure the build with
1366 @code{--enable-libtheora}.
1367
1368 For more information about the libtheora project see
1369 @url{http://www.theora.org/}.
1370
1371 @subsection Options
1372
1373 The following global options are mapped to internal libtheora options
1374 which affect the quality and the bitrate of the encoded stream.
1375
1376 @table @option
1377 @item b
1378 Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode.  In
1379 case VBR (Variable Bit Rate) mode is enabled this option is ignored.
1380
1381 @item flags
1382 Used to enable constant quality mode (VBR) encoding through the
1383 @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
1384 modes.
1385
1386 @item g
1387 Set the GOP size.
1388
1389 @item global_quality
1390 Set the global quality as an integer in lambda units.
1391
1392 Only relevant when VBR mode is enabled with @code{flags +qscale}. The
1393 value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
1394 clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
1395 value in the native libtheora range [0-63]. A higher value corresponds
1396 to a higher quality.
1397
1398 @item q
1399 Enable VBR mode when set to a non-negative value, and set constant
1400 quality value as a double floating point value in QP units.
1401
1402 The value is clipped in the [0-10] range, and then multiplied by 6.3
1403 to get a value in the native libtheora range [0-63].
1404
1405 This option is valid only using the @command{ffmpeg} command-line
1406 tool. For library interface users, use @option{global_quality}.
1407 @end table
1408
1409 @subsection Examples
1410
1411 @itemize
1412 @item
1413 Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
1414 @example
1415 ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
1416 @end example
1417
1418 @item
1419 Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
1420 @example
1421 ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
1422 @end example
1423 @end itemize
1424
1425 @section libvpx
1426
1427 VP8/VP9 format supported through libvpx.
1428
1429 Requires the presence of the libvpx headers and library during configuration.
1430 You need to explicitly configure the build with @code{--enable-libvpx}.
1431
1432 @subsection Options
1433
1434 The following options are supported by the libvpx wrapper. The
1435 @command{vpxenc}-equivalent options or values are listed in parentheses
1436 for easy migration.
1437
1438 To reduce the duplication of documentation, only the private options
1439 and some others requiring special attention are documented here. For
1440 the documentation of the undocumented generic options, see
1441 @ref{codec-options,,the Codec Options chapter}.
1442
1443 To get more documentation of the libvpx options, invoke the command
1444 @command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
1445 @command{vpxenc --help}. Further information is available in the libvpx API
1446 documentation.
1447
1448 @table @option
1449
1450 @item b (@emph{target-bitrate})
1451 Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
1452 expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
1453 kilobits/s.
1454
1455 @item g (@emph{kf-max-dist})
1456
1457 @item keyint_min (@emph{kf-min-dist})
1458
1459 @item qmin (@emph{min-q})
1460
1461 @item qmax (@emph{max-q})
1462
1463 @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
1464 Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
1465 specified in milliseconds, the libvpx wrapper converts this value as follows:
1466 @code{buf-sz = bufsize * 1000 / bitrate},
1467 @code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
1468
1469 @item rc_init_occupancy (@emph{buf-initial-sz})
1470 Set number of bits which should be loaded into the rc buffer before decoding
1471 starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
1472 wrapper converts this value as follows:
1473 @code{rc_init_occupancy * 1000 / bitrate}.
1474
1475 @item undershoot-pct
1476 Set datarate undershoot (min) percentage of the target bitrate.
1477
1478 @item overshoot-pct
1479 Set datarate overshoot (max) percentage of the target bitrate.
1480
1481 @item skip_threshold (@emph{drop-frame})
1482
1483 @item qcomp (@emph{bias-pct})
1484
1485 @item maxrate (@emph{maxsection-pct})
1486 Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
1487 percentage of the target bitrate, the libvpx wrapper converts this value as
1488 follows: @code{(maxrate * 100 / bitrate)}.
1489
1490 @item minrate (@emph{minsection-pct})
1491 Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
1492 percentage of the target bitrate, the libvpx wrapper converts this value as
1493 follows: @code{(minrate * 100 / bitrate)}.
1494
1495 @item minrate, maxrate, b @emph{end-usage=cbr}
1496 @code{(minrate == maxrate == bitrate)}.
1497
1498 @item crf (@emph{end-usage=cq}, @emph{cq-level})
1499
1500 @item quality, deadline (@emph{deadline})
1501 @table @samp
1502 @item best
1503 Use best quality deadline. Poorly named and quite slow, this option should be
1504 avoided as it may give worse quality output than good.
1505 @item good
1506 Use good quality deadline. This is a good trade-off between speed and quality
1507 when used with the @option{cpu-used} option.
1508 @item realtime
1509 Use realtime quality deadline.
1510 @end table
1511
1512 @item speed, cpu-used (@emph{cpu-used})
1513 Set quality/speed ratio modifier. Higher values speed up the encode at the cost
1514 of quality.
1515
1516 @item nr (@emph{noise-sensitivity})
1517
1518 @item static-thresh
1519 Set a change threshold on blocks below which they will be skipped by the
1520 encoder.
1521
1522 @item slices (@emph{token-parts})
1523 Note that FFmpeg's @option{slices} option gives the total number of partitions,
1524 while @command{vpxenc}'s @option{token-parts} is given as
1525 @code{log2(partitions)}.
1526
1527 @item max-intra-rate
1528 Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
1529 means unlimited.
1530
1531 @item force_key_frames
1532 @code{VPX_EFLAG_FORCE_KF}
1533
1534 @item Alternate reference frame related
1535 @table @option
1536 @item auto-alt-ref
1537 Enable use of alternate reference frames (2-pass only).
1538 @item arnr-max-frames
1539 Set altref noise reduction max frame count.
1540 @item arnr-type
1541 Set altref noise reduction filter type: backward, forward, centered.
1542 @item arnr-strength
1543 Set altref noise reduction filter strength.
1544 @item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
1545 Set number of frames to look ahead for frametype and ratecontrol.
1546 @end table
1547
1548 @item error-resilient
1549 Enable error resiliency features.
1550
1551 @item VP9-specific options
1552 @table @option
1553 @item lossless
1554 Enable lossless mode.
1555 @item tile-columns
1556 Set number of tile columns to use. Note this is given as
1557 @code{log2(tile_columns)}. For example, 8 tile columns would be requested by
1558 setting the @option{tile-columns} option to 3.
1559 @item tile-rows
1560 Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
1561 For example, 4 tile rows would be requested by setting the @option{tile-rows}
1562 option to 2.
1563 @item frame-parallel
1564 Enable frame parallel decodability features.
1565 @item aq-mode
1566 Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
1567 cyclic refresh).
1568 @item colorspace @emph{color-space}
1569 Set input color space. The VP9 bitstream supports signaling the following
1570 colorspaces:
1571 @table @option
1572 @item @samp{rgb} @emph{sRGB}
1573 @item @samp{bt709} @emph{bt709}
1574 @item @samp{unspecified} @emph{unknown}
1575 @item @samp{bt470bg} @emph{bt601}
1576 @item @samp{smpte170m} @emph{smpte170}
1577 @item @samp{smpte240m} @emph{smpte240}
1578 @item @samp{bt2020_ncl} @emph{bt2020}
1579 @end table
1580 @end table
1581
1582 @end table
1583
1584 For more information about libvpx see:
1585 @url{http://www.webmproject.org/}
1586
1587
1588 @section libwebp
1589
1590 libwebp WebP Image encoder wrapper
1591
1592 libwebp is Google's official encoder for WebP images. It can encode in either
1593 lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
1594 frame. Lossless images are a separate codec developed by Google.
1595
1596 @subsection Pixel Format
1597
1598 Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
1599 to limitations of the format and libwebp. Alpha is supported for either mode.
1600 Because of API limitations, if RGB is passed in when encoding lossy or YUV is
1601 passed in for encoding lossless, the pixel format will automatically be
1602 converted using functions from libwebp. This is not ideal and is done only for
1603 convenience.
1604
1605 @subsection Options
1606
1607 @table @option
1608
1609 @item -lossless @var{boolean}
1610 Enables/Disables use of lossless mode. Default is 0.
1611
1612 @item -compression_level @var{integer}
1613 For lossy, this is a quality/speed tradeoff. Higher values give better quality
1614 for a given size at the cost of increased encoding time. For lossless, this is
1615 a size/speed tradeoff. Higher values give smaller size at the cost of increased
1616 encoding time. More specifically, it controls the number of extra algorithms
1617 and compression tools used, and varies the combination of these tools. This
1618 maps to the @var{method} option in libwebp. The valid range is 0 to 6.
1619 Default is 4.
1620
1621 @item -qscale @var{float}
1622 For lossy encoding, this controls image quality, 0 to 100. For lossless
1623 encoding, this controls the effort and time spent at compressing more. The
1624 default value is 75. Note that for usage via libavcodec, this option is called
1625 @var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
1626
1627 @item -preset @var{type}
1628 Configuration preset. This does some automatic settings based on the general
1629 type of the image.
1630 @table @option
1631 @item none
1632 Do not use a preset.
1633 @item default
1634 Use the encoder default.
1635 @item picture
1636 Digital picture, like portrait, inner shot
1637 @item photo
1638 Outdoor photograph, with natural lighting
1639 @item drawing
1640 Hand or line drawing, with high-contrast details
1641 @item icon
1642 Small-sized colorful images
1643 @item text
1644 Text-like
1645 @end table
1646
1647 @end table
1648
1649 @section libx264, libx264rgb
1650
1651 x264 H.264/MPEG-4 AVC encoder wrapper.
1652
1653 This encoder requires the presence of the libx264 headers and library
1654 during configuration. You need to explicitly configure the build with
1655 @code{--enable-libx264}.
1656
1657 libx264 supports an impressive number of features, including 8x8 and
1658 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
1659 entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
1660 for detail retention (adaptive quantization, psy-RD, psy-trellis).
1661
1662 Many libx264 encoder options are mapped to FFmpeg global codec
1663 options, while unique encoder options are provided through private
1664 options. Additionally the @option{x264opts} and @option{x264-params}
1665 private options allows one to pass a list of key=value tuples as accepted
1666 by the libx264 @code{x264_param_parse} function.
1667
1668 The x264 project website is at
1669 @url{http://www.videolan.org/developers/x264.html}.
1670
1671 The libx264rgb encoder is the same as libx264, except it accepts packed RGB
1672 pixel formats as input instead of YUV.
1673
1674 @subsection Supported Pixel Formats
1675
1676 x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
1677 x264's configure time. FFmpeg only supports one bit depth in one particular
1678 build. In other words, it is not possible to build one FFmpeg with multiple
1679 versions of x264 with different bit depths.
1680
1681 @subsection Options
1682
1683 The following options are supported by the libx264 wrapper. The
1684 @command{x264}-equivalent options or values are listed in parentheses
1685 for easy migration.
1686
1687 To reduce the duplication of documentation, only the private options
1688 and some others requiring special attention are documented here. For
1689 the documentation of the undocumented generic options, see
1690 @ref{codec-options,,the Codec Options chapter}.
1691
1692 To get a more accurate and extensive documentation of the libx264
1693 options, invoke the command @command{x264 --full-help} or consult
1694 the libx264 documentation.
1695
1696 @table @option
1697 @item b (@emph{bitrate})
1698 Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
1699 expressed in bits/s, while @command{x264}'s @option{bitrate} is in
1700 kilobits/s.
1701
1702 @item bf (@emph{bframes})
1703
1704 @item g (@emph{keyint})
1705
1706 @item qmin (@emph{qpmin})
1707 Minimum quantizer scale.
1708
1709 @item qmax (@emph{qpmax})
1710 Maximum quantizer scale.
1711
1712 @item qdiff (@emph{qpstep})
1713 Maximum difference between quantizer scales.
1714
1715 @item qblur (@emph{qblur})
1716 Quantizer curve blur
1717
1718 @item qcomp (@emph{qcomp})
1719 Quantizer curve compression factor
1720
1721 @item refs (@emph{ref})
1722 Number of reference frames each P-frame can use. The range is from @var{0-16}.
1723
1724 @item sc_threshold (@emph{scenecut})
1725 Sets the threshold for the scene change detection.
1726
1727 @item trellis (@emph{trellis})
1728 Performs Trellis quantization to increase efficiency. Enabled by default.
1729
1730 @item nr  (@emph{nr})
1731
1732 @item me_range (@emph{merange})
1733 Maximum range of the motion search in pixels.
1734
1735 @item me_method (@emph{me})
1736 Set motion estimation method. Possible values in the decreasing order
1737 of speed:
1738
1739 @table @samp
1740 @item dia (@emph{dia})
1741 @item epzs (@emph{dia})
1742 Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
1743 @samp{dia}.
1744 @item hex (@emph{hex})
1745 Hexagonal search with radius 2.
1746 @item umh (@emph{umh})
1747 Uneven multi-hexagon search.
1748 @item esa (@emph{esa})
1749 Exhaustive search.
1750 @item tesa (@emph{tesa})
1751 Hadamard exhaustive search (slowest).
1752 @end table
1753
1754 @item subq (@emph{subme})
1755 Sub-pixel motion estimation method.
1756
1757 @item b_strategy (@emph{b-adapt})
1758 Adaptive B-frame placement decision algorithm. Use only on first-pass.
1759
1760 @item keyint_min (@emph{min-keyint})
1761 Minimum GOP size.
1762
1763 @item coder
1764 Set entropy encoder. Possible values:
1765
1766 @table @samp
1767 @item ac
1768 Enable CABAC.
1769
1770 @item vlc
1771 Enable CAVLC and disable CABAC. It generates the same effect as
1772 @command{x264}'s @option{--no-cabac} option.
1773 @end table
1774
1775 @item cmp
1776 Set full pixel motion estimation comparation algorithm. Possible values:
1777
1778 @table @samp
1779 @item chroma
1780 Enable chroma in motion estimation.
1781
1782 @item sad
1783 Ignore chroma in motion estimation. It generates the same effect as
1784 @command{x264}'s @option{--no-chroma-me} option.
1785 @end table
1786
1787 @item threads (@emph{threads})
1788 Number of encoding threads.
1789
1790 @item thread_type
1791 Set multithreading technique. Possible values:
1792
1793 @table @samp
1794 @item slice
1795 Slice-based multithreading. It generates the same effect as
1796 @command{x264}'s @option{--sliced-threads} option.
1797 @item frame
1798 Frame-based multithreading.
1799 @end table
1800
1801 @item flags
1802 Set encoding flags. It can be used to disable closed GOP and enable
1803 open GOP by setting it to @code{-cgop}. The result is similar to
1804 the behavior of @command{x264}'s @option{--open-gop} option.
1805
1806 @item rc_init_occupancy (@emph{vbv-init})
1807
1808 @item preset (@emph{preset})
1809 Set the encoding preset.
1810
1811 @item tune (@emph{tune})
1812 Set tuning of the encoding params.
1813
1814 @item profile (@emph{profile})
1815 Set profile restrictions.
1816
1817 @item fastfirstpass
1818 Enable fast settings when encoding first pass, when set to 1. When set
1819 to 0, it has the same effect of @command{x264}'s
1820 @option{--slow-firstpass} option.
1821
1822 @item crf (@emph{crf})
1823 Set the quality for constant quality mode.
1824
1825 @item crf_max (@emph{crf-max})
1826 In CRF mode, prevents VBV from lowering quality beyond this point.
1827
1828 @item qp (@emph{qp})
1829 Set constant quantization rate control method parameter.
1830
1831 @item aq-mode (@emph{aq-mode})
1832 Set AQ method. Possible values:
1833
1834 @table @samp
1835 @item none (@emph{0})
1836 Disabled.
1837
1838 @item variance (@emph{1})
1839 Variance AQ (complexity mask).
1840
1841 @item autovariance (@emph{2})
1842 Auto-variance AQ (experimental).
1843 @end table
1844
1845 @item aq-strength (@emph{aq-strength})
1846 Set AQ strength, reduce blocking and blurring in flat and textured areas.
1847
1848 @item psy
1849 Use psychovisual optimizations when set to 1. When set to 0, it has the
1850 same effect as @command{x264}'s @option{--no-psy} option.
1851
1852 @item psy-rd  (@emph{psy-rd})
1853 Set strength of psychovisual optimization, in
1854 @var{psy-rd}:@var{psy-trellis} format.
1855
1856 @item rc-lookahead (@emph{rc-lookahead})
1857 Set number of frames to look ahead for frametype and ratecontrol.
1858
1859 @item weightb
1860 Enable weighted prediction for B-frames when set to 1. When set to 0,
1861 it has the same effect as @command{x264}'s @option{--no-weightb} option.
1862
1863 @item weightp (@emph{weightp})
1864 Set weighted prediction method for P-frames. Possible values:
1865
1866 @table @samp
1867 @item none (@emph{0})
1868 Disabled
1869 @item simple (@emph{1})
1870 Enable only weighted refs
1871 @item smart (@emph{2})
1872 Enable both weighted refs and duplicates
1873 @end table
1874
1875 @item ssim (@emph{ssim})
1876 Enable calculation and printing SSIM stats after the encoding.
1877
1878 @item intra-refresh (@emph{intra-refresh})
1879 Enable the use of Periodic Intra Refresh instead of IDR frames when set
1880 to 1.
1881
1882 @item avcintra-class (@emph{class})
1883 Configure the encoder to generate AVC-Intra.
1884 Valid values are 50,100 and 200
1885
1886 @item bluray-compat (@emph{bluray-compat})
1887 Configure the encoder to be compatible with the bluray standard.
1888 It is a shorthand for setting "bluray-compat=1 force-cfr=1".
1889
1890 @item b-bias (@emph{b-bias})
1891 Set the influence on how often B-frames are used.
1892
1893 @item b-pyramid (@emph{b-pyramid})
1894 Set method for keeping of some B-frames as references. Possible values:
1895
1896 @table @samp
1897 @item none (@emph{none})
1898 Disabled.
1899 @item strict (@emph{strict})
1900 Strictly hierarchical pyramid.
1901 @item normal (@emph{normal})
1902 Non-strict (not Blu-ray compatible).
1903 @end table
1904
1905 @item mixed-refs
1906 Enable the use of one reference per partition, as opposed to one
1907 reference per macroblock when set to 1. When set to 0, it has the
1908 same effect as @command{x264}'s @option{--no-mixed-refs} option.
1909
1910 @item 8x8dct
1911 Enable adaptive spatial transform (high profile 8x8 transform)
1912 when set to 1. When set to 0, it has the same effect as
1913 @command{x264}'s @option{--no-8x8dct} option.
1914
1915 @item fast-pskip
1916 Enable early SKIP detection on P-frames when set to 1. When set
1917 to 0, it has the same effect as @command{x264}'s
1918 @option{--no-fast-pskip} option.
1919
1920 @item aud (@emph{aud})
1921 Enable use of access unit delimiters when set to 1.
1922
1923 @item mbtree
1924 Enable use macroblock tree ratecontrol when set to 1. When set
1925 to 0, it has the same effect as @command{x264}'s
1926 @option{--no-mbtree} option.
1927
1928 @item deblock (@emph{deblock})
1929 Set loop filter parameters, in @var{alpha}:@var{beta} form.
1930
1931 @item cplxblur (@emph{cplxblur})
1932 Set fluctuations reduction in QP (before curve compression).
1933
1934 @item partitions (@emph{partitions})
1935 Set partitions to consider as a comma-separated list of. Possible
1936 values in the list:
1937
1938 @table @samp
1939 @item p8x8
1940 8x8 P-frame partition.
1941 @item p4x4
1942 4x4 P-frame partition.
1943 @item b8x8
1944 4x4 B-frame partition.
1945 @item i8x8
1946 8x8 I-frame partition.
1947 @item i4x4
1948 4x4 I-frame partition.
1949 (Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
1950 @samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
1951 option) to be enabled.)
1952 @item none (@emph{none})
1953 Do not consider any partitions.
1954 @item all (@emph{all})
1955 Consider every partition.
1956 @end table
1957
1958 @item direct-pred (@emph{direct})
1959 Set direct MV prediction mode. Possible values:
1960
1961 @table @samp
1962 @item none (@emph{none})
1963 Disable MV prediction.
1964 @item spatial (@emph{spatial})
1965 Enable spatial predicting.
1966 @item temporal (@emph{temporal})
1967 Enable temporal predicting.
1968 @item auto (@emph{auto})
1969 Automatically decided.
1970 @end table
1971
1972 @item slice-max-size (@emph{slice-max-size})
1973 Set the limit of the size of each slice in bytes. If not specified
1974 but RTP payload size (@option{ps}) is specified, that is used.
1975
1976 @item stats (@emph{stats})
1977 Set the file name for multi-pass stats.
1978
1979 @item nal-hrd (@emph{nal-hrd})
1980 Set signal HRD information (requires @option{vbv-bufsize} to be set).
1981 Possible values:
1982
1983 @table @samp
1984 @item none (@emph{none})
1985 Disable HRD information signaling.
1986 @item vbr (@emph{vbr})
1987 Variable bit rate.
1988 @item cbr (@emph{cbr})
1989 Constant bit rate (not allowed in MP4 container).
1990 @end table
1991
1992 @item x264opts (N.A.)
1993 Set any x264 option, see @command{x264 --fullhelp} for a list.
1994
1995 Argument is a list of @var{key}=@var{value} couples separated by
1996 ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
1997 themselves, use "," instead. They accept it as well since long ago but this
1998 is kept undocumented for some reason.
1999
2000 For example to specify libx264 encoding options with @command{ffmpeg}:
2001 @example
2002 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
2003 @end example
2004
2005 @item x264-params (N.A.)
2006 Override the x264 configuration using a :-separated list of key=value
2007 parameters.
2008
2009 This option is functionally the same as the @option{x264opts}, but is
2010 duplicated for compatibility with the Libav fork.
2011
2012 For example to specify libx264 encoding options with @command{ffmpeg}:
2013 @example
2014 ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
2015 cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
2016 no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
2017 @end example
2018 @end table
2019
2020 Encoding ffpresets for common usages are provided so they can be used with the
2021 general presets system (e.g. passing the @option{pre} option).
2022
2023 @section libx265
2024
2025 x265 H.265/HEVC encoder wrapper.
2026
2027 This encoder requires the presence of the libx265 headers and library
2028 during configuration. You need to explicitly configure the build with
2029 @option{--enable-libx265}.
2030
2031 @subsection Options
2032
2033 @table @option
2034 @item preset
2035 Set the x265 preset.
2036
2037 @item tune
2038 Set the x265 tune parameter.
2039
2040 @item x265-params
2041 Set x265 options using a list of @var{key}=@var{value} couples separated
2042 by ":". See @command{x265 --help} for a list of options.
2043
2044 For example to specify libx265 encoding options with @option{-x265-params}:
2045
2046 @example
2047 ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
2048 @end example
2049 @end table
2050
2051 @section libxvid
2052
2053 Xvid MPEG-4 Part 2 encoder wrapper.
2054
2055 This encoder requires the presence of the libxvidcore headers and library
2056 during configuration. You need to explicitly configure the build with
2057 @code{--enable-libxvid --enable-gpl}.
2058
2059 The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
2060 users can encode to this format without this library.
2061
2062 @subsection Options
2063
2064 The following options are supported by the libxvid wrapper. Some of
2065 the following options are listed but are not documented, and
2066 correspond to shared codec options. See @ref{codec-options,,the Codec
2067 Options chapter} for their documentation. The other shared options
2068 which are not listed have no effect for the libxvid encoder.
2069
2070 @table @option
2071 @item b
2072
2073 @item g
2074
2075 @item qmin
2076
2077 @item qmax
2078
2079 @item mpeg_quant
2080
2081 @item threads
2082
2083 @item bf
2084
2085 @item b_qfactor
2086
2087 @item b_qoffset
2088
2089 @item flags
2090 Set specific encoding flags. Possible values:
2091
2092 @table @samp
2093
2094 @item mv4
2095 Use four motion vector by macroblock.
2096
2097 @item aic
2098 Enable high quality AC prediction.
2099
2100 @item gray
2101 Only encode grayscale.
2102
2103 @item gmc
2104 Enable the use of global motion compensation (GMC).
2105
2106 @item qpel
2107 Enable quarter-pixel motion compensation.
2108
2109 @item cgop
2110 Enable closed GOP.
2111
2112 @item global_header
2113 Place global headers in extradata instead of every keyframe.
2114
2115 @end table
2116
2117 @item trellis
2118
2119 @item me_method
2120 Set motion estimation method. Possible values in decreasing order of
2121 speed and increasing order of quality:
2122
2123 @table @samp
2124 @item zero
2125 Use no motion estimation (default).
2126
2127 @item phods
2128 @item x1
2129 @item log
2130 Enable advanced diamond zonal search for 16x16 blocks and half-pixel
2131 refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
2132 @samp{phods}.
2133
2134 @item epzs
2135 Enable all of the things described above, plus advanced diamond zonal
2136 search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
2137 estimation on chroma planes.
2138
2139 @item full
2140 Enable all of the things described above, plus extended 16x16 and 8x8
2141 blocks search.
2142 @end table
2143
2144 @item mbd
2145 Set macroblock decision algorithm. Possible values in the increasing
2146 order of quality:
2147
2148 @table @samp
2149 @item simple
2150 Use macroblock comparing function algorithm (default).
2151
2152 @item bits
2153 Enable rate distortion-based half pixel and quarter pixel refinement for
2154 16x16 blocks.
2155
2156 @item rd
2157 Enable all of the things described above, plus rate distortion-based
2158 half pixel and quarter pixel refinement for 8x8 blocks, and rate
2159 distortion-based search using square pattern.
2160 @end table
2161
2162 @item lumi_aq
2163 Enable lumi masking adaptive quantization when set to 1. Default is 0
2164 (disabled).
2165
2166 @item variance_aq
2167 Enable variance adaptive quantization when set to 1. Default is 0
2168 (disabled).
2169
2170 When combined with @option{lumi_aq}, the resulting quality will not
2171 be better than any of the two specified individually. In other
2172 words, the resulting quality will be the worse one of the two
2173 effects.
2174
2175 @item ssim
2176 Set structural similarity (SSIM) displaying method. Possible values:
2177
2178 @table @samp
2179 @item off
2180 Disable displaying of SSIM information.
2181
2182 @item avg
2183 Output average SSIM at the end of encoding to stdout. The format of
2184 showing the average SSIM is:
2185
2186 @example
2187 Average SSIM: %f
2188 @end example
2189
2190 For users who are not familiar with C, %f means a float number, or
2191 a decimal (e.g. 0.939232).
2192
2193 @item frame
2194 Output both per-frame SSIM data during encoding and average SSIM at
2195 the end of encoding to stdout. The format of per-frame information
2196 is:
2197
2198 @example
2199        SSIM: avg: %1.3f min: %1.3f max: %1.3f
2200 @end example
2201
2202 For users who are not familiar with C, %1.3f means a float number
2203 rounded to 3 digits after the dot (e.g. 0.932).
2204
2205 @end table
2206
2207 @item ssim_acc
2208 Set SSIM accuracy. Valid options are integers within the range of
2209 0-4, while 0 gives the most accurate result and 4 computes the
2210 fastest.
2211
2212 @end table
2213
2214 @section mpeg2
2215
2216 MPEG-2 video encoder.
2217
2218 @subsection Options
2219
2220 @table @option
2221 @item seq_disp_ext @var{integer}
2222 Specifies if the encoder should write a sequence_display_extension to the
2223 output.
2224 @table @option
2225 @item -1
2226 @itemx auto
2227 Decide automatically to write it or not (this is the default) by checking if
2228 the data to be written is different from the default or unspecified values.
2229 @item 0
2230 @itemx never
2231 Never write it.
2232 @item 1
2233 @itemx always
2234 Always write it.
2235 @end table
2236 @end table
2237
2238 @section png
2239
2240 PNG image encoder.
2241
2242 @subsection Private options
2243
2244 @table @option
2245 @item dpi @var{integer}
2246 Set physical density of pixels, in dots per inch, unset by default
2247 @item dpm @var{integer}
2248 Set physical density of pixels, in dots per meter, unset by default
2249 @end table
2250
2251 @section ProRes
2252
2253 Apple ProRes encoder.
2254
2255 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
2256 The used encoder can be chosen with the @code{-vcodec} option.
2257
2258 @subsection Private Options for prores-ks
2259
2260 @table @option
2261 @item profile @var{integer}
2262 Select the ProRes profile to encode
2263 @table @samp
2264 @item proxy
2265 @item lt
2266 @item standard
2267 @item hq
2268 @item 4444
2269 @end table
2270
2271 @item quant_mat @var{integer}
2272 Select quantization matrix.
2273 @table @samp
2274 @item auto
2275 @item default
2276 @item proxy
2277 @item lt
2278 @item standard
2279 @item hq
2280 @end table
2281 If set to @var{auto}, the matrix matching the profile will be picked.
2282 If not set, the matrix providing the highest quality, @var{default}, will be
2283 picked.
2284
2285 @item bits_per_mb @var{integer}
2286 How many bits to allot for coding one macroblock. Different profiles use
2287 between 200 and 2400 bits per macroblock, the maximum is 8000.
2288
2289 @item mbs_per_slice @var{integer}
2290 Number of macroblocks in each slice (1-8); the default value (8)
2291 should be good in almost all situations.
2292
2293 @item vendor @var{string}
2294 Override the 4-byte vendor ID.
2295 A custom vendor ID like @var{apl0} would claim the stream was produced by
2296 the Apple encoder.
2297
2298 @item alpha_bits @var{integer}
2299 Specify number of bits for alpha component.
2300 Possible values are @var{0}, @var{8} and @var{16}.
2301 Use @var{0} to disable alpha plane coding.
2302
2303 @end table
2304
2305 @subsection Speed considerations
2306
2307 In the default mode of operation the encoder has to honor frame constraints
2308 (i.e. not produce frames with size bigger than requested) while still making
2309 output picture as good as possible.
2310 A frame containing a lot of small details is harder to compress and the encoder
2311 would spend more time searching for appropriate quantizers for each slice.
2312
2313 Setting a higher @option{bits_per_mb} limit will improve the speed.
2314
2315 For the fastest encoding speed set the @option{qscale} parameter (4 is the
2316 recommended value) and do not set a size constraint.
2317
2318 @section libkvazaar
2319
2320 Kvazaar H.265/HEVC encoder.
2321
2322 Requires the presence of the libkvazaar headers and library during
2323 configuration. You need to explicitly configure the build with
2324 @option{--enable-libkvazaar}.
2325
2326 @subsection Options
2327
2328 @table @option
2329
2330 @item b
2331 Set target video bitrate in bit/s and enable rate control.
2332
2333 @item threads
2334 Set number of encoding threads.
2335
2336 @item kvazaar-params
2337 Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
2338 by commas (,). See kvazaar documentation for a list of options.
2339
2340 @end table
2341
2342 @c man end VIDEO ENCODERS
2343
2344 @chapter Subtitles Encoders
2345 @c man begin SUBTITLES ENCODERS
2346
2347 @section dvdsub
2348
2349 This codec encodes the bitmap subtitle format that is used in DVDs.
2350 Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
2351 and they can also be used in Matroska files.
2352
2353 @subsection Options
2354
2355 @table @option
2356 @item even_rows_fix
2357 When set to 1, enable a work-around that makes the number of pixel rows
2358 even in all subtitles.  This fixes a problem with some players that
2359 cut off the bottom row if the number is odd.  The work-around just adds
2360 a fully transparent row if needed.  The overhead is low, typically
2361 one byte per subtitle on average.
2362
2363 By default, this work-around is disabled.
2364 @end table
2365
2366 @c man end SUBTITLES ENCODERS