]> git.sesse.net Git - ffmpeg/blob - doc/encoders.texi
cosmetics: Fix "dont" "wont" "doesnt" typos
[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 @section ac3 and ac3_fixed
29
30 AC-3 audio encoders.
31
32 These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
33 the undocumented RealAudio 3 (a.k.a. dnet).
34
35 The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
36 encoder only uses fixed-point integer math. This does not mean that one is
37 always faster, just that one or the other may be better suited to a
38 particular system. The floating-point encoder will generally produce better
39 quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
40 default codec for any of the output formats, so it must be specified explicitly
41 using the option @code{-acodec ac3_fixed} in order to use it.
42
43 @subsection AC-3 Metadata
44
45 The AC-3 metadata options are used to set parameters that describe the audio,
46 but in most cases do not affect the audio encoding itself. Some of the options
47 do directly affect or influence the decoding and playback of the resulting
48 bitstream, while others are just for informational purposes. A few of the
49 options will add bits to the output stream that could otherwise be used for
50 audio data, and will thus affect the quality of the output. Those will be
51 indicated accordingly with a note in the option list below.
52
53 These parameters are described in detail in several publicly-available
54 documents.
55 @itemize
56 @item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
57 @item @uref{http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf,A/54 - Guide to the Use of the ATSC Digital Television Standard}
58 @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
59 @item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
60 @end itemize
61
62 @subsubsection Metadata Control Options
63
64 @table @option
65
66 @item -per_frame_metadata @var{boolean}
67 Allow Per-Frame Metadata. Specifies if the encoder should check for changing
68 metadata for each frame.
69 @table @option
70 @item 0
71 The metadata values set at initialization will be used for every frame in the
72 stream. (default)
73 @item 1
74 Metadata values can be changed before encoding each frame.
75 @end table
76
77 @end table
78
79 @subsubsection Downmix Levels
80
81 @table @option
82
83 @item -center_mixlev @var{level}
84 Center Mix Level. The amount of gain the decoder should apply to the center
85 channel when downmixing to stereo. This field will only be written to the
86 bitstream if a center channel is present. The value is specified as a scale
87 factor. There are 3 valid values:
88 @table @option
89 @item 0.707
90 Apply -3dB gain
91 @item 0.595
92 Apply -4.5dB gain (default)
93 @item 0.500
94 Apply -6dB gain
95 @end table
96
97 @item -surround_mixlev @var{level}
98 Surround Mix Level. The amount of gain the decoder should apply to the surround
99 channel(s) when downmixing to stereo. This field will only be written to the
100 bitstream if one or more surround channels are present. The value is specified
101 as a scale factor.  There are 3 valid values:
102 @table @option
103 @item 0.707
104 Apply -3dB gain
105 @item 0.500
106 Apply -6dB gain (default)
107 @item 0.000
108 Silence Surround Channel(s)
109 @end table
110
111 @end table
112
113 @subsubsection Audio Production Information
114 Audio Production Information is optional information describing the mixing
115 environment.  Either none or both of the fields are written to the bitstream.
116
117 @table @option
118
119 @item -mixing_level @var{number}
120 Mixing Level. Specifies peak sound pressure level (SPL) in the production
121 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
122 unknown or not indicated. The default value is -1, but that value cannot be
123 used if the Audio Production Information is written to the bitstream. Therefore,
124 if the @code{room_type} option is not the default value, the @code{mixing_level}
125 option must not be -1.
126
127 @item -room_type @var{type}
128 Room Type. Describes the equalization used during the final mixing session at
129 the studio or on the dubbing stage. A large room is a dubbing stage with the
130 industry standard X-curve equalization; a small room has flat equalization.
131 This field will not be written to the bitstream if both the @code{mixing_level}
132 option and the @code{room_type} option have the default values.
133 @table @option
134 @item 0
135 @itemx notindicated
136 Not Indicated (default)
137 @item 1
138 @itemx large
139 Large Room
140 @item 2
141 @itemx small
142 Small Room
143 @end table
144
145 @end table
146
147 @subsubsection Other Metadata Options
148
149 @table @option
150
151 @item -copyright @var{boolean}
152 Copyright Indicator. Specifies whether a copyright exists for this audio.
153 @table @option
154 @item 0
155 @itemx off
156 No Copyright Exists (default)
157 @item 1
158 @itemx on
159 Copyright Exists
160 @end table
161
162 @item -dialnorm @var{value}
163 Dialogue Normalization. Indicates how far the average dialogue level of the
164 program is below digital 100% full scale (0 dBFS). This parameter determines a
165 level shift during audio reproduction that sets the average volume of the
166 dialogue to a preset level. The goal is to match volume level between program
167 sources. A value of -31dB will result in no volume level change, relative to
168 the source volume, during audio reproduction. Valid values are whole numbers in
169 the range -31 to -1, with -31 being the default.
170
171 @item -dsur_mode @var{mode}
172 Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
173 (Pro Logic). This field will only be written to the bitstream if the audio
174 stream is stereo. Using this option does @b{NOT} mean the encoder will actually
175 apply Dolby Surround processing.
176 @table @option
177 @item 0
178 @itemx notindicated
179 Not Indicated (default)
180 @item 1
181 @itemx off
182 Not Dolby Surround Encoded
183 @item 2
184 @itemx on
185 Dolby Surround Encoded
186 @end table
187
188 @item -original @var{boolean}
189 Original Bit Stream Indicator. Specifies whether this audio is from the
190 original source and not a copy.
191 @table @option
192 @item 0
193 @itemx off
194 Not Original Source
195 @item 1
196 @itemx on
197 Original Source (default)
198 @end table
199
200 @end table
201
202 @subsection Extended Bitstream Information
203 The extended bitstream options are part of the Alternate Bit Stream Syntax as
204 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
205 If any one parameter in a group is specified, all values in that group will be
206 written to the bitstream.  Default values are used for those that are written
207 but have not been specified.  If the mixing levels are written, the decoder
208 will use these values instead of the ones specified in the @code{center_mixlev}
209 and @code{surround_mixlev} options if it supports the Alternate Bit Stream
210 Syntax.
211
212 @subsubsection Extended Bitstream Information - Part 1
213
214 @table @option
215
216 @item -dmix_mode @var{mode}
217 Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
218 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
219 @table @option
220 @item 0
221 @itemx notindicated
222 Not Indicated (default)
223 @item 1
224 @itemx ltrt
225 Lt/Rt Downmix Preferred
226 @item 2
227 @itemx loro
228 Lo/Ro Downmix Preferred
229 @end table
230
231 @item -ltrt_cmixlev @var{level}
232 Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
233 center channel when downmixing to stereo in Lt/Rt mode.
234 @table @option
235 @item 1.414
236 Apply +3dB gain
237 @item 1.189
238 Apply +1.5dB gain
239 @item 1.000
240 Apply 0dB gain
241 @item 0.841
242 Apply -1.5dB gain
243 @item 0.707
244 Apply -3.0dB gain
245 @item 0.595
246 Apply -4.5dB gain (default)
247 @item 0.500
248 Apply -6.0dB gain
249 @item 0.000
250 Silence Center Channel
251 @end table
252
253 @item -ltrt_surmixlev @var{level}
254 Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
255 surround channel(s) when downmixing to stereo in Lt/Rt mode.
256 @table @option
257 @item 0.841
258 Apply -1.5dB gain
259 @item 0.707
260 Apply -3.0dB gain
261 @item 0.595
262 Apply -4.5dB gain
263 @item 0.500
264 Apply -6.0dB gain (default)
265 @item 0.000
266 Silence Surround Channel(s)
267 @end table
268
269 @item -loro_cmixlev @var{level}
270 Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
271 center channel when downmixing to stereo in Lo/Ro mode.
272 @table @option
273 @item 1.414
274 Apply +3dB gain
275 @item 1.189
276 Apply +1.5dB gain
277 @item 1.000
278 Apply 0dB gain
279 @item 0.841
280 Apply -1.5dB gain
281 @item 0.707
282 Apply -3.0dB gain
283 @item 0.595
284 Apply -4.5dB gain (default)
285 @item 0.500
286 Apply -6.0dB gain
287 @item 0.000
288 Silence Center Channel
289 @end table
290
291 @item -loro_surmixlev @var{level}
292 Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
293 surround channel(s) when downmixing to stereo in Lo/Ro mode.
294 @table @option
295 @item 0.841
296 Apply -1.5dB gain
297 @item 0.707
298 Apply -3.0dB gain
299 @item 0.595
300 Apply -4.5dB gain
301 @item 0.500
302 Apply -6.0dB gain (default)
303 @item 0.000
304 Silence Surround Channel(s)
305 @end table
306
307 @end table
308
309 @subsubsection Extended Bitstream Information - Part 2
310
311 @table @option
312
313 @item -dsurex_mode @var{mode}
314 Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
315 (7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
316 apply Dolby Surround EX processing.
317 @table @option
318 @item 0
319 @itemx notindicated
320 Not Indicated (default)
321 @item 1
322 @itemx on
323 Dolby Surround EX Off
324 @item 2
325 @itemx off
326 Dolby Surround EX On
327 @end table
328
329 @item -dheadphone_mode @var{mode}
330 Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
331 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
332 option does @b{NOT} mean the encoder will actually apply Dolby Headphone
333 processing.
334 @table @option
335 @item 0
336 @itemx notindicated
337 Not Indicated (default)
338 @item 1
339 @itemx on
340 Dolby Headphone Off
341 @item 2
342 @itemx off
343 Dolby Headphone On
344 @end table
345
346 @item -ad_conv_type @var{type}
347 A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
348 conversion.
349 @table @option
350 @item 0
351 @itemx standard
352 Standard A/D Converter (default)
353 @item 1
354 @itemx hdcd
355 HDCD A/D Converter
356 @end table
357
358 @end table
359
360 @subsection Other AC-3 Encoding Options
361
362 @table @option
363
364 @item -stereo_rematrixing @var{boolean}
365 Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
366 is an optional AC-3 feature that increases quality by selectively encoding
367 the left/right channels as mid/side. This option is enabled by default, and it
368 is highly recommended that it be left as enabled except for testing purposes.
369
370 @end table
371
372 @subsection Floating-Point-Only AC-3 Encoding Options
373
374 These options are only valid for the floating-point encoder and do not exist
375 for the fixed-point encoder due to the corresponding features not being
376 implemented in fixed-point.
377
378 @table @option
379
380 @item -channel_coupling @var{boolean}
381 Enables/Disables use of channel coupling, which is an optional AC-3 feature
382 that increases quality by combining high frequency information from multiple
383 channels into a single channel. The per-channel high frequency information is
384 sent with less accuracy in both the frequency and time domains. This allows
385 more bits to be used for lower frequencies while preserving enough information
386 to reconstruct the high frequencies. This option is enabled by default for the
387 floating-point encoder and should generally be left as enabled except for
388 testing purposes or to increase encoding speed.
389 @table @option
390 @item -1
391 @itemx auto
392 Selected by Encoder (default)
393 @item 0
394 @itemx off
395 Disable Channel Coupling
396 @item 1
397 @itemx on
398 Enable Channel Coupling
399 @end table
400
401 @item -cpl_start_band @var{number}
402 Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
403 value higher than the bandwidth is used, it will be reduced to 1 less than the
404 coupling end band. If @var{auto} is used, the start band will be determined by
405 the encoder based on the bit rate, sample rate, and channel layout. This option
406 has no effect if channel coupling is disabled.
407 @table @option
408 @item -1
409 @itemx auto
410 Selected by Encoder (default)
411 @end table
412
413 @end table
414
415 @section libmp3lame
416
417 LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
418
419 Requires the presence of the libmp3lame headers and library during
420 configuration. You need to explicitly configure the build with
421 @code{--enable-libmp3lame}.
422
423 @subsection Option Mapping
424
425 The following options are supported by the libmp3lame wrapper,
426 the LAME-equivalent options follow the FFmpeg ones.
427
428 @multitable @columnfractions .2 .2
429 @item FFmpeg            @tab LAME
430 @item b                 @tab b
431 FFmpeg @code{b} option is expressed in bits/s, lame @code{bitrate}
432 in kilobits/s.
433 @item q                 @tab V
434 Quality setting for VBR.
435 @item compression_level @tab q
436 Algorithm quality. Valid options are integers from 0-9.
437 @item reservoir         @tab N.A.
438 Enable use of bit reservoir. LAME has this enabled by default.
439 @item joint_stereo      @tab -m j
440 Enables the encoder to use (on a frame by frame basis) either L/R
441 stereo or mid/side stereo.
442 @end multitable
443
444 @section libopencore-amrnb
445
446 OpenCORE Adaptive Multi-Rate Narrowband encoder.
447
448 Requires the presence of the libopencore-amrnb headers and library during
449 configuration. You need to explicitly configure the build with
450 @code{--enable-libopencore-amrnb --enable-version3}.
451
452 This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
453 but you can override it by setting @option{strict} to @samp{unofficial} or
454 lower.
455
456 @subsection Options
457
458 @table @option
459
460 @item b
461 Set bitrate in bits per second. Only the following bitrates are supported,
462 otherwise libavcodec will round to the nearest valid bitrate.
463
464 @table @option
465 @item 4750
466 @item 5150
467 @item 5900
468 @item 6700
469 @item 7400
470 @item 7950
471 @item 10200
472 @item 12200
473 @end table
474
475 @item dtx
476 Allow discontinuous transmission (generate comfort noise) when set to 1. The
477 default value is 0 (disabled).
478
479 @end table
480
481 @section libtwolame
482
483 TwoLAME MP2 encoder wrapper.
484
485 Requires the presence of the libtwolame headers and library during
486 configuration. You need to explicitly configure the build with
487 @code{--enable-libtwolame}.
488
489 @subsection Options Mapping
490
491 The following options are supported by the libtwolame wrapper. The
492 TwoLAME-equivalent options follow the FFmpeg ones and are in
493 parentheses.
494
495 @table @option
496 @item b
497 (b) Set bitrate in bits/s. Note that FFmpeg @code{b} option is
498 expressed in bits/s, twolame @code{b} in kilobits/s. The default
499 value is 128k.
500
501 @item q
502 (V) Set quality for experimental VBR support. Maximum value range is
503 from -50 to 50, useful range is from -10 to 10.
504
505 @item mode
506 (mode) Set MPEG mode. Possible values:
507
508 @table @samp
509 @item auto
510 Choose mode automatically based on the input. This is the default.
511 @item stereo
512 Stereo
513 @item joint_stereo
514 Joint stereo
515 @item dual_channel
516 Dual channel
517 @item mono
518 Mono
519 @end table
520
521 @item psymodel
522 (psyc-mode) Set psychoacoustic model to use in encoding. The argument
523 must be an integer between -1 and 4, inclusive. The higher the value,
524 the better the quality. The default value is 3.
525
526 @item energy_levels
527 (energy) Enable energy levels extensions when set to 1. The default
528 value is 0 (disabled).
529
530 @item error_protection
531 (protect) Enable CRC error protection when set to 1. The default value
532 is 0 (disabled).
533
534 @item copyright
535 (copyright) Set MPEG audio copyright flag when set to 1. The default
536 value is 0 (disabled).
537
538 @item original
539 (original) Set MPEG audio original flag when set to 1. The default
540 value is 0 (disabled).
541
542 @end table
543
544 @section libvo-aacenc
545
546 VisualOn AAC encoder.
547
548 Requires the presence of the libvo-aacenc headers and library during
549 configuration. You need to explicitly configure the build with
550 @code{--enable-libvo-aacenc --enable-version3}.
551
552 @subsection Options
553
554 The VisualOn AAC encoder only support encoding AAC-LC and up to 2
555 channels. It is also CBR-only. It is considered to be worse than the
556 native experimental FFmpeg AAC encoder.
557
558 @table @option
559
560 @item b
561 Bitrate.
562
563 @end table
564
565 @section libvo-amrwbenc
566
567 VisualOn Adaptive Multi-Rate Wideband encoder.
568
569 Requires the presence of the libvo-amrwbenc headers and library during
570 configuration. You need to explicitly configure the build with
571 @code{--enable-libvo-amrwbenc --enable-version3}.
572
573 This is a mono-only encoder. Officially it only supports 16000Hz sample
574 rate, but you can override it by setting @option{strict} to
575 @samp{unofficial} or lower.
576
577 @subsection Options
578
579 @table @option
580
581 @item b
582 Set bitrate in bits/s. Only the following bitrates are supported, otherwise
583 libavcodec will round to the nearest valid bitrate.
584
585 @table @samp
586 @item 6600
587 @item 8850
588 @item 12650
589 @item 14250
590 @item 15850
591 @item 18250
592 @item 19850
593 @item 23050
594 @item 23850
595 @end table
596
597 @item dtx
598 Allow discontinuous transmission (generate comfort noise) when set to 1. The
599 default value is 0 (disabled).
600
601 @end table
602
603 @section libwavpack
604
605 A wrapper providing WavPack encoding through libwavpack.
606
607 Only lossless mode using 32-bit integer samples is supported currently.
608 The @option{compression_level} option can be used to control speed vs.
609 compression tradeoff, with the values mapped to libwavpack as follows:
610
611 @table @option
612
613 @item 0
614 Fast mode - corresponding to the wavpack @option{-f} option.
615
616 @item 1
617 Normal (default) settings.
618
619 @item 2
620 High quality - corresponding to the wavpack @option{-h} option.
621
622 @item 3
623 Very high quality - corresponding to the wavpack @option{-hh} option.
624
625 @item 4-8
626 Same as 3, but with extra processing enabled - corresponding to the wavpack
627 @option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
628 @option{-x6}.
629
630 @end table
631
632 @c man end AUDIO ENCODERS
633
634 @chapter Video Encoders
635 @c man begin VIDEO ENCODERS
636
637 A description of some of the currently available video encoders
638 follows.
639
640 @section libtheora
641
642 Theora format supported through libtheora.
643
644 Requires the presence of the libtheora headers and library during
645 configuration. You need to explicitly configure the build with
646 @code{--enable-libtheora}.
647
648 @subsection Options
649
650 The following global options are mapped to internal libtheora options
651 which affect the quality and the bitrate of the encoded stream.
652
653 @table @option
654 @item b
655 Set the video bitrate, only works if the @code{qscale} flag in
656 @option{flags} is not enabled.
657
658 @item flags
659 Used to enable constant quality mode encoding through the
660 @option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
661 modes.
662
663 @item g
664 Set the GOP size.
665
666 @item global_quality
667 Set the global quality in lambda units, only works if the
668 @code{qscale} flag in @option{flags} is enabled. The value is clipped
669 in the [0 - 10*@code{FF_QP2LAMBDA}] range, and then multiplied for 6.3
670 to get a value in the native libtheora range [0-63]. A higher value
671 corresponds to a higher quality.
672
673 For example, to set maximum constant quality encoding with
674 @command{ffmpeg}:
675 @example
676 ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
677 @end example
678 @end table
679
680 @section libvpx
681
682 VP8 format supported through libvpx.
683
684 Requires the presence of the libvpx headers and library during configuration.
685 You need to explicitly configure the build with @code{--enable-libvpx}.
686
687 @subsection Options
688
689 Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
690
691 @table @option
692
693 @item threads
694 g_threads
695
696 @item profile
697 g_profile
698
699 @item vb
700 rc_target_bitrate
701
702 @item g
703 kf_max_dist
704
705 @item keyint_min
706 kf_min_dist
707
708 @item qmin
709 rc_min_quantizer
710
711 @item qmax
712 rc_max_quantizer
713
714 @item bufsize, vb
715 rc_buf_sz
716 @code{(bufsize * 1000 / vb)}
717
718 rc_buf_optimal_sz
719 @code{(bufsize * 1000 / vb * 5 / 6)}
720
721 @item rc_init_occupancy, vb
722 rc_buf_initial_sz
723 @code{(rc_init_occupancy * 1000 / vb)}
724
725 @item rc_buffer_aggressivity
726 rc_undershoot_pct
727
728 @item skip_threshold
729 rc_dropframe_thresh
730
731 @item qcomp
732 rc_2pass_vbr_bias_pct
733
734 @item maxrate, vb
735 rc_2pass_vbr_maxsection_pct
736 @code{(maxrate * 100 / vb)}
737
738 @item minrate, vb
739 rc_2pass_vbr_minsection_pct
740 @code{(minrate * 100 / vb)}
741
742 @item minrate, maxrate, vb
743 @code{VPX_CBR}
744 @code{(minrate == maxrate == vb)}
745
746 @item crf
747 @code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
748
749 @item quality
750 @table @option
751 @item @var{best}
752 @code{VPX_DL_BEST_QUALITY}
753 @item @var{good}
754 @code{VPX_DL_GOOD_QUALITY}
755 @item @var{realtime}
756 @code{VPX_DL_REALTIME}
757 @end table
758
759 @item speed
760 @code{VP8E_SET_CPUUSED}
761
762 @item nr
763 @code{VP8E_SET_NOISE_SENSITIVITY}
764
765 @item mb_threshold
766 @code{VP8E_SET_STATIC_THRESHOLD}
767
768 @item slices
769 @code{VP8E_SET_TOKEN_PARTITIONS}
770
771 @item max-intra-rate
772 @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
773
774 @item force_key_frames
775 @code{VPX_EFLAG_FORCE_KF}
776
777 @item Alternate reference frame related
778 @table @option
779 @item vp8flags altref
780 @code{VP8E_SET_ENABLEAUTOALTREF}
781 @item @var{arnr_max_frames}
782 @code{VP8E_SET_ARNR_MAXFRAMES}
783 @item @var{arnr_type}
784 @code{VP8E_SET_ARNR_TYPE}
785 @item @var{arnr_strength}
786 @code{VP8E_SET_ARNR_STRENGTH}
787 @item @var{rc_lookahead}
788 g_lag_in_frames
789 @end table
790
791 @item vp8flags error_resilient
792 g_error_resilient
793
794 @end table
795
796 For more information about libvpx see:
797 @url{http://www.webmproject.org/}
798
799 @section libx264
800
801 x264 H.264/MPEG-4 AVC encoder wrapper.
802
803 Requires the presence of the libx264 headers and library during
804 configuration. You need to explicitly configure the build with
805 @code{--enable-libx264}.
806
807 x264 supports an impressive number of features, including 8x8 and 4x4 adaptive
808 spatial transform, adaptive B-frame placement, CAVLC/CABAC entropy coding,
809 interlacing (MBAFF), lossless mode, psy optimizations for detail retention
810 (adaptive quantization, psy-RD, psy-trellis).
811
812 The FFmpeg wrapper provides a mapping for most of them using global options
813 that match those of the encoders and provides private options for the unique
814 encoder options. Additionally an expert override is provided to directly pass
815 a list of key=value tuples as accepted by x264_param_parse.
816
817 @subsection Option Mapping
818
819 The following options are supported by the x264 wrapper, the x264-equivalent
820 options follow the FFmpeg ones.
821
822 @multitable @columnfractions .2 .2
823 @item b                 @tab bitrate
824 FFmpeg @code{b} option is expressed in bits/s, x264 @code{bitrate} in kilobits/s.
825 @item bf                @tab bframes
826 Maximum number of B-frames.
827 @item g                 @tab keyint
828 Maximum GOP size.
829 @item qmin              @tab qpmin
830 @item qmax              @tab qpmax
831 @item qdiff             @tab qpstep
832 @item qblur             @tab qblur
833 @item qcomp             @tab qcomp
834 @item refs              @tab ref
835 @item sc_threshold      @tab scenecut
836 @item trellis           @tab trellis
837 @item nr                @tab nr
838 Noise reduction.
839 @item me_range          @tab merange
840 @item me_method         @tab me
841 @item subq              @tab subme
842 @item b_strategy        @tab b-adapt
843 @item keyint_min        @tab keyint-min
844 @item coder             @tab cabac
845 Set coder to @code{ac} to use CABAC.
846 @item cmp               @tab chroma-me
847 Set to @code{chroma} to use chroma motion estimation.
848 @item threads           @tab threads
849 @item thread_type       @tab sliced_threads
850 Set to @code{slice} to use sliced threading instead of frame threading.
851 @item flags -cgop       @tab open-gop
852 Set @code{-cgop} to use recovery points to close GOPs.
853 @item rc_init_occupancy @tab vbv-init
854 Initial buffer occupancy.
855 @end multitable
856
857 @subsection Private Options
858 @table @option
859 @item -preset @var{string}
860 Set the encoding preset (cf. x264 --fullhelp).
861 @item -tune @var{string}
862 Tune the encoding params (cf. x264 --fullhelp).
863 @item -profile @var{string}
864 Set profile restrictions (cf. x264 --fullhelp).
865 @item -fastfirstpass @var{integer}
866 Use fast settings when encoding first pass.
867 @item -crf @var{float}
868 Select the quality for constant quality mode.
869 @item -crf_max @var{float}
870 In CRF mode, prevents VBV from lowering quality beyond this point.
871 @item -qp @var{integer}
872 Constant quantization parameter rate control method.
873 @item -aq-mode @var{integer}
874 AQ method
875
876 Possible values:
877 @table @samp
878 @item none
879
880 @item variance
881 Variance AQ (complexity mask).
882 @item autovariance
883 Auto-variance AQ (experimental).
884 @end table
885 @item -aq-strength @var{float}
886 AQ strength, reduces blocking and blurring in flat and textured areas.
887 @item -psy @var{integer}
888 Use psychovisual optimizations.
889 @item -psy-rd @var{string}
890 Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.
891 @item -rc-lookahead @var{integer}
892 Number of frames to look ahead for frametype and ratecontrol.
893 @item -weightb @var{integer}
894 Weighted prediction for B-frames.
895 @item -weightp @var{integer}
896 Weighted prediction analysis method.
897
898 Possible values:
899 @table @samp
900 @item none
901
902 @item simple
903
904 @item smart
905
906 @end table
907 @item -ssim @var{integer}
908 Calculate and print SSIM stats.
909 @item -intra-refresh @var{integer}
910 Use Periodic Intra Refresh instead of IDR frames.
911 @item -b-bias @var{integer}
912 Influences how often B-frames are used.
913 @item -b-pyramid @var{integer}
914 Keep some B-frames as references.
915
916 Possible values:
917 @table @samp
918 @item none
919
920 @item strict
921 Strictly hierarchical pyramid.
922 @item normal
923 Non-strict (not Blu-ray compatible).
924 @end table
925 @item -mixed-refs @var{integer}
926 One reference per partition, as opposed to one reference per macroblock.
927 @item -8x8dct @var{integer}
928 High profile 8x8 transform.
929 @item -fast-pskip @var{integer}
930 @item -aud @var{integer}
931 Use access unit delimiters.
932 @item -mbtree @var{integer}
933 Use macroblock tree ratecontrol.
934 @item -deblock @var{string}
935 Loop filter parameters, in <alpha:beta> form.
936 @item -cplxblur @var{float}
937 Reduce fluctuations in QP (before curve compression).
938 @item -partitions @var{string}
939 A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all.
940 @item -direct-pred @var{integer}
941 Direct MV prediction mode
942
943 Possible values:
944 @table @samp
945 @item none
946
947 @item spatial
948
949 @item temporal
950
951 @item auto
952
953 @end table
954 @item -slice-max-size @var{integer}
955 Limit the size of each slice in bytes.
956 @item -stats @var{string}
957 Filename for 2 pass stats.
958 @item -nal-hrd @var{integer}
959 Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4).
960
961 Possible values:
962 @table @samp
963 @item none
964
965 @item vbr
966
967 @item cbr
968
969 @end table
970
971 @item x264opts @var{options}
972 Allow to set any x264 option, see @code{x264 --fullhelp} for a list.
973
974 @var{options} is a list of @var{key}=@var{value} couples separated by
975 ":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
976 themselves, use "," instead. They accept it as well since long ago but this
977 is kept undocumented for some reason.
978
979 For example to specify libx264 encoding options with @command{ffmpeg}:
980 @example
981 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
982 @end example
983
984 For more information about libx264 and the supported options see:
985 @url{http://www.videolan.org/developers/x264.html}
986
987 @item -x264-params @var{string}
988 Override the x264 configuration using a :-separated list of key=value parameters.
989 @example
990 -x264-params level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0
991 @end example
992 @end table
993
994 Encoding avpresets for common usages are provided so they can be used with the
995 general presets system (e.g. passing the @code{-pre} option).
996
997 @section png
998
999 PNG image encoder.
1000
1001 @subsection Private options
1002
1003 @table @option
1004 @item dpi @var{integer}
1005 Set physical density of pixels, in dots per inch, unset by default
1006 @item dpm @var{integer}
1007 Set physical density of pixels, in dots per meter, unset by default
1008 @end table
1009
1010 @section ProRes
1011
1012 Apple ProRes encoder.
1013
1014 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
1015 The used encoder can be choosen with the @code{-vcodec} option.
1016
1017 @subsection Private Options for prores-ks
1018
1019 @table @option
1020 @item profile @var{integer}
1021 Select the ProRes profile to encode
1022 @table @samp
1023 @item proxy
1024 @item lt
1025 @item standard
1026 @item hq
1027 @item 4444
1028 @end table
1029
1030 @item quant_mat @var{integer}
1031 Select quantization matrix.
1032 @table @samp
1033 @item auto
1034 @item default
1035 @item proxy
1036 @item lt
1037 @item standard
1038 @item hq
1039 @end table
1040 If set to @var{auto}, the matrix matching the profile will be picked.
1041 If not set, the matrix providing the highest quality, @var{default}, will be
1042 picked.
1043
1044 @item bits_per_mb @var{integer}
1045 How many bits to allot for coding one macroblock. Different profiles use
1046 between 200 and 2400 bits per macroblock, the maximum is 8000.
1047
1048 @item mbs_per_slice @var{integer}
1049 Number of macroblocks in each slice (1-8); the default value (8)
1050 should be good in almost all situations.
1051
1052 @item vendor @var{string}
1053 Override the 4-byte vendor ID.
1054 A custom vendor ID like @var{apl0} would claim the stream was produced by
1055 the Apple encoder.
1056
1057 @item alpha_bits @var{integer}
1058 Specify number of bits for alpha component.
1059 Possible values are @var{0}, @var{8} and @var{16}.
1060 Use @var{0} to disable alpha plane coding.
1061
1062 @end table
1063
1064 @subsection Speed considerations
1065
1066 In the default mode of operation the encoder has to honor frame constraints
1067 (i.e. not produc frames with size bigger than requested) while still making
1068 output picture as good as possible.
1069 A frame containing a lot of small details is harder to compress and the encoder
1070 would spend more time searching for appropriate quantizers for each slice.
1071
1072 Setting a higher @option{bits_per_mb} limit will improve the speed.
1073
1074 For the fastest encoding speed set the @option{qscale} parameter (4 is the
1075 recommended value) and do not set a size constraint.
1076
1077 @c man end VIDEO ENCODERS