xref: /third_party/ffmpeg/doc/encoders.texi (revision cabdff1a)
1@chapter Encoders
2@c man begin ENCODERS
3
4Encoders are configured elements in FFmpeg which allow the encoding of
5multimedia streams.
6
7When you configure your FFmpeg build, all the supported native encoders
8are enabled by default. Encoders requiring an external library must be enabled
9manually via the corresponding @code{--enable-lib} option. You can list all
10available encoders using the configure option @code{--list-encoders}.
11
12You can disable all the encoders with the configure option
13@code{--disable-encoders} and selectively enable / disable single encoders
14with the options @code{--enable-encoder=@var{ENCODER}} /
15@code{--disable-encoder=@var{ENCODER}}.
16
17The option @code{-encoders} of the ff* tools will display the list of
18enabled encoders.
19
20@c man end ENCODERS
21
22@chapter Audio Encoders
23@c man begin AUDIO ENCODERS
24
25A description of some of the currently available audio encoders
26follows.
27
28@anchor{aacenc}
29@section aac
30
31Advanced Audio Coding (AAC) encoder.
32
33This encoder is the default AAC encoder, natively implemented into FFmpeg.
34
35@subsection Options
36
37@table @option
38@item b
39Set bit rate in bits/s. Setting this automatically activates constant bit rate
40(CBR) mode. If this option is unspecified it is set to 128kbps.
41
42@item q
43Set quality for variable bit rate (VBR) mode. This option is valid only using
44the @command{ffmpeg} command-line tool. For library interface users, use
45@option{global_quality}.
46
47@item cutoff
48Set cutoff frequency. If unspecified will allow the encoder to dynamically
49adjust the cutoff to improve clarity on low bitrates.
50
51@item aac_coder
52Set AAC encoder coding method. Possible values:
53
54@table @samp
55@item twoloop
56Two loop searching (TLS) method. This is the default method.
57
58This method first sets quantizers depending on band thresholds and then tries
59to find an optimal combination by adding or subtracting a specific value from
60all quantizers and adjusting some individual quantizer a little.  Will tune
61itself based on whether @option{aac_is}, @option{aac_ms} and @option{aac_pns}
62are enabled.
63
64@item anmr
65Average noise to mask ratio (ANMR) trellis-based solution.
66
67This is an experimental coder which currently produces a lower quality, is more
68unstable and is slower than the default twoloop coder but has potential.
69Currently has no support for the @option{aac_is} or @option{aac_pns} options.
70Not currently recommended.
71
72@item fast
73Constant quantizer method.
74
75Uses a cheaper version of twoloop algorithm that doesn't try to do as many
76clever adjustments. Worse with low bitrates (less than 64kbps), but is better
77and much faster at higher bitrates.
78
79@end table
80
81@item aac_ms
82Sets mid/side coding mode. The default value of "auto" will automatically use
83M/S with bands which will benefit from such coding. Can be forced for all bands
84using the value "enable", which is mainly useful for debugging or disabled using
85"disable".
86
87@item aac_is
88Sets intensity stereo coding tool usage. By default, it's enabled and will
89automatically toggle IS for similar pairs of stereo bands if it's beneficial.
90Can be disabled for debugging by setting the value to "disable".
91
92@item aac_pns
93Uses perceptual noise substitution to replace low entropy high frequency bands
94with imperceptible white noise during the decoding process. By default, it's
95enabled, but can be disabled for debugging purposes by using "disable".
96
97@item aac_tns
98Enables the use of a multitap FIR filter which spans through the high frequency
99bands to hide quantization noise during the encoding process and is reverted
100by the decoder. As well as decreasing unpleasant artifacts in the high range
101this also reduces the entropy in the high bands and allows for more bits to
102be used by the mid-low bands. By default it's enabled but can be disabled for
103debugging by setting the option to "disable".
104
105@item aac_ltp
106Enables the use of the long term prediction extension which increases coding
107efficiency in very low bandwidth situations such as encoding of voice or
108solo piano music by extending constant harmonic peaks in bands throughout
109frames. This option is implied by profile:a aac_low and is incompatible with
110aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
111
112@item aac_pred
113Enables the use of a more traditional style of prediction where the spectral
114coefficients transmitted are replaced by the difference of the current
115coefficients minus the previous "predicted" coefficients. In theory and sometimes
116in practice this can improve quality for low to mid bitrate audio.
117This option implies the aac_main profile and is incompatible with aac_ltp.
118
119@item profile
120Sets the encoding profile, possible values:
121
122@table @samp
123@item aac_low
124The default, AAC "Low-complexity" profile. Is the most compatible and produces
125decent quality.
126
127@item mpeg2_aac_low
128Equivalent to @code{-profile:a aac_low -aac_pns 0}. PNS was introduced with the
129MPEG4 specifications.
130
131@item aac_ltp
132Long term prediction profile, is enabled by and will enable the @option{aac_ltp}
133option. Introduced in MPEG4.
134
135@item aac_main
136Main-type prediction profile, is enabled by and will enable the @option{aac_pred}
137option. Introduced in MPEG2.
138
139@end table
140If this option is unspecified it is set to @samp{aac_low}.
141@end table
142
143@section ac3 and ac3_fixed
144
145AC-3 audio encoders.
146
147These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
148the undocumented RealAudio 3 (a.k.a. dnet).
149
150The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
151encoder only uses fixed-point integer math. This does not mean that one is
152always faster, just that one or the other may be better suited to a
153particular system. The @var{ac3_fixed} encoder is not the default codec for
154any of the output formats, so it must be specified explicitly using the option
155@code{-acodec ac3_fixed} in order to use it.
156
157@subsection AC-3 Metadata
158
159The AC-3 metadata options are used to set parameters that describe the audio,
160but in most cases do not affect the audio encoding itself. Some of the options
161do directly affect or influence the decoding and playback of the resulting
162bitstream, while others are just for informational purposes. A few of the
163options will add bits to the output stream that could otherwise be used for
164audio data, and will thus affect the quality of the output. Those will be
165indicated accordingly with a note in the option list below.
166
167These parameters are described in detail in several publicly-available
168documents.
169@itemize
170@item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
171@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}
172@item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
173@item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
174@end itemize
175
176@subsubsection Metadata Control Options
177
178@table @option
179
180@item -per_frame_metadata @var{boolean}
181Allow Per-Frame Metadata. Specifies if the encoder should check for changing
182metadata for each frame.
183@table @option
184@item 0
185The metadata values set at initialization will be used for every frame in the
186stream. (default)
187@item 1
188Metadata values can be changed before encoding each frame.
189@end table
190
191@end table
192
193@subsubsection Downmix Levels
194
195@table @option
196
197@item -center_mixlev @var{level}
198Center Mix Level. The amount of gain the decoder should apply to the center
199channel when downmixing to stereo. This field will only be written to the
200bitstream if a center channel is present. The value is specified as a scale
201factor. There are 3 valid values:
202@table @option
203@item 0.707
204Apply -3dB gain
205@item 0.595
206Apply -4.5dB gain (default)
207@item 0.500
208Apply -6dB gain
209@end table
210
211@item -surround_mixlev @var{level}
212Surround Mix Level. The amount of gain the decoder should apply to the surround
213channel(s) when downmixing to stereo. This field will only be written to the
214bitstream if one or more surround channels are present. The value is specified
215as a scale factor.  There are 3 valid values:
216@table @option
217@item 0.707
218Apply -3dB gain
219@item 0.500
220Apply -6dB gain (default)
221@item 0.000
222Silence Surround Channel(s)
223@end table
224
225@end table
226
227@subsubsection Audio Production Information
228Audio Production Information is optional information describing the mixing
229environment.  Either none or both of the fields are written to the bitstream.
230
231@table @option
232
233@item -mixing_level @var{number}
234Mixing Level. Specifies peak sound pressure level (SPL) in the production
235environment when the mix was mastered. Valid values are 80 to 111, or -1 for
236unknown or not indicated. The default value is -1, but that value cannot be
237used if the Audio Production Information is written to the bitstream. Therefore,
238if the @code{room_type} option is not the default value, the @code{mixing_level}
239option must not be -1.
240
241@item -room_type @var{type}
242Room Type. Describes the equalization used during the final mixing session at
243the studio or on the dubbing stage. A large room is a dubbing stage with the
244industry standard X-curve equalization; a small room has flat equalization.
245This field will not be written to the bitstream if both the @code{mixing_level}
246option and the @code{room_type} option have the default values.
247@table @option
248@item 0
249@itemx notindicated
250Not Indicated (default)
251@item 1
252@itemx large
253Large Room
254@item 2
255@itemx small
256Small Room
257@end table
258
259@end table
260
261@subsubsection Other Metadata Options
262
263@table @option
264
265@item -copyright @var{boolean}
266Copyright Indicator. Specifies whether a copyright exists for this audio.
267@table @option
268@item 0
269@itemx off
270No Copyright Exists (default)
271@item 1
272@itemx on
273Copyright Exists
274@end table
275
276@item -dialnorm @var{value}
277Dialogue Normalization. Indicates how far the average dialogue level of the
278program is below digital 100% full scale (0 dBFS). This parameter determines a
279level shift during audio reproduction that sets the average volume of the
280dialogue to a preset level. The goal is to match volume level between program
281sources. A value of -31dB will result in no volume level change, relative to
282the source volume, during audio reproduction. Valid values are whole numbers in
283the range -31 to -1, with -31 being the default.
284
285@item -dsur_mode @var{mode}
286Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
287(Pro Logic). This field will only be written to the bitstream if the audio
288stream is stereo. Using this option does @b{NOT} mean the encoder will actually
289apply Dolby Surround processing.
290@table @option
291@item 0
292@itemx notindicated
293Not Indicated (default)
294@item 1
295@itemx off
296Not Dolby Surround Encoded
297@item 2
298@itemx on
299Dolby Surround Encoded
300@end table
301
302@item -original @var{boolean}
303Original Bit Stream Indicator. Specifies whether this audio is from the
304original source and not a copy.
305@table @option
306@item 0
307@itemx off
308Not Original Source
309@item 1
310@itemx on
311Original Source (default)
312@end table
313
314@end table
315
316@subsection Extended Bitstream Information
317The extended bitstream options are part of the Alternate Bit Stream Syntax as
318specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
319If any one parameter in a group is specified, all values in that group will be
320written to the bitstream.  Default values are used for those that are written
321but have not been specified.  If the mixing levels are written, the decoder
322will use these values instead of the ones specified in the @code{center_mixlev}
323and @code{surround_mixlev} options if it supports the Alternate Bit Stream
324Syntax.
325
326@subsubsection Extended Bitstream Information - Part 1
327
328@table @option
329
330@item -dmix_mode @var{mode}
331Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
332(Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
333@table @option
334@item 0
335@itemx notindicated
336Not Indicated (default)
337@item 1
338@itemx ltrt
339Lt/Rt Downmix Preferred
340@item 2
341@itemx loro
342Lo/Ro Downmix Preferred
343@end table
344
345@item -ltrt_cmixlev @var{level}
346Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
347center channel when downmixing to stereo in Lt/Rt mode.
348@table @option
349@item 1.414
350Apply +3dB gain
351@item 1.189
352Apply +1.5dB gain
353@item 1.000
354Apply 0dB gain
355@item 0.841
356Apply -1.5dB gain
357@item 0.707
358Apply -3.0dB gain
359@item 0.595
360Apply -4.5dB gain (default)
361@item 0.500
362Apply -6.0dB gain
363@item 0.000
364Silence Center Channel
365@end table
366
367@item -ltrt_surmixlev @var{level}
368Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
369surround channel(s) when downmixing to stereo in Lt/Rt mode.
370@table @option
371@item 0.841
372Apply -1.5dB gain
373@item 0.707
374Apply -3.0dB gain
375@item 0.595
376Apply -4.5dB gain
377@item 0.500
378Apply -6.0dB gain (default)
379@item 0.000
380Silence Surround Channel(s)
381@end table
382
383@item -loro_cmixlev @var{level}
384Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
385center channel when downmixing to stereo in Lo/Ro mode.
386@table @option
387@item 1.414
388Apply +3dB gain
389@item 1.189
390Apply +1.5dB gain
391@item 1.000
392Apply 0dB gain
393@item 0.841
394Apply -1.5dB gain
395@item 0.707
396Apply -3.0dB gain
397@item 0.595
398Apply -4.5dB gain (default)
399@item 0.500
400Apply -6.0dB gain
401@item 0.000
402Silence Center Channel
403@end table
404
405@item -loro_surmixlev @var{level}
406Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
407surround channel(s) when downmixing to stereo in Lo/Ro mode.
408@table @option
409@item 0.841
410Apply -1.5dB gain
411@item 0.707
412Apply -3.0dB gain
413@item 0.595
414Apply -4.5dB gain
415@item 0.500
416Apply -6.0dB gain (default)
417@item 0.000
418Silence Surround Channel(s)
419@end table
420
421@end table
422
423@subsubsection Extended Bitstream Information - Part 2
424
425@table @option
426
427@item -dsurex_mode @var{mode}
428Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
429(7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
430apply Dolby Surround EX processing.
431@table @option
432@item 0
433@itemx notindicated
434Not Indicated (default)
435@item 1
436@itemx on
437Dolby Surround EX Off
438@item 2
439@itemx off
440Dolby Surround EX On
441@end table
442
443@item -dheadphone_mode @var{mode}
444Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
445encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
446option does @b{NOT} mean the encoder will actually apply Dolby Headphone
447processing.
448@table @option
449@item 0
450@itemx notindicated
451Not Indicated (default)
452@item 1
453@itemx on
454Dolby Headphone Off
455@item 2
456@itemx off
457Dolby Headphone On
458@end table
459
460@item -ad_conv_type @var{type}
461A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
462conversion.
463@table @option
464@item 0
465@itemx standard
466Standard A/D Converter (default)
467@item 1
468@itemx hdcd
469HDCD A/D Converter
470@end table
471
472@end table
473
474@subsection Other AC-3 Encoding Options
475
476@table @option
477
478@item -stereo_rematrixing @var{boolean}
479Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
480is an optional AC-3 feature that increases quality by selectively encoding
481the left/right channels as mid/side. This option is enabled by default, and it
482is highly recommended that it be left as enabled except for testing purposes.
483
484@item cutoff @var{frequency}
485Set lowpass cutoff frequency. If unspecified, the encoder selects a default
486determined by various other encoding parameters.
487
488@end table
489
490@subsection Floating-Point-Only AC-3 Encoding Options
491
492These options are only valid for the floating-point encoder and do not exist
493for the fixed-point encoder due to the corresponding features not being
494implemented in fixed-point.
495
496@table @option
497
498@item -channel_coupling @var{boolean}
499Enables/Disables use of channel coupling, which is an optional AC-3 feature
500that increases quality by combining high frequency information from multiple
501channels into a single channel. The per-channel high frequency information is
502sent with less accuracy in both the frequency and time domains. This allows
503more bits to be used for lower frequencies while preserving enough information
504to reconstruct the high frequencies. This option is enabled by default for the
505floating-point encoder and should generally be left as enabled except for
506testing purposes or to increase encoding speed.
507@table @option
508@item -1
509@itemx auto
510Selected by Encoder (default)
511@item 0
512@itemx off
513Disable Channel Coupling
514@item 1
515@itemx on
516Enable Channel Coupling
517@end table
518
519@item -cpl_start_band @var{number}
520Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
521value higher than the bandwidth is used, it will be reduced to 1 less than the
522coupling end band. If @var{auto} is used, the start band will be determined by
523the encoder based on the bit rate, sample rate, and channel layout. This option
524has no effect if channel coupling is disabled.
525@table @option
526@item -1
527@itemx auto
528Selected by Encoder (default)
529@end table
530
531@end table
532
533@anchor{flac}
534@section flac
535
536FLAC (Free Lossless Audio Codec) Encoder
537
538@subsection Options
539
540The following options are supported by FFmpeg's flac encoder.
541
542@table @option
543@item compression_level
544Sets the compression level, which chooses defaults for many other options
545if they are not set explicitly. Valid values are from 0 to 12, 5 is the
546default.
547
548@item frame_size
549Sets the size of the frames in samples per channel.
550
551@item lpc_coeff_precision
552Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
553default.
554
555@item lpc_type
556Sets the first stage LPC algorithm
557@table @samp
558@item none
559LPC is not used
560
561@item fixed
562fixed LPC coefficients
563
564@item levinson
565
566@item cholesky
567@end table
568
569@item lpc_passes
570Number of passes to use for Cholesky factorization during LPC analysis
571
572@item min_partition_order
573The minimum partition order
574
575@item max_partition_order
576The maximum partition order
577
578@item prediction_order_method
579@table @samp
580@item estimation
581@item 2level
582@item 4level
583@item 8level
584@item search
585Bruteforce search
586@item log
587@end table
588
589@item ch_mode
590Channel mode
591@table @samp
592@item auto
593The mode is chosen automatically for each frame
594@item indep
595Channels are independently coded
596@item left_side
597@item right_side
598@item mid_side
599@end table
600
601@item exact_rice_parameters
602Chooses if rice parameters are calculated exactly or approximately.
603if set to 1 then they are chosen exactly, which slows the code down slightly and
604improves compression slightly.
605
606@item multi_dim_quant
607Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
608applied after the first stage to finetune the coefficients. This is quite slow
609and slightly improves compression.
610
611@end table
612
613@anchor{opusenc}
614@section opus
615
616Opus encoder.
617
618This is a native FFmpeg encoder for the Opus format. Currently its in development and
619only implements the CELT part of the codec. Its quality is usually worse and at best
620is equal to the libopus encoder.
621
622@subsection Options
623
624@table @option
625@item b
626Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
627to make a good guess.
628
629@item opus_delay
630Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
631decrease quality.
632@end table
633
634@anchor{libfdk-aac-enc}
635@section libfdk_aac
636
637libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
638
639The libfdk-aac library is based on the Fraunhofer FDK AAC code from
640the Android project.
641
642Requires the presence of the libfdk-aac headers and library during
643configuration. You need to explicitly configure the build with
644@code{--enable-libfdk-aac}. The library is also incompatible with GPL,
645so if you allow the use of GPL, you should configure with
646@code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
647
648This encoder has support for the AAC-HE profiles.
649
650VBR encoding, enabled through the @option{vbr} or @option{flags
651+qscale} options, is experimental and only works with some
652combinations of parameters.
653
654Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
655higher.
656
657For more information see the fdk-aac project at
658@url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
659
660@subsection Options
661
662The following options are mapped on the shared FFmpeg codec options.
663
664@table @option
665@item b
666Set bit rate in bits/s. If the bitrate is not explicitly specified, it
667is automatically set to a suitable value depending on the selected
668profile.
669
670In case VBR mode is enabled the option is ignored.
671
672@item ar
673Set audio sampling rate (in Hz).
674
675@item channels
676Set the number of audio channels.
677
678@item flags +qscale
679Enable fixed quality, VBR (Variable Bit Rate) mode.
680Note that VBR is implicitly enabled when the @option{vbr} value is
681positive.
682
683@item cutoff
684Set cutoff frequency. If not specified (or explicitly set to 0) it
685will use a value automatically computed by the library. Default value
686is 0.
687
688@item profile
689Set audio profile.
690
691The following profiles are recognized:
692@table @samp
693@item aac_low
694Low Complexity AAC (LC)
695
696@item aac_he
697High Efficiency AAC (HE-AAC)
698
699@item aac_he_v2
700High Efficiency AAC version 2 (HE-AACv2)
701
702@item aac_ld
703Low Delay AAC (LD)
704
705@item aac_eld
706Enhanced Low Delay AAC (ELD)
707@end table
708
709If not specified it is set to @samp{aac_low}.
710@end table
711
712The following are private options of the libfdk_aac encoder.
713
714@table @option
715@item afterburner
716Enable afterburner feature if set to 1, disabled if set to 0. This
717improves the quality but also the required processing power.
718
719Default value is 1.
720
721@item eld_sbr
722Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
723if set to 0.
724
725Default value is 0.
726
727@item eld_v2
728Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
729disabled if set to 0.
730
731Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0).
732
733Default value is 0.
734
735@item signaling
736Set SBR/PS signaling style.
737
738It can assume one of the following values:
739@table @samp
740@item default
741choose signaling implicitly (explicit hierarchical by default,
742implicit if global header is disabled)
743
744@item implicit
745implicit backwards compatible signaling
746
747@item explicit_sbr
748explicit SBR, implicit PS signaling
749
750@item explicit_hierarchical
751explicit hierarchical signaling
752@end table
753
754Default value is @samp{default}.
755
756@item latm
757Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
758
759Default value is 0.
760
761@item header_period
762Set StreamMuxConfig and PCE repetition period (in frames) for sending
763in-band configuration buffers within LATM/LOAS transport layer.
764
765Must be a 16-bits non-negative integer.
766
767Default value is 0.
768
769@item vbr
770Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
771good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
772(Constant Bit Rate) is enabled.
773
774Currently only the @samp{aac_low} profile supports VBR encoding.
775
776VBR modes 1-5 correspond to roughly the following average bit rates:
777
778@table @samp
779@item 1
78032 kbps/channel
781@item 2
78240 kbps/channel
783@item 3
78448-56 kbps/channel
785@item 4
78664 kbps/channel
787@item 5
788about 80-96 kbps/channel
789@end table
790
791Default value is 0.
792@end table
793
794@subsection Examples
795
796@itemize
797@item
798Use @command{ffmpeg} to convert an audio file to VBR AAC in an M4A (MP4)
799container:
800@example
801ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
802@end example
803
804@item
805Use @command{ffmpeg} to convert an audio file to CBR 64k kbps AAC, using the
806High-Efficiency AAC profile:
807@example
808ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
809@end example
810@end itemize
811
812@anchor{libmp3lame}
813@section libmp3lame
814
815LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper.
816
817Requires the presence of the libmp3lame headers and library during
818configuration. You need to explicitly configure the build with
819@code{--enable-libmp3lame}.
820
821See @ref{libshine} for a fixed-point MP3 encoder, although with a
822lower quality.
823
824@subsection Options
825
826The following options are supported by the libmp3lame wrapper. The
827@command{lame}-equivalent of the options are listed in parentheses.
828
829@table @option
830@item b (@emph{-b})
831Set bitrate expressed in bits/s for CBR or ABR. LAME @code{bitrate} is
832expressed in kilobits/s.
833
834@item q (@emph{-V})
835Set constant quality setting for VBR. This option is valid only
836using the @command{ffmpeg} command-line tool. For library interface
837users, use @option{global_quality}.
838
839@item compression_level (@emph{-q})
840Set algorithm quality. Valid arguments are integers in the 0-9 range,
841with 0 meaning highest quality but slowest, and 9 meaning fastest
842while producing the worst quality.
843
844@item cutoff (@emph{--lowpass})
845Set lowpass cutoff frequency. If unspecified, the encoder dynamically
846adjusts the cutoff.
847
848@item reservoir
849Enable use of bit reservoir when set to 1. Default value is 1. LAME
850has this enabled by default, but can be overridden by use
851@option{--nores} option.
852
853@item joint_stereo (@emph{-m j})
854Enable the encoder to use (on a frame by frame basis) either L/R
855stereo or mid/side stereo. Default value is 1.
856
857@item abr (@emph{--abr})
858Enable the encoder to use ABR when set to 1. The @command{lame}
859@option{--abr} sets the target bitrate, while this options only
860tells FFmpeg to use ABR still relies on @option{b} to set bitrate.
861
862@end table
863
864@section libopencore-amrnb
865
866OpenCORE Adaptive Multi-Rate Narrowband encoder.
867
868Requires the presence of the libopencore-amrnb headers and library during
869configuration. You need to explicitly configure the build with
870@code{--enable-libopencore-amrnb --enable-version3}.
871
872This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
873but you can override it by setting @option{strict} to @samp{unofficial} or
874lower.
875
876@subsection Options
877
878@table @option
879
880@item b
881Set bitrate in bits per second. Only the following bitrates are supported,
882otherwise libavcodec will round to the nearest valid bitrate.
883
884@table @option
885@item 4750
886@item 5150
887@item 5900
888@item 6700
889@item 7400
890@item 7950
891@item 10200
892@item 12200
893@end table
894
895@item dtx
896Allow discontinuous transmission (generate comfort noise) when set to 1. The
897default value is 0 (disabled).
898
899@end table
900
901@section libopus
902
903libopus Opus Interactive Audio Codec encoder wrapper.
904
905Requires the presence of the libopus headers and library during
906configuration. You need to explicitly configure the build with
907@code{--enable-libopus}.
908
909@subsection Option Mapping
910
911Most libopus options are modelled after the @command{opusenc} utility from
912opus-tools. The following is an option mapping chart describing options
913supported by the libopus wrapper, and their @command{opusenc}-equivalent
914in parentheses.
915
916@table @option
917
918@item b (@emph{bitrate})
919Set the bit rate in bits/s.  FFmpeg's @option{b} option is
920expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
921kilobits/s.
922
923@item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
924Set VBR mode. The FFmpeg @option{vbr} option has the following
925valid arguments, with the @command{opusenc} equivalent options
926in parentheses:
927
928@table @samp
929@item off (@emph{hard-cbr})
930Use constant bit rate encoding.
931
932@item on (@emph{vbr})
933Use variable bit rate encoding (the default).
934
935@item constrained (@emph{cvbr})
936Use constrained variable bit rate encoding.
937@end table
938
939@item compression_level (@emph{comp})
940Set encoding algorithm complexity. Valid options are integers in
941the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
942gives the highest quality but slowest encoding. The default is 10.
943
944@item frame_duration (@emph{framesize})
945Set maximum frame size, or duration of a frame in milliseconds. The
946argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
947frame sizes achieve lower latency but less quality at a given bitrate.
948Sizes greater than 20ms are only interesting at fairly low bitrates.
949The default is 20ms.
950
951@item packet_loss (@emph{expect-loss})
952Set expected packet loss percentage. The default is 0.
953
954@item fec (@emph{n/a})
955Enable inband forward error correction. @option{packet_loss} must be non-zero
956to take advantage - frequency of FEC 'side-data' is proportional to expected packet loss.
957Default is disabled.
958
959@item application (N.A.)
960Set intended application type. Valid options are listed below:
961
962@table @samp
963@item voip
964Favor improved speech intelligibility.
965@item audio
966Favor faithfulness to the input (the default).
967@item lowdelay
968Restrict to only the lowest delay modes.
969@end table
970
971@item cutoff (N.A.)
972Set cutoff bandwidth in Hz. The argument must be exactly one of the
973following: 4000, 6000, 8000, 12000, or 20000, corresponding to
974narrowband, mediumband, wideband, super wideband, and fullband
975respectively. The default is 0 (cutoff disabled).
976
977@item mapping_family (@emph{mapping_family})
978Set channel mapping family to be used by the encoder. The default value of -1
979uses mapping family 0 for mono and stereo inputs, and mapping family 1
980otherwise. The default also disables the surround masking and LFE bandwidth
981optimzations in libopus, and requires that the input contains 8 channels or
982fewer.
983
984Other values include 0 for mono and stereo, 1 for surround sound with masking
985and LFE bandwidth optimizations, and 255 for independent streams with an
986unspecified channel layout.
987
988@item apply_phase_inv (N.A.) (requires libopus >= 1.2)
989If set to 0, disables the use of phase inversion for intensity stereo,
990improving the quality of mono downmixes, but slightly reducing normal stereo
991quality. The default is 1 (phase inversion enabled).
992
993@end table
994
995@anchor{libshine}
996@section libshine
997
998Shine Fixed-Point MP3 encoder wrapper.
999
1000Shine is a fixed-point MP3 encoder. It has a far better performance on
1001platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
1002However, as it is more targeted on performance than quality, it is not on par
1003with LAME and other production-grade encoders quality-wise. Also, according to
1004the project's homepage, this encoder may not be free of bugs as the code was
1005written a long time ago and the project was dead for at least 5 years.
1006
1007This encoder only supports stereo and mono input. This is also CBR-only.
1008
1009The original project (last updated in early 2007) is at
1010@url{http://sourceforge.net/projects/libshine-fxp/}. We only support the
1011updated fork by the Savonet/Liquidsoap project at @url{https://github.com/savonet/shine}.
1012
1013Requires the presence of the libshine headers and library during
1014configuration. You need to explicitly configure the build with
1015@code{--enable-libshine}.
1016
1017See also @ref{libmp3lame}.
1018
1019@subsection Options
1020
1021The following options are supported by the libshine wrapper. The
1022@command{shineenc}-equivalent of the options are listed in parentheses.
1023
1024@table @option
1025@item b (@emph{-b})
1026Set bitrate expressed in bits/s for CBR. @command{shineenc} @option{-b} option
1027is expressed in kilobits/s.
1028
1029@end table
1030
1031@section libtwolame
1032
1033TwoLAME MP2 encoder wrapper.
1034
1035Requires the presence of the libtwolame headers and library during
1036configuration. You need to explicitly configure the build with
1037@code{--enable-libtwolame}.
1038
1039@subsection Options
1040
1041The following options are supported by the libtwolame wrapper. The
1042@command{twolame}-equivalent options follow the FFmpeg ones and are in
1043parentheses.
1044
1045@table @option
1046@item b (@emph{-b})
1047Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
1048option is expressed in kilobits/s. Default value is 128k.
1049
1050@item q (@emph{-V})
1051Set quality for experimental VBR support. Maximum value range is
1052from -50 to 50, useful range is from -10 to 10. The higher the
1053value, the better the quality. This option is valid only using the
1054@command{ffmpeg} command-line tool. For library interface users,
1055use @option{global_quality}.
1056
1057@item mode (@emph{--mode})
1058Set the mode of the resulting audio. Possible values:
1059
1060@table @samp
1061@item auto
1062Choose mode automatically based on the input. This is the default.
1063@item stereo
1064Stereo
1065@item joint_stereo
1066Joint stereo
1067@item dual_channel
1068Dual channel
1069@item mono
1070Mono
1071@end table
1072
1073@item psymodel (@emph{--psyc-mode})
1074Set psychoacoustic model to use in encoding. The argument must be
1075an integer between -1 and 4, inclusive. The higher the value, the
1076better the quality. The default value is 3.
1077
1078@item energy_levels (@emph{--energy})
1079Enable energy levels extensions when set to 1. The default value is
10800 (disabled).
1081
1082@item error_protection (@emph{--protect})
1083Enable CRC error protection when set to 1. The default value is 0
1084(disabled).
1085
1086@item copyright (@emph{--copyright})
1087Set MPEG audio copyright flag when set to 1. The default value is 0
1088(disabled).
1089
1090@item original (@emph{--original})
1091Set MPEG audio original flag when set to 1. The default value is 0
1092(disabled).
1093
1094@end table
1095
1096@section libvo-amrwbenc
1097
1098VisualOn Adaptive Multi-Rate Wideband encoder.
1099
1100Requires the presence of the libvo-amrwbenc headers and library during
1101configuration. You need to explicitly configure the build with
1102@code{--enable-libvo-amrwbenc --enable-version3}.
1103
1104This is a mono-only encoder. Officially it only supports 16000Hz sample
1105rate, but you can override it by setting @option{strict} to
1106@samp{unofficial} or lower.
1107
1108@subsection Options
1109
1110@table @option
1111
1112@item b
1113Set bitrate in bits/s. Only the following bitrates are supported, otherwise
1114libavcodec will round to the nearest valid bitrate.
1115
1116@table @samp
1117@item 6600
1118@item 8850
1119@item 12650
1120@item 14250
1121@item 15850
1122@item 18250
1123@item 19850
1124@item 23050
1125@item 23850
1126@end table
1127
1128@item dtx
1129Allow discontinuous transmission (generate comfort noise) when set to 1. The
1130default value is 0 (disabled).
1131
1132@end table
1133
1134@section libvorbis
1135
1136libvorbis encoder wrapper.
1137
1138Requires the presence of the libvorbisenc headers and library during
1139configuration. You need to explicitly configure the build with
1140@code{--enable-libvorbis}.
1141
1142@subsection Options
1143
1144The following options are supported by the libvorbis wrapper. The
1145@command{oggenc}-equivalent of the options are listed in parentheses.
1146
1147To get a more accurate and extensive documentation of the libvorbis
1148options, consult the libvorbisenc's and @command{oggenc}'s documentations.
1149See @url{http://xiph.org/vorbis/},
1150@url{http://wiki.xiph.org/Vorbis-tools}, and oggenc(1).
1151
1152@table @option
1153@item b (@emph{-b})
1154Set bitrate expressed in bits/s for ABR. @command{oggenc} @option{-b} is
1155expressed in kilobits/s.
1156
1157@item q (@emph{-q})
1158Set constant quality setting for VBR. The value should be a float
1159number in the range of -1.0 to 10.0. The higher the value, the better
1160the quality. The default value is @samp{3.0}.
1161
1162This option is valid only using the @command{ffmpeg} command-line tool.
1163For library interface users, use @option{global_quality}.
1164
1165@item cutoff (@emph{--advanced-encode-option lowpass_frequency=N})
1166Set cutoff bandwidth in Hz, a value of 0 disables cutoff. @command{oggenc}'s
1167related option is expressed in kHz. The default value is @samp{0} (cutoff
1168disabled).
1169
1170@item minrate (@emph{-m})
1171Set minimum bitrate expressed in bits/s. @command{oggenc} @option{-m} is
1172expressed in kilobits/s.
1173
1174@item maxrate (@emph{-M})
1175Set maximum bitrate expressed in bits/s. @command{oggenc} @option{-M} is
1176expressed in kilobits/s. This only has effect on ABR mode.
1177
1178@item iblock (@emph{--advanced-encode-option impulse_noisetune=N})
1179Set noise floor bias for impulse blocks. The value is a float number from
1180-15.0 to 0.0. A negative bias instructs the encoder to pay special attention
1181to the crispness of transients in the encoded audio. The tradeoff for better
1182transient response is a higher bitrate.
1183
1184@end table
1185
1186@anchor{mjpegenc}
1187@section mjpeg
1188
1189Motion JPEG encoder.
1190
1191@subsection Options
1192
1193@table @option
1194@item huffman
1195Set the huffman encoding strategy. Possible values:
1196
1197@table @samp
1198@item default
1199Use the default huffman tables. This is the default strategy.
1200
1201@item optimal
1202Compute and use optimal huffman tables.
1203
1204@end table
1205@end table
1206
1207@anchor{wavpackenc}
1208@section wavpack
1209
1210WavPack lossless audio encoder.
1211
1212@subsection Options
1213
1214The equivalent options for @command{wavpack} command line utility are listed in
1215parentheses.
1216
1217@subsubsection Shared options
1218
1219The following shared options are effective for this encoder. Only special notes
1220about this particular encoder will be documented here. For the general meaning
1221of the options, see @ref{codec-options,,the Codec Options chapter}.
1222
1223@table @option
1224@item frame_size (@emph{--blocksize})
1225For this encoder, the range for this option is between 128 and 131072. Default
1226is automatically decided based on sample rate and number of channel.
1227
1228For the complete formula of calculating default, see
1229@file{libavcodec/wavpackenc.c}.
1230
1231@item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
1232@end table
1233
1234@subsubsection Private options
1235
1236@table @option
1237@item joint_stereo (@emph{-j})
1238Set whether to enable joint stereo. Valid values are:
1239
1240@table @samp
1241@item on (@emph{1})
1242Force mid/side audio encoding.
1243@item off (@emph{0})
1244Force left/right audio encoding.
1245@item auto
1246Let the encoder decide automatically.
1247@end table
1248
1249@item optimize_mono
1250Set whether to enable optimization for mono. This option is only effective for
1251non-mono streams. Available values:
1252
1253@table @samp
1254@item on
1255enabled
1256@item off
1257disabled
1258@end table
1259
1260@end table
1261
1262@c man end AUDIO ENCODERS
1263
1264@chapter Video Encoders
1265@c man begin VIDEO ENCODERS
1266
1267A description of some of the currently available video encoders
1268follows.
1269
1270@section a64_multi, a64_multi5
1271
1272A64 / Commodore 64 multicolor charset encoder. @code{a64_multi5} is extended with 5th color (colram).
1273
1274@section Cinepak
1275
1276Cinepak aka CVID encoder.
1277Compatible with Windows 3.1 and vintage MacOS.
1278
1279@subsection Options
1280
1281@table @option
1282@item g @var{integer}
1283Keyframe interval.
1284A keyframe is inserted at least every @code{-g} frames, sometimes sooner.
1285
1286@item q:v @var{integer}
1287Quality factor. Lower is better. Higher gives lower bitrate.
1288The following table lists bitrates when encoding akiyo_cif.y4m for various values of @code{-q:v} with @code{-g 100}:
1289
1290@table @option
1291@item @code{-q:v 1} 1918 kb/s
1292@item @code{-q:v 2} 1735 kb/s
1293@item @code{-q:v 4} 1500 kb/s
1294@item @code{-q:v 10} 1041 kb/s
1295@item @code{-q:v 20} 826 kb/s
1296@item @code{-q:v 40} 553 kb/s
1297@item @code{-q:v 100} 394 kb/s
1298@item @code{-q:v 200} 312 kb/s
1299@item @code{-q:v 400} 266 kb/s
1300@item @code{-q:v 1000} 237 kb/s
1301@end table
1302
1303@item max_extra_cb_iterations @var{integer}
1304Max extra codebook recalculation passes, more is better and slower.
1305
1306@item skip_empty_cb @var{boolean}
1307Avoid wasting bytes, ignore vintage MacOS decoder.
1308
1309@item max_strips @var{integer}
1310@itemx min_strips @var{integer}
1311The minimum and maximum number of strips to use.
1312Wider range sometimes improves quality.
1313More strips is generally better quality but costs more bits.
1314Fewer strips tend to yield more keyframes.
1315Vintage compatible is 1..3.
1316
1317@item strip_number_adaptivity @var{integer}
1318How much number of strips is allowed to change between frames.
1319Higher is better but slower.
1320
1321@end table
1322
1323@section GIF
1324
1325GIF image/animation encoder.
1326
1327@subsection Options
1328
1329@table @option
1330@item gifflags @var{integer}
1331Sets the flags used for GIF encoding.
1332
1333@table @option
1334@item offsetting
1335Enables picture offsetting.
1336
1337Default is enabled.
1338
1339@item transdiff
1340Enables transparency detection between frames.
1341
1342Default is enabled.
1343
1344@end table
1345
1346@item gifimage @var{integer}
1347Enables encoding one full GIF image per frame, rather than an animated GIF.
1348
1349Default value is @option{0}.
1350
1351@item global_palette @var{integer}
1352Writes a palette to the global GIF header where feasible.
1353
1354If disabled, every frame will always have a palette written, even if there
1355is a global palette supplied.
1356
1357Default value is @option{1}.
1358
1359@end table
1360
1361@section Hap
1362
1363Vidvox Hap video encoder.
1364
1365@subsection Options
1366
1367@table @option
1368@item format @var{integer}
1369Specifies the Hap format to encode.
1370
1371@table @option
1372@item hap
1373@item hap_alpha
1374@item hap_q
1375@end table
1376
1377Default value is @option{hap}.
1378
1379@item chunks @var{integer}
1380Specifies the number of chunks to split frames into, between 1 and 64. This
1381permits multithreaded decoding of large frames, potentially at the cost of
1382data-rate. The encoder may modify this value to divide frames evenly.
1383
1384Default value is @var{1}.
1385
1386@item compressor @var{integer}
1387Specifies the second-stage compressor to use. If set to @option{none},
1388@option{chunks} will be limited to 1, as chunked uncompressed frames offer no
1389benefit.
1390
1391@table @option
1392@item none
1393@item snappy
1394@end table
1395
1396Default value is @option{snappy}.
1397
1398@end table
1399
1400@section jpeg2000
1401
1402The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
1403option can be used to set the encoding quality. Lossless encoding
1404can be selected with @code{-pred 1}.
1405
1406@subsection Options
1407
1408@table @option
1409@item format @var{integer}
1410Can be set to either @code{j2k} or @code{jp2} (the default) that
1411makes it possible to store non-rgb pix_fmts.
1412
1413@item tile_width @var{integer}
1414Sets tile width. Range is 1 to 1073741824. Default is 256.
1415
1416@item tile_height @var{integer}
1417Sets tile height. Range is 1 to 1073741824. Default is 256.
1418
1419@item pred @var{integer}
1420Allows setting the discrete wavelet transform (DWT) type
1421@table @option
1422@item dwt97int (Lossy)
1423@item dwt53 (Lossless)
1424@end table
1425Default is @code{dwt97int}
1426
1427@item sop @var{boolean}
1428Enable this to add SOP marker at the start of each packet. Disabled by default.
1429
1430@item eph @var{boolean}
1431Enable this to add EPH marker at the end of each packet header. Disabled by default.
1432
1433@item prog @var{integer}
1434Sets the progression order to be used by the encoder.
1435Possible values are:
1436@table @option
1437@item lrcp
1438@item rlcp
1439@item rpcl
1440@item pcrl
1441@item cprl
1442@end table
1443Set to @code{lrcp} by default.
1444
1445@item layer_rates @var{string}
1446By default, when this option is not used, compression is done using the quality metric.
1447This option allows for compression using compression ratio. The compression ratio for each
1448level could be specified. The compression ratio of a layer @code{l} species the what ratio of
1449total file size is contained in the first @code{l} layers.
1450
1451Example usage:
1452
1453@example
1454ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k
1455@end example
1456
1457This would compress the image to contain 3 layers, where the data contained in the
1458first layer would be compressed by 1000 times, compressed by 100 in the first two layers,
1459and shall contain all data while using all 3 layers.
1460
1461@end table
1462
1463@section librav1e
1464
1465rav1e AV1 encoder wrapper.
1466
1467Requires the presence of the rav1e headers and library during configuration.
1468You need to explicitly configure the build with @code{--enable-librav1e}.
1469
1470@subsection Options
1471
1472@table @option
1473@item qmax
1474Sets the maximum quantizer to use when using bitrate mode.
1475
1476@item qmin
1477Sets the minimum quantizer to use when using bitrate mode.
1478
1479@item qp
1480Uses quantizer mode to encode at the given quantizer (0-255).
1481
1482@item speed
1483Selects the speed preset (0-10) to encode with.
1484
1485@item tiles
1486Selects how many tiles to encode with.
1487
1488@item tile-rows
1489Selects how many rows of tiles to encode with.
1490
1491@item tile-columns
1492Selects how many columns of tiles to encode with.
1493
1494@item rav1e-params
1495Set rav1e options using a list of @var{key}=@var{value} pairs separated
1496by ":". See @command{rav1e --help} for a list of options.
1497
1498For example to specify librav1e encoding options with @option{-rav1e-params}:
1499
1500@example
1501ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
1502@end example
1503
1504@end table
1505
1506@section libaom-av1
1507
1508libaom AV1 encoder wrapper.
1509
1510Requires the presence of the libaom headers and library during
1511configuration.  You need to explicitly configure the build with
1512@code{--enable-libaom}.
1513
1514@subsection Options
1515
1516The wrapper supports the following standard libavcodec options:
1517
1518@table @option
1519
1520@item b
1521Set bitrate target in bits/second.  By default this will use
1522variable-bitrate mode.  If @option{maxrate} and @option{minrate} are
1523also set to the same value then it will use constant-bitrate mode,
1524otherwise if @option{crf} is set as well then it will use
1525constrained-quality mode.
1526
1527@item g keyint_min
1528Set key frame placement.  The GOP size sets the maximum distance between
1529key frames; if zero the output stream will be intra-only.  The minimum
1530distance is ignored unless it is the same as the GOP size, in which case
1531key frames will always appear at a fixed interval.  Not set by default,
1532so without this option the library has completely free choice about
1533where to place key frames.
1534
1535@item qmin qmax
1536Set minimum/maximum quantisation values.  Valid range is from 0 to 63
1537(warning: this does not match the quantiser values actually used by AV1
1538- divide by four to map real quantiser values to this range).  Defaults
1539to min/max (no constraint).
1540
1541@item minrate maxrate bufsize rc_init_occupancy
1542Set rate control buffering parameters.  Not used if not set - defaults
1543to unconstrained variable bitrate.
1544
1545@item threads
1546Set the number of threads to use while encoding.  This may require the
1547@option{tiles} or @option{row-mt} options to also be set to actually
1548use the specified number of threads fully. Defaults to the number of
1549hardware threads supported by the host machine.
1550
1551@item profile
1552Set the encoding profile.  Defaults to using the profile which matches
1553the bit depth and chroma subsampling of the input.
1554
1555@end table
1556
1557The wrapper also has some specific options:
1558
1559@table @option
1560
1561@item cpu-used
1562Set the quality/encoding speed tradeoff.  Valid range is from 0 to 8,
1563higher numbers indicating greater speed and lower quality.  The default
1564value is 1, which will be slow and high quality.
1565
1566@item auto-alt-ref
1567Enable use of alternate reference frames.  Defaults to the internal
1568default of the library.
1569
1570@item arnr-max-frames (@emph{frames})
1571Set altref noise reduction max frame count. Default is -1.
1572
1573@item arnr-strength (@emph{strength})
1574Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
1575
1576@item aq-mode (@emph{aq-mode})
1577Set adaptive quantization mode. Possible values:
1578
1579@table @samp
1580@item none (@emph{0})
1581Disabled.
1582
1583@item variance (@emph{1})
1584Variance-based.
1585
1586@item complexity (@emph{2})
1587Complexity-based.
1588
1589@item cyclic (@emph{3})
1590Cyclic refresh.
1591@end table
1592
1593@item tune (@emph{tune})
1594Set the distortion metric the encoder is tuned with. Default is @code{psnr}.
1595
1596@table @samp
1597@item psnr (@emph{0})
1598
1599@item ssim (@emph{1})
1600@end table
1601
1602@item lag-in-frames
1603Set the maximum number of frames which the encoder may keep in flight
1604at any one time for lookahead purposes.  Defaults to the internal
1605default of the library.
1606
1607@item error-resilience
1608Enable error resilience features:
1609@table @option
1610@item default
1611Improve resilience against losses of whole frames.
1612@end table
1613Not enabled by default.
1614
1615@item crf
1616Set the quality/size tradeoff for constant-quality (no bitrate target)
1617and constrained-quality (with maximum bitrate target) modes. Valid
1618range is 0 to 63, higher numbers indicating lower quality and smaller
1619output size.  Only used if set; by default only the bitrate target is
1620used.
1621
1622@item static-thresh
1623Set a change threshold on blocks below which they will be skipped by
1624the encoder.  Defined in arbitrary units as a nonnegative integer,
1625defaulting to zero (no blocks are skipped).
1626
1627@item drop-threshold
1628Set a threshold for dropping frames when close to rate control bounds.
1629Defined as a percentage of the target buffer - when the rate control
1630buffer falls below this percentage, frames will be dropped until it
1631has refilled above the threshold.  Defaults to zero (no frames are
1632dropped).
1633
1634@item denoise-noise-level (@emph{level})
1635Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
1636this option is not set or set to 0.
1637
1638@item denoise-block-size (@emph{pixels})
1639Block size used for denoising for grain synthesis. If not set, AV1 codec
1640uses the default value of 32.
1641
1642@item undershoot-pct (@emph{pct})
1643Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
1644Default is -1.
1645
1646@item overshoot-pct (@emph{pct})
1647Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
1648Default is -1.
1649
1650@item minsection-pct (@emph{pct})
1651Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
1652is not set, the libaomenc wrapper computes it as follows: @code{(minrate * 100 / bitrate)}.
1653Range is -1 to 100. Default is -1 (unset).
1654
1655@item maxsection-pct (@emph{pct})
1656Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
1657is not set, the libaomenc wrapper computes it as follows: @code{(maxrate * 100 / bitrate)}.
1658Range is -1 to 5000. Default is -1 (unset).
1659
1660@item frame-parallel (@emph{boolean})
1661Enable frame parallel decodability features. Default is true.
1662
1663@item tiles
1664Set the number of tiles to encode the input video with, as columns x
1665rows.  Larger numbers allow greater parallelism in both encoding and
1666decoding, but may decrease coding efficiency.  Defaults to the minimum
1667number of tiles required by the size of the input video (this is 1x1
1668(that is, a single tile) for sizes up to and including 4K).
1669
1670@item tile-columns tile-rows
1671Set the number of tiles as log2 of the number of tile rows and columns.
1672Provided for compatibility with libvpx/VP9.
1673
1674@item row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2)
1675Enable row based multi-threading. Disabled by default.
1676
1677@item enable-cdef (@emph{boolean})
1678Enable Constrained Directional Enhancement Filter. The libaom-av1
1679encoder enables CDEF by default.
1680
1681@item enable-restoration (@emph{boolean})
1682Enable Loop Restoration Filter. Default is true for libaom-av1.
1683
1684@item enable-global-motion (@emph{boolean})
1685Enable the use of global motion for block prediction. Default is true.
1686
1687@item enable-intrabc (@emph{boolean})
1688Enable block copy mode for intra block prediction. This mode is
1689useful for screen content. Default is true.
1690
1691@item enable-rect-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
1692Enable rectangular partitions. Default is true.
1693
1694@item enable-1to4-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
1695Enable 1:4/4:1 partitions. Default is true.
1696
1697@item enable-ab-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
1698Enable AB shape partitions. Default is true.
1699
1700@item enable-angle-delta (@emph{boolean}) (Requires libaom >= v2.0.0)
1701Enable angle delta intra prediction. Default is true.
1702
1703@item enable-cfl-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
1704Enable chroma predicted from luma intra prediction. Default is true.
1705
1706@item enable-filter-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
1707Enable filter intra predictor. Default is true.
1708
1709@item enable-intra-edge-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
1710Enable intra edge filter. Default is true.
1711
1712@item enable-smooth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
1713Enable smooth intra prediction mode. Default is true.
1714
1715@item enable-paeth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
1716Enable paeth predictor in intra prediction. Default is true.
1717
1718@item enable-palette (@emph{boolean}) (Requires libaom >= v2.0.0)
1719Enable palette prediction mode. Default is true.
1720
1721@item enable-flip-idtx (@emph{boolean}) (Requires libaom >= v2.0.0)
1722Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST,
1723FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT,
1724V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true.
1725
1726@item enable-tx64 (@emph{boolean}) (Requires libaom >= v2.0.0)
1727Enable 64-pt transform. Default is true.
1728
1729@item reduced-tx-type-set (@emph{boolean}) (Requires libaom >= v2.0.0)
1730Use reduced set of transform types. Default is false.
1731
1732@item use-intra-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
1733Use DCT only for INTRA modes. Default is false.
1734
1735@item use-inter-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
1736Use DCT only for INTER modes. Default is false.
1737
1738@item use-intra-default-tx-only (@emph{boolean}) (Requires libaom >= v2.0.0)
1739Use Default-transform only for INTRA modes. Default is false.
1740
1741@item enable-ref-frame-mvs (@emph{boolean}) (Requires libaom >= v2.0.0)
1742Enable temporal mv prediction. Default is true.
1743
1744@item enable-reduced-reference-set (@emph{boolean}) (Requires libaom >= v2.0.0)
1745Use reduced set of single and compound references. Default is false.
1746
1747@item enable-obmc (@emph{boolean}) (Requires libaom >= v2.0.0)
1748Enable obmc. Default is true.
1749
1750@item enable-dual-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
1751Enable dual filter. Default is true.
1752
1753@item enable-diff-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1754Enable difference-weighted compound. Default is true.
1755
1756@item enable-dist-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1757Enable distance-weighted compound. Default is true.
1758
1759@item enable-onesided-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1760Enable one sided compound. Default is true.
1761
1762@item enable-interinter-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
1763Enable interinter wedge compound. Default is true.
1764
1765@item enable-interintra-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
1766Enable interintra wedge compound. Default is true.
1767
1768@item enable-masked-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1769Enable masked compound. Default is true.
1770
1771@item enable-interintra-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
1772Enable interintra compound. Default is true.
1773
1774@item enable-smooth-interintra (@emph{boolean}) (Requires libaom >= v2.0.0)
1775Enable smooth interintra mode. Default is true.
1776
1777@item aom-params
1778Set libaom options using a list of @var{key}=@var{value} pairs separated
1779by ":". For a list of supported options, see @command{aomenc --help} under the
1780section "AV1 Specific Options".
1781
1782For example to specify libaom encoding options with @option{-aom-params}:
1783
1784@example
1785ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
1786@end example
1787
1788@end table
1789
1790@section libsvtav1
1791
1792SVT-AV1 encoder wrapper.
1793
1794Requires the presence of the SVT-AV1 headers and library during configuration.
1795You need to explicitly configure the build with @code{--enable-libsvtav1}.
1796
1797@subsection Options
1798
1799@table @option
1800@item profile
1801Set the encoding profile.
1802@table @samp
1803@item main
1804@item high
1805@item professional
1806@end table
1807
1808@item level
1809Set the operating point level. For example: '4.0'
1810
1811@item hielevel
1812Set the Hierarchical prediction levels.
1813@table @samp
1814@item 3level
1815@item 4level
1816This is the default.
1817@end table
1818
1819@item tier
1820Set the operating point tier.
1821@table @samp
1822@item main
1823This is the default.
1824@item high
1825@end table
1826
1827@item qmax
1828Set the maximum quantizer to use when using a bitrate mode.
1829
1830@item qmin
1831Set the minimum quantizer to use when using a bitrate mode.
1832
1833@item crf
1834Constant rate factor value used in crf rate control mode (0-63).
1835
1836@item qp
1837Set the quantizer used in cqp rate control mode (0-63).
1838
1839@item sc_detection
1840Enable scene change detection.
1841
1842@item la_depth
1843Set number of frames to look ahead (0-120).
1844
1845@item preset
1846Set the quality-speed tradeoff, in the range 0 to 13.  Higher values are
1847faster but lower quality.
1848
1849@item tile_rows
1850Set log2 of the number of rows of tiles to use (0-6).
1851
1852@item tile_columns
1853Set log2 of the number of columns of tiles to use (0-4).
1854
1855@item svtav1-params
1856Set SVT-AV1 options using a list of @var{key}=@var{value} pairs separated
1857by ":". See the SVT-AV1 encoder user guide for a list of accepted parameters.
1858
1859@end table
1860
1861@section libjxl
1862
1863libjxl JPEG XL encoder wrapper.
1864
1865Requires the presence of the libjxl headers and library during
1866configuration. You need to explicitly configure the build with
1867@code{--enable-libjxl}.
1868
1869@subsection Options
1870
1871The libjxl wrapper supports the following options:
1872
1873@table @option
1874
1875@item distance
1876Set the target Butteraugli distance. This is a quality setting: lower
1877distance yields higher quality, with distance=1.0 roughly comparable to
1878libjpeg Quality 90 for photographic content. Setting distance=0.0 yields
1879true lossless encoding. Valid values range between 0.0 and 15.0, and sane
1880values rarely exceed 5.0. Setting distance=0.1 usually attains
1881transparency for most input. The default is 1.0.
1882
1883@item effort
1884Set the encoding effort used. Higher effort values produce more consistent
1885quality and usually produces a better quality/bpp curve, at the cost of
1886more CPU time required. Valid values range from 1 to 9, and the default is 7.
1887
1888@item modular
1889Force the encoder to use Modular mode instead of choosing automatically. The
1890default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT
1891is generally superior to Modular for lossy encoding but does not support
1892lossless encoding.
1893
1894@end table
1895
1896@section libkvazaar
1897
1898Kvazaar H.265/HEVC encoder.
1899
1900Requires the presence of the libkvazaar headers and library during
1901configuration. You need to explicitly configure the build with
1902@option{--enable-libkvazaar}.
1903
1904@subsection Options
1905
1906@table @option
1907
1908@item b
1909Set target video bitrate in bit/s and enable rate control.
1910
1911@item kvazaar-params
1912Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
1913by commas (,). See kvazaar documentation for a list of options.
1914
1915@end table
1916
1917@section libopenh264
1918
1919Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
1920
1921This encoder requires the presence of the libopenh264 headers and
1922library during configuration. You need to explicitly configure the
1923build with @code{--enable-libopenh264}. The library is detected using
1924@command{pkg-config}.
1925
1926For more information about the library see
1927@url{http://www.openh264.org}.
1928
1929@subsection Options
1930
1931The following FFmpeg global options affect the configurations of the
1932libopenh264 encoder.
1933
1934@table @option
1935@item b
1936Set the bitrate (as a number of bits per second).
1937
1938@item g
1939Set the GOP size.
1940
1941@item maxrate
1942Set the max bitrate (as a number of bits per second).
1943
1944@item flags +global_header
1945Set global header in the bitstream.
1946
1947@item slices
1948Set the number of slices, used in parallelized encoding. Default value
1949is 0. This is only used when @option{slice_mode} is set to
1950@samp{fixed}.
1951
1952@item slice_mode
1953Set slice mode. Can assume one of the following possible values:
1954
1955@table @samp
1956@item fixed
1957a fixed number of slices
1958@item rowmb
1959one slice per row of macroblocks
1960@item auto
1961automatic number of slices according to number of threads
1962@item dyn
1963dynamic slicing
1964@end table
1965
1966Default value is @samp{auto}.
1967
1968@item loopfilter
1969Enable loop filter, if set to 1 (automatically enabled). To disable
1970set a value of 0.
1971
1972@item profile
1973Set profile restrictions. If set to the value of @samp{main} enable
1974CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
1975
1976@item max_nal_size
1977Set maximum NAL size in bytes.
1978
1979@item allow_skip_frames
1980Allow skipping frames to hit the target bitrate if set to 1.
1981@end table
1982
1983@section libtheora
1984
1985libtheora Theora encoder wrapper.
1986
1987Requires the presence of the libtheora headers and library during
1988configuration. You need to explicitly configure the build with
1989@code{--enable-libtheora}.
1990
1991For more information about the libtheora project see
1992@url{http://www.theora.org/}.
1993
1994@subsection Options
1995
1996The following global options are mapped to internal libtheora options
1997which affect the quality and the bitrate of the encoded stream.
1998
1999@table @option
2000@item b
2001Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode.  In
2002case VBR (Variable Bit Rate) mode is enabled this option is ignored.
2003
2004@item flags
2005Used to enable constant quality mode (VBR) encoding through the
2006@option{qscale} flag, and to enable the @code{pass1} and @code{pass2}
2007modes.
2008
2009@item g
2010Set the GOP size.
2011
2012@item global_quality
2013Set the global quality as an integer in lambda units.
2014
2015Only relevant when VBR mode is enabled with @code{flags +qscale}. The
2016value is converted to QP units by dividing it by @code{FF_QP2LAMBDA},
2017clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
2018value in the native libtheora range [0-63]. A higher value corresponds
2019to a higher quality.
2020
2021@item q
2022Enable VBR mode when set to a non-negative value, and set constant
2023quality value as a double floating point value in QP units.
2024
2025The value is clipped in the [0-10] range, and then multiplied by 6.3
2026to get a value in the native libtheora range [0-63].
2027
2028This option is valid only using the @command{ffmpeg} command-line
2029tool. For library interface users, use @option{global_quality}.
2030@end table
2031
2032@subsection Examples
2033
2034@itemize
2035@item
2036Set maximum constant quality (VBR) encoding with @command{ffmpeg}:
2037@example
2038ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
2039@end example
2040
2041@item
2042Use @command{ffmpeg} to convert a CBR 1000 kbps Theora video stream:
2043@example
2044ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
2045@end example
2046@end itemize
2047
2048@section libvpx
2049
2050VP8/VP9 format supported through libvpx.
2051
2052Requires the presence of the libvpx headers and library during configuration.
2053You need to explicitly configure the build with @code{--enable-libvpx}.
2054
2055@subsection Options
2056
2057The following options are supported by the libvpx wrapper. The
2058@command{vpxenc}-equivalent options or values are listed in parentheses
2059for easy migration.
2060
2061To reduce the duplication of documentation, only the private options
2062and some others requiring special attention are documented here. For
2063the documentation of the undocumented generic options, see
2064@ref{codec-options,,the Codec Options chapter}.
2065
2066To get more documentation of the libvpx options, invoke the command
2067@command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
2068@command{vpxenc --help}. Further information is available in the libvpx API
2069documentation.
2070
2071@table @option
2072
2073@item b (@emph{target-bitrate})
2074Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
2075expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
2076kilobits/s.
2077
2078@item g (@emph{kf-max-dist})
2079
2080@item keyint_min (@emph{kf-min-dist})
2081
2082@item qmin (@emph{min-q})
2083Minimum (Best Quality) Quantizer.
2084
2085@item qmax (@emph{max-q})
2086Maximum (Worst Quality) Quantizer.
2087Can be changed per-frame.
2088
2089@item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
2090Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
2091specified in milliseconds, the libvpx wrapper converts this value as follows:
2092@code{buf-sz = bufsize * 1000 / bitrate},
2093@code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
2094
2095@item rc_init_occupancy (@emph{buf-initial-sz})
2096Set number of bits which should be loaded into the rc buffer before decoding
2097starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
2098wrapper converts this value as follows:
2099@code{rc_init_occupancy * 1000 / bitrate}.
2100
2101@item undershoot-pct
2102Set datarate undershoot (min) percentage of the target bitrate.
2103
2104@item overshoot-pct
2105Set datarate overshoot (max) percentage of the target bitrate.
2106
2107@item skip_threshold (@emph{drop-frame})
2108
2109@item qcomp (@emph{bias-pct})
2110
2111@item maxrate (@emph{maxsection-pct})
2112Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
2113percentage of the target bitrate, the libvpx wrapper converts this value as
2114follows: @code{(maxrate * 100 / bitrate)}.
2115
2116@item minrate (@emph{minsection-pct})
2117Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
2118percentage of the target bitrate, the libvpx wrapper converts this value as
2119follows: @code{(minrate * 100 / bitrate)}.
2120
2121@item minrate, maxrate, b @emph{end-usage=cbr}
2122@code{(minrate == maxrate == bitrate)}.
2123
2124@item crf (@emph{end-usage=cq}, @emph{cq-level})
2125
2126@item tune (@emph{tune})
2127@table @samp
2128@item psnr (@emph{psnr})
2129@item ssim (@emph{ssim})
2130@end table
2131
2132@item quality, deadline (@emph{deadline})
2133@table @samp
2134@item best
2135Use best quality deadline. Poorly named and quite slow, this option should be
2136avoided as it may give worse quality output than good.
2137@item good
2138Use good quality deadline. This is a good trade-off between speed and quality
2139when used with the @option{cpu-used} option.
2140@item realtime
2141Use realtime quality deadline.
2142@end table
2143
2144@item speed, cpu-used (@emph{cpu-used})
2145Set quality/speed ratio modifier. Higher values speed up the encode at the cost
2146of quality.
2147
2148@item nr (@emph{noise-sensitivity})
2149
2150@item static-thresh
2151Set a change threshold on blocks below which they will be skipped by the
2152encoder.
2153
2154@item slices (@emph{token-parts})
2155Note that FFmpeg's @option{slices} option gives the total number of partitions,
2156while @command{vpxenc}'s @option{token-parts} is given as
2157@code{log2(partitions)}.
2158
2159@item max-intra-rate
2160Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
2161means unlimited.
2162
2163@item force_key_frames
2164@code{VPX_EFLAG_FORCE_KF}
2165
2166@item Alternate reference frame related
2167@table @option
2168@item auto-alt-ref
2169Enable use of alternate reference frames (2-pass only).
2170Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
2171@item arnr-maxframes
2172Set altref noise reduction max frame count.
2173@item arnr-type
2174Set altref noise reduction filter type: backward, forward, centered.
2175@item arnr-strength
2176Set altref noise reduction filter strength.
2177@item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
2178Set number of frames to look ahead for frametype and ratecontrol.
2179@end table
2180
2181@item error-resilient
2182Enable error resiliency features.
2183
2184@item sharpness @var{integer}
2185Increase sharpness at the expense of lower PSNR.
2186The valid range is [0, 7].
2187
2188@item ts-parameters
2189Sets the temporal scalability configuration using a :-separated list of
2190key=value pairs. For example, to specify temporal scalability parameters
2191with @code{ffmpeg}:
2192@example
2193ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
2194ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
2195ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
2196@end example
2197Below is a brief explanation of each of the parameters, please
2198refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more
2199details.
2200@table @option
2201@item ts_number_layers
2202Number of temporal coding layers.
2203@item ts_target_bitrate
2204Target bitrate for each temporal layer (in kbps).
2205(bitrate should be inclusive of the lower temporal layer).
2206@item ts_rate_decimator
2207Frame rate decimation factor for each temporal layer.
2208@item ts_periodicity
2209Length of the sequence defining frame temporal layer membership.
2210@item ts_layer_id
2211Template defining the membership of frames to temporal layers.
2212@item ts_layering_mode
2213(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
2214Currently supports the following options.
2215@table @option
2216@item 0
2217No temporal layering flags are provided internally,
2218relies on flags being passed in using @code{metadata} field in @code{AVFrame}
2219with following keys.
2220@table @option
2221@item vp8-flags
2222Sets the flags passed into the encoder to indicate the referencing scheme for
2223the current frame.
2224Refer to function @code{vpx_codec_encode} in @code{vpx/vpx_encoder.h} for more
2225details.
2226@item temporal_id
2227Explicitly sets the temporal id of the current frame to encode.
2228@end table
2229@item 2
2230Two temporal layers. 0-1...
2231@item 3
2232Three temporal layers. 0-2-1-2...; with single reference frame.
2233@item 4
2234Same as option "3", except there is a dependency between
2235the two temporal layer 2 frames within the temporal period.
2236@end table
2237@end table
2238
2239@item VP9-specific options
2240@table @option
2241@item lossless
2242Enable lossless mode.
2243@item tile-columns
2244Set number of tile columns to use. Note this is given as
2245@code{log2(tile_columns)}. For example, 8 tile columns would be requested by
2246setting the @option{tile-columns} option to 3.
2247@item tile-rows
2248Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
2249For example, 4 tile rows would be requested by setting the @option{tile-rows}
2250option to 2.
2251@item frame-parallel
2252Enable frame parallel decodability features.
2253@item aq-mode
2254Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
2255cyclic refresh, 4: equator360).
2256@item colorspace @emph{color-space}
2257Set input color space. The VP9 bitstream supports signaling the following
2258colorspaces:
2259@table @option
2260@item @samp{rgb} @emph{sRGB}
2261@item @samp{bt709} @emph{bt709}
2262@item @samp{unspecified} @emph{unknown}
2263@item @samp{bt470bg} @emph{bt601}
2264@item @samp{smpte170m} @emph{smpte170}
2265@item @samp{smpte240m} @emph{smpte240}
2266@item @samp{bt2020_ncl} @emph{bt2020}
2267@end table
2268@item row-mt @var{boolean}
2269Enable row based multi-threading.
2270@item tune-content
2271Set content type: default (0), screen (1), film (2).
2272@item corpus-complexity
2273Corpus VBR mode is a variant of standard VBR where the complexity distribution
2274midpoint is passed in rather than calculated for a specific clip or chunk.
2275
2276The valid range is [0, 10000]. 0 (default) uses standard VBR.
2277@item enable-tpl @var{boolean}
2278Enable temporal dependency model.
2279@item ref-frame-config
2280Using per-frame metadata, set members of the structure @code{vpx_svc_ref_frame_config_t} in @code{vpx/vp8cx.h} to fine-control referencing schemes and frame buffer management.
2281@*Use a :-separated list of key=value pairs.
2282For example,
2283@example
2284av_dict_set(&av_frame->metadata, "ref-frame-config", \
2285"rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0");
2286@end example
2287@table @option
2288@item rfc_update_buffer_slot
2289Indicates the buffer slot number to update
2290@item rfc_update_last
2291Indicates whether to update the LAST frame
2292@item rfc_update_golden
2293Indicates whether to update GOLDEN frame
2294@item rfc_update_alt_ref
2295Indicates whether to update ALT_REF frame
2296@item rfc_lst_fb_idx
2297LAST frame buffer index
2298@item rfc_gld_fb_idx
2299GOLDEN frame buffer index
2300@item rfc_alt_fb_idx
2301ALT_REF frame buffer index
2302@item rfc_reference_last
2303Indicates whether to reference LAST frame
2304@item rfc_reference_golden
2305Indicates whether to reference GOLDEN frame
2306@item rfc_reference_alt_ref
2307Indicates whether to reference ALT_REF frame
2308@item rfc_reference_duration
2309Indicates frame duration
2310@end table
2311@end table
2312
2313@end table
2314
2315For more information about libvpx see:
2316@url{http://www.webmproject.org/}
2317
2318@section libwebp
2319
2320libwebp WebP Image encoder wrapper
2321
2322libwebp is Google's official encoder for WebP images. It can encode in either
2323lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
2324frame. Lossless images are a separate codec developed by Google.
2325
2326@subsection Pixel Format
2327
2328Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
2329to limitations of the format and libwebp. Alpha is supported for either mode.
2330Because of API limitations, if RGB is passed in when encoding lossy or YUV is
2331passed in for encoding lossless, the pixel format will automatically be
2332converted using functions from libwebp. This is not ideal and is done only for
2333convenience.
2334
2335@subsection Options
2336
2337@table @option
2338
2339@item -lossless @var{boolean}
2340Enables/Disables use of lossless mode. Default is 0.
2341
2342@item -compression_level @var{integer}
2343For lossy, this is a quality/speed tradeoff. Higher values give better quality
2344for a given size at the cost of increased encoding time. For lossless, this is
2345a size/speed tradeoff. Higher values give smaller size at the cost of increased
2346encoding time. More specifically, it controls the number of extra algorithms
2347and compression tools used, and varies the combination of these tools. This
2348maps to the @var{method} option in libwebp. The valid range is 0 to 6.
2349Default is 4.
2350
2351@item -quality @var{float}
2352For lossy encoding, this controls image quality. For lossless encoding, this
2353controls the effort and time spent in compression.
2354Range is 0 to 100. Default is 75.
2355
2356@item -preset @var{type}
2357Configuration preset. This does some automatic settings based on the general
2358type of the image.
2359@table @option
2360@item none
2361Do not use a preset.
2362@item default
2363Use the encoder default.
2364@item picture
2365Digital picture, like portrait, inner shot
2366@item photo
2367Outdoor photograph, with natural lighting
2368@item drawing
2369Hand or line drawing, with high-contrast details
2370@item icon
2371Small-sized colorful images
2372@item text
2373Text-like
2374@end table
2375
2376@end table
2377
2378@section libx264, libx264rgb
2379
2380x264 H.264/MPEG-4 AVC encoder wrapper.
2381
2382This encoder requires the presence of the libx264 headers and library
2383during configuration. You need to explicitly configure the build with
2384@code{--enable-libx264}.
2385
2386libx264 supports an impressive number of features, including 8x8 and
23874x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
2388entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
2389for detail retention (adaptive quantization, psy-RD, psy-trellis).
2390
2391Many libx264 encoder options are mapped to FFmpeg global codec
2392options, while unique encoder options are provided through private
2393options. Additionally the @option{x264opts} and @option{x264-params}
2394private options allows one to pass a list of key=value tuples as accepted
2395by the libx264 @code{x264_param_parse} function.
2396
2397The x264 project website is at
2398@url{http://www.videolan.org/developers/x264.html}.
2399
2400The libx264rgb encoder is the same as libx264, except it accepts packed RGB
2401pixel formats as input instead of YUV.
2402
2403@subsection Supported Pixel Formats
2404
2405x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
2406x264's configure time.
2407
2408@subsection Options
2409
2410The following options are supported by the libx264 wrapper. The
2411@command{x264}-equivalent options or values are listed in parentheses
2412for easy migration.
2413
2414To reduce the duplication of documentation, only the private options
2415and some others requiring special attention are documented here. For
2416the documentation of the undocumented generic options, see
2417@ref{codec-options,,the Codec Options chapter}.
2418
2419To get a more accurate and extensive documentation of the libx264
2420options, invoke the command @command{x264 --fullhelp} or consult
2421the libx264 documentation.
2422
2423@table @option
2424@item b (@emph{bitrate})
2425Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
2426expressed in bits/s, while @command{x264}'s @option{bitrate} is in
2427kilobits/s.
2428
2429@item bf (@emph{bframes})
2430
2431@item g (@emph{keyint})
2432
2433@item qmin (@emph{qpmin})
2434Minimum quantizer scale.
2435
2436@item qmax (@emph{qpmax})
2437Maximum quantizer scale.
2438
2439@item qdiff (@emph{qpstep})
2440Maximum difference between quantizer scales.
2441
2442@item qblur (@emph{qblur})
2443Quantizer curve blur
2444
2445@item qcomp (@emph{qcomp})
2446Quantizer curve compression factor
2447
2448@item refs (@emph{ref})
2449Number of reference frames each P-frame can use. The range is from @var{0-16}.
2450
2451@item sc_threshold (@emph{scenecut})
2452Sets the threshold for the scene change detection.
2453
2454@item trellis (@emph{trellis})
2455Performs Trellis quantization to increase efficiency. Enabled by default.
2456
2457@item nr  (@emph{nr})
2458
2459@item me_range (@emph{merange})
2460Maximum range of the motion search in pixels.
2461
2462@item me_method (@emph{me})
2463Set motion estimation method. Possible values in the decreasing order
2464of speed:
2465
2466@table @samp
2467@item dia (@emph{dia})
2468@item epzs (@emph{dia})
2469Diamond search with radius 1 (fastest). @samp{epzs} is an alias for
2470@samp{dia}.
2471@item hex (@emph{hex})
2472Hexagonal search with radius 2.
2473@item umh (@emph{umh})
2474Uneven multi-hexagon search.
2475@item esa (@emph{esa})
2476Exhaustive search.
2477@item tesa (@emph{tesa})
2478Hadamard exhaustive search (slowest).
2479@end table
2480
2481@item forced-idr
2482Normally, when forcing a I-frame type, the encoder can select any type
2483of I-frame. This option forces it to choose an IDR-frame.
2484
2485@item subq (@emph{subme})
2486Sub-pixel motion estimation method.
2487
2488@item b_strategy (@emph{b-adapt})
2489Adaptive B-frame placement decision algorithm. Use only on first-pass.
2490
2491@item keyint_min (@emph{min-keyint})
2492Minimum GOP size.
2493
2494@item coder
2495Set entropy encoder. Possible values:
2496
2497@table @samp
2498@item ac
2499Enable CABAC.
2500
2501@item vlc
2502Enable CAVLC and disable CABAC. It generates the same effect as
2503@command{x264}'s @option{--no-cabac} option.
2504@end table
2505
2506@item cmp
2507Set full pixel motion estimation comparison algorithm. Possible values:
2508
2509@table @samp
2510@item chroma
2511Enable chroma in motion estimation.
2512
2513@item sad
2514Ignore chroma in motion estimation. It generates the same effect as
2515@command{x264}'s @option{--no-chroma-me} option.
2516@end table
2517
2518@item threads (@emph{threads})
2519Number of encoding threads.
2520
2521@item thread_type
2522Set multithreading technique. Possible values:
2523
2524@table @samp
2525@item slice
2526Slice-based multithreading. It generates the same effect as
2527@command{x264}'s @option{--sliced-threads} option.
2528@item frame
2529Frame-based multithreading.
2530@end table
2531
2532@item flags
2533Set encoding flags. It can be used to disable closed GOP and enable
2534open GOP by setting it to @code{-cgop}. The result is similar to
2535the behavior of @command{x264}'s @option{--open-gop} option.
2536
2537@item rc_init_occupancy (@emph{vbv-init})
2538
2539@item preset (@emph{preset})
2540Set the encoding preset.
2541
2542@item tune (@emph{tune})
2543Set tuning of the encoding params.
2544
2545@item profile (@emph{profile})
2546Set profile restrictions.
2547
2548@item fastfirstpass
2549Enable fast settings when encoding first pass, when set to 1. When set
2550to 0, it has the same effect of @command{x264}'s
2551@option{--slow-firstpass} option.
2552
2553@item crf (@emph{crf})
2554Set the quality for constant quality mode.
2555
2556@item crf_max (@emph{crf-max})
2557In CRF mode, prevents VBV from lowering quality beyond this point.
2558
2559@item qp (@emph{qp})
2560Set constant quantization rate control method parameter.
2561
2562@item aq-mode (@emph{aq-mode})
2563Set AQ method. Possible values:
2564
2565@table @samp
2566@item none (@emph{0})
2567Disabled.
2568
2569@item variance (@emph{1})
2570Variance AQ (complexity mask).
2571
2572@item autovariance (@emph{2})
2573Auto-variance AQ (experimental).
2574@end table
2575
2576@item aq-strength (@emph{aq-strength})
2577Set AQ strength, reduce blocking and blurring in flat and textured areas.
2578
2579@item psy
2580Use psychovisual optimizations when set to 1. When set to 0, it has the
2581same effect as @command{x264}'s @option{--no-psy} option.
2582
2583@item psy-rd  (@emph{psy-rd})
2584Set strength of psychovisual optimization, in
2585@var{psy-rd}:@var{psy-trellis} format.
2586
2587@item rc-lookahead (@emph{rc-lookahead})
2588Set number of frames to look ahead for frametype and ratecontrol.
2589
2590@item weightb
2591Enable weighted prediction for B-frames when set to 1. When set to 0,
2592it has the same effect as @command{x264}'s @option{--no-weightb} option.
2593
2594@item weightp (@emph{weightp})
2595Set weighted prediction method for P-frames. Possible values:
2596
2597@table @samp
2598@item none (@emph{0})
2599Disabled
2600@item simple (@emph{1})
2601Enable only weighted refs
2602@item smart (@emph{2})
2603Enable both weighted refs and duplicates
2604@end table
2605
2606@item ssim (@emph{ssim})
2607Enable calculation and printing SSIM stats after the encoding.
2608
2609@item intra-refresh (@emph{intra-refresh})
2610Enable the use of Periodic Intra Refresh instead of IDR frames when set
2611to 1.
2612
2613@item avcintra-class (@emph{class})
2614Configure the encoder to generate AVC-Intra.
2615Valid values are 50,100 and 200
2616
2617@item bluray-compat (@emph{bluray-compat})
2618Configure the encoder to be compatible with the bluray standard.
2619It is a shorthand for setting "bluray-compat=1 force-cfr=1".
2620
2621@item b-bias (@emph{b-bias})
2622Set the influence on how often B-frames are used.
2623
2624@item b-pyramid (@emph{b-pyramid})
2625Set method for keeping of some B-frames as references. Possible values:
2626
2627@table @samp
2628@item none (@emph{none})
2629Disabled.
2630@item strict (@emph{strict})
2631Strictly hierarchical pyramid.
2632@item normal (@emph{normal})
2633Non-strict (not Blu-ray compatible).
2634@end table
2635
2636@item mixed-refs
2637Enable the use of one reference per partition, as opposed to one
2638reference per macroblock when set to 1. When set to 0, it has the
2639same effect as @command{x264}'s @option{--no-mixed-refs} option.
2640
2641@item 8x8dct
2642Enable adaptive spatial transform (high profile 8x8 transform)
2643when set to 1. When set to 0, it has the same effect as
2644@command{x264}'s @option{--no-8x8dct} option.
2645
2646@item fast-pskip
2647Enable early SKIP detection on P-frames when set to 1. When set
2648to 0, it has the same effect as @command{x264}'s
2649@option{--no-fast-pskip} option.
2650
2651@item aud (@emph{aud})
2652Enable use of access unit delimiters when set to 1.
2653
2654@item mbtree
2655Enable use macroblock tree ratecontrol when set to 1. When set
2656to 0, it has the same effect as @command{x264}'s
2657@option{--no-mbtree} option.
2658
2659@item deblock (@emph{deblock})
2660Set loop filter parameters, in @var{alpha}:@var{beta} form.
2661
2662@item cplxblur (@emph{cplxblur})
2663Set fluctuations reduction in QP (before curve compression).
2664
2665@item partitions (@emph{partitions})
2666Set partitions to consider as a comma-separated list of. Possible
2667values in the list:
2668
2669@table @samp
2670@item p8x8
26718x8 P-frame partition.
2672@item p4x4
26734x4 P-frame partition.
2674@item b8x8
26754x4 B-frame partition.
2676@item i8x8
26778x8 I-frame partition.
2678@item i4x4
26794x4 I-frame partition.
2680(Enabling @samp{p4x4} requires @samp{p8x8} to be enabled. Enabling
2681@samp{i8x8} requires adaptive spatial transform (@option{8x8dct}
2682option) to be enabled.)
2683@item none (@emph{none})
2684Do not consider any partitions.
2685@item all (@emph{all})
2686Consider every partition.
2687@end table
2688
2689@item direct-pred (@emph{direct})
2690Set direct MV prediction mode. Possible values:
2691
2692@table @samp
2693@item none (@emph{none})
2694Disable MV prediction.
2695@item spatial (@emph{spatial})
2696Enable spatial predicting.
2697@item temporal (@emph{temporal})
2698Enable temporal predicting.
2699@item auto (@emph{auto})
2700Automatically decided.
2701@end table
2702
2703@item slice-max-size (@emph{slice-max-size})
2704Set the limit of the size of each slice in bytes. If not specified
2705but RTP payload size (@option{ps}) is specified, that is used.
2706
2707@item stats (@emph{stats})
2708Set the file name for multi-pass stats.
2709
2710@item nal-hrd (@emph{nal-hrd})
2711Set signal HRD information (requires @option{vbv-bufsize} to be set).
2712Possible values:
2713
2714@table @samp
2715@item none (@emph{none})
2716Disable HRD information signaling.
2717@item vbr (@emph{vbr})
2718Variable bit rate.
2719@item cbr (@emph{cbr})
2720Constant bit rate (not allowed in MP4 container).
2721@end table
2722
2723@item x264opts (N.A.)
2724Set any x264 option, see @command{x264 --fullhelp} for a list.
2725
2726Argument is a list of @var{key}=@var{value} couples separated by
2727":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
2728themselves, use "," instead. They accept it as well since long ago but this
2729is kept undocumented for some reason.
2730
2731For example to specify libx264 encoding options with @command{ffmpeg}:
2732@example
2733ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
2734@end example
2735
2736@item a53cc @var{boolean}
2737Import closed captions (which must be ATSC compatible format) into output.
2738Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
2739
2740@item udu_sei @var{boolean}
2741Import user data unregistered SEI if available into output. Default is 0 (off).
2742
2743@item x264-params (N.A.)
2744Override the x264 configuration using a :-separated list of key=value
2745parameters.
2746
2747This option is functionally the same as the @option{x264opts}, but is
2748duplicated for compatibility with the Libav fork.
2749
2750For example to specify libx264 encoding options with @command{ffmpeg}:
2751@example
2752ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
2753cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
2754no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
2755@end example
2756@end table
2757
2758Encoding ffpresets for common usages are provided so they can be used with the
2759general presets system (e.g. passing the @option{pre} option).
2760
2761@section libx265
2762
2763x265 H.265/HEVC encoder wrapper.
2764
2765This encoder requires the presence of the libx265 headers and library
2766during configuration. You need to explicitly configure the build with
2767@option{--enable-libx265}.
2768
2769@subsection Options
2770
2771@table @option
2772@item b
2773Sets target video bitrate.
2774
2775@item bf
2776
2777@item g
2778Set the GOP size.
2779
2780@item keyint_min
2781Minimum GOP size.
2782
2783@item refs
2784Number of reference frames each P-frame can use. The range is from @var{1-16}.
2785
2786@item preset
2787Set the x265 preset.
2788
2789@item tune
2790Set the x265 tune parameter.
2791
2792@item profile
2793Set profile restrictions.
2794
2795@item crf
2796Set the quality for constant quality mode.
2797
2798@item qp
2799Set constant quantization rate control method parameter.
2800
2801@item qmin
2802Minimum quantizer scale.
2803
2804@item qmax
2805Maximum quantizer scale.
2806
2807@item qdiff
2808Maximum difference between quantizer scales.
2809
2810@item qblur
2811Quantizer curve blur
2812
2813@item qcomp
2814Quantizer curve compression factor
2815
2816@item i_qfactor
2817
2818@item b_qfactor
2819
2820@item forced-idr
2821Normally, when forcing a I-frame type, the encoder can select any type
2822of I-frame. This option forces it to choose an IDR-frame.
2823
2824@item udu_sei @var{boolean}
2825Import user data unregistered SEI if available into output. Default is 0 (off).
2826
2827@item x265-params
2828Set x265 options using a list of @var{key}=@var{value} couples separated
2829by ":". See @command{x265 --help} for a list of options.
2830
2831For example to specify libx265 encoding options with @option{-x265-params}:
2832
2833@example
2834ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
2835@end example
2836@end table
2837
2838@section libxavs2
2839
2840xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
2841
2842This encoder requires the presence of the libxavs2 headers and library
2843during configuration. You need to explicitly configure the build with
2844@option{--enable-libxavs2}.
2845
2846The following standard libavcodec options are used:
2847@itemize
2848@item
2849@option{b} / @option{bit_rate}
2850@item
2851@option{g} / @option{gop_size}
2852@item
2853@option{bf} / @option{max_b_frames}
2854@end itemize
2855
2856The encoder also has its own specific options:
2857@subsection Options
2858
2859@table @option
2860@item lcu_row_threads
2861Set the number of parallel threads for rows from 1 to 8 (default 5).
2862
2863@item initial_qp
2864Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
2865used to set the initial qp for the first frame.
2866
2867@item qp
2868Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
2869used to set the qp value under constant-QP mode.
2870
2871@item max_qp
2872Set the max qp for rate control from 1 to 63 (default 55).
2873
2874@item min_qp
2875Set the min qp for rate control from 1 to 63 (default 20).
2876
2877@item speed_level
2878Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
2879
2880@item log_level
2881Set the log level from -1 to 3 (default 0). -1: none, 0: error,
28821: warning, 2: info, 3: debug.
2883
2884@item xavs2-params
2885Set xavs2 options using a list of @var{key}=@var{value} couples separated
2886by ":".
2887
2888For example to specify libxavs2 encoding options with @option{-xavs2-params}:
2889
2890@example
2891ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
2892@end example
2893@end table
2894
2895@section libxvid
2896
2897Xvid MPEG-4 Part 2 encoder wrapper.
2898
2899This encoder requires the presence of the libxvidcore headers and library
2900during configuration. You need to explicitly configure the build with
2901@code{--enable-libxvid --enable-gpl}.
2902
2903The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
2904users can encode to this format without this library.
2905
2906@subsection Options
2907
2908The following options are supported by the libxvid wrapper. Some of
2909the following options are listed but are not documented, and
2910correspond to shared codec options. See @ref{codec-options,,the Codec
2911Options chapter} for their documentation. The other shared options
2912which are not listed have no effect for the libxvid encoder.
2913
2914@table @option
2915@item b
2916
2917@item g
2918
2919@item qmin
2920
2921@item qmax
2922
2923@item mpeg_quant
2924
2925@item threads
2926
2927@item bf
2928
2929@item b_qfactor
2930
2931@item b_qoffset
2932
2933@item flags
2934Set specific encoding flags. Possible values:
2935
2936@table @samp
2937
2938@item mv4
2939Use four motion vector by macroblock.
2940
2941@item aic
2942Enable high quality AC prediction.
2943
2944@item gray
2945Only encode grayscale.
2946
2947@item gmc
2948Enable the use of global motion compensation (GMC).
2949
2950@item qpel
2951Enable quarter-pixel motion compensation.
2952
2953@item cgop
2954Enable closed GOP.
2955
2956@item global_header
2957Place global headers in extradata instead of every keyframe.
2958
2959@end table
2960
2961@item trellis
2962
2963@item me_method
2964Set motion estimation method. Possible values in decreasing order of
2965speed and increasing order of quality:
2966
2967@table @samp
2968@item zero
2969Use no motion estimation (default).
2970
2971@item phods
2972@item x1
2973@item log
2974Enable advanced diamond zonal search for 16x16 blocks and half-pixel
2975refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
2976@samp{phods}.
2977
2978@item epzs
2979Enable all of the things described above, plus advanced diamond zonal
2980search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
2981estimation on chroma planes.
2982
2983@item full
2984Enable all of the things described above, plus extended 16x16 and 8x8
2985blocks search.
2986@end table
2987
2988@item mbd
2989Set macroblock decision algorithm. Possible values in the increasing
2990order of quality:
2991
2992@table @samp
2993@item simple
2994Use macroblock comparing function algorithm (default).
2995
2996@item bits
2997Enable rate distortion-based half pixel and quarter pixel refinement for
299816x16 blocks.
2999
3000@item rd
3001Enable all of the things described above, plus rate distortion-based
3002half pixel and quarter pixel refinement for 8x8 blocks, and rate
3003distortion-based search using square pattern.
3004@end table
3005
3006@item lumi_aq
3007Enable lumi masking adaptive quantization when set to 1. Default is 0
3008(disabled).
3009
3010@item variance_aq
3011Enable variance adaptive quantization when set to 1. Default is 0
3012(disabled).
3013
3014When combined with @option{lumi_aq}, the resulting quality will not
3015be better than any of the two specified individually. In other
3016words, the resulting quality will be the worse one of the two
3017effects.
3018
3019@item ssim
3020Set structural similarity (SSIM) displaying method. Possible values:
3021
3022@table @samp
3023@item off
3024Disable displaying of SSIM information.
3025
3026@item avg
3027Output average SSIM at the end of encoding to stdout. The format of
3028showing the average SSIM is:
3029
3030@example
3031Average SSIM: %f
3032@end example
3033
3034For users who are not familiar with C, %f means a float number, or
3035a decimal (e.g. 0.939232).
3036
3037@item frame
3038Output both per-frame SSIM data during encoding and average SSIM at
3039the end of encoding to stdout. The format of per-frame information
3040is:
3041
3042@example
3043       SSIM: avg: %1.3f min: %1.3f max: %1.3f
3044@end example
3045
3046For users who are not familiar with C, %1.3f means a float number
3047rounded to 3 digits after the dot (e.g. 0.932).
3048
3049@end table
3050
3051@item ssim_acc
3052Set SSIM accuracy. Valid options are integers within the range of
30530-4, while 0 gives the most accurate result and 4 computes the
3054fastest.
3055
3056@end table
3057
3058@section MediaFoundation
3059
3060This provides wrappers to encoders (both audio and video) in the
3061MediaFoundation framework. It can access both SW and HW encoders.
3062Video encoders can take input in either of nv12 or yuv420p form
3063(some encoders support both, some support only either - in practice,
3064nv12 is the safer choice, especially among HW encoders).
3065
3066@section mpeg2
3067
3068MPEG-2 video encoder.
3069
3070@subsection Options
3071
3072@table @option
3073@item profile
3074Select the mpeg2 profile to encode:
3075
3076@table @samp
3077@item 422
3078@item high
3079@item ss
3080Spatially Scalable
3081@item snr
3082SNR Scalable
3083@item main
3084@item simple
3085@end table
3086
3087@item level
3088Select the mpeg2 level to encode:
3089
3090@table @samp
3091@item high
3092@item high1440
3093@item main
3094@item low
3095@end table
3096
3097@item seq_disp_ext @var{integer}
3098Specifies if the encoder should write a sequence_display_extension to the
3099output.
3100@table @option
3101@item -1
3102@itemx auto
3103Decide automatically to write it or not (this is the default) by checking if
3104the data to be written is different from the default or unspecified values.
3105@item 0
3106@itemx never
3107Never write it.
3108@item 1
3109@itemx always
3110Always write it.
3111@end table
3112@item video_format @var{integer}
3113Specifies the video_format written into the sequence display extension
3114indicating the source of the video pictures. The default is @samp{unspecified},
3115can be @samp{component}, @samp{pal}, @samp{ntsc}, @samp{secam} or @samp{mac}.
3116For maximum compatibility, use @samp{component}.
3117@item a53cc @var{boolean}
3118Import closed captions (which must be ATSC compatible format) into output.
3119Default is 1 (on).
3120@end table
3121
3122@section png
3123
3124PNG image encoder.
3125
3126@subsection Private options
3127
3128@table @option
3129@item dpi @var{integer}
3130Set physical density of pixels, in dots per inch, unset by default
3131@item dpm @var{integer}
3132Set physical density of pixels, in dots per meter, unset by default
3133@end table
3134
3135@section ProRes
3136
3137Apple ProRes encoder.
3138
3139FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
3140The used encoder can be chosen with the @code{-vcodec} option.
3141
3142@subsection Private Options for prores-ks
3143
3144@table @option
3145@item profile @var{integer}
3146Select the ProRes profile to encode
3147@table @samp
3148@item proxy
3149@item lt
3150@item standard
3151@item hq
3152@item 4444
3153@item 4444xq
3154@end table
3155
3156@item quant_mat @var{integer}
3157Select quantization matrix.
3158@table @samp
3159@item auto
3160@item default
3161@item proxy
3162@item lt
3163@item standard
3164@item hq
3165@end table
3166If set to @var{auto}, the matrix matching the profile will be picked.
3167If not set, the matrix providing the highest quality, @var{default}, will be
3168picked.
3169
3170@item bits_per_mb @var{integer}
3171How many bits to allot for coding one macroblock. Different profiles use
3172between 200 and 2400 bits per macroblock, the maximum is 8000.
3173
3174@item mbs_per_slice @var{integer}
3175Number of macroblocks in each slice (1-8); the default value (8)
3176should be good in almost all situations.
3177
3178@item vendor @var{string}
3179Override the 4-byte vendor ID.
3180A custom vendor ID like @var{apl0} would claim the stream was produced by
3181the Apple encoder.
3182
3183@item alpha_bits @var{integer}
3184Specify number of bits for alpha component.
3185Possible values are @var{0}, @var{8} and @var{16}.
3186Use @var{0} to disable alpha plane coding.
3187
3188@end table
3189
3190@subsection Speed considerations
3191
3192In the default mode of operation the encoder has to honor frame constraints
3193(i.e. not produce frames with size bigger than requested) while still making
3194output picture as good as possible.
3195A frame containing a lot of small details is harder to compress and the encoder
3196would spend more time searching for appropriate quantizers for each slice.
3197
3198Setting a higher @option{bits_per_mb} limit will improve the speed.
3199
3200For the fastest encoding speed set the @option{qscale} parameter (4 is the
3201recommended value) and do not set a size constraint.
3202
3203@section QSV Encoders
3204
3205The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG
3206and VP9)
3207
3208@subsection Ratecontrol Method
3209The ratecontrol method is selected as follows:
3210@itemize @bullet
3211@item
3212When @option{global_quality} is specified, a quality-based mode is used.
3213Specifically this means either
3214@itemize @minus
3215@item
3216@var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
3217also set (the @option{-qscale} ffmpeg option).
3218
3219@item
3220@var{LA_ICQ} - intelligent constant quality with lookahead, when the
3221@option{look_ahead} option is also set.
3222
3223@item
3224@var{ICQ} -- intelligent constant quality otherwise. For the ICQ modes, global
3225quality range is 1 to 51, with 1 being the best quality.
3226@end itemize
3227
3228@item
3229Otherwise, a bitrate-based mode is used. For all of those, you should specify at
3230least the desired average bitrate with the @option{b} option.
3231@itemize @minus
3232@item
3233@var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
3234
3235@item
3236@var{VCM} - video conferencing mode, when the @option{vcm} option is set.
3237
3238@item
3239@var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
3240the average bitrate.
3241
3242@item
3243@var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
3244than the average bitrate.
3245
3246@item
3247@var{AVBR} - average VBR mode, when @option{maxrate} is not specified. This mode
3248is further configured by the @option{avbr_accuracy} and
3249@option{avbr_convergence} options.
3250@end itemize
3251@end itemize
3252
3253Note that depending on your system, a different mode than the one you specified
3254may be selected by the encoder. Set the verbosity level to @var{verbose} or
3255higher to see the actual settings used by the QSV runtime.
3256
3257@subsection Global Options -> MSDK Options
3258Additional libavcodec global options are mapped to MSDK options as follows:
3259
3260@itemize
3261@item
3262@option{g/gop_size} -> @option{GopPicSize}
3263
3264@item
3265@option{bf/max_b_frames}+1 -> @option{GopRefDist}
3266
3267@item
3268@option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
3269@option{InitialDelayInKB}
3270
3271@item
3272@option{slices} -> @option{NumSlice}
3273
3274@item
3275@option{refs} -> @option{NumRefFrame}
3276
3277@item
3278@option{b_strategy/b_frame_strategy} -> @option{BRefType}
3279
3280@item
3281@option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
3282
3283@item
3284For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
3285@option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
3286and @var{QPP} and @var{QPB} respectively.
3287
3288@item
3289Setting the @option{coder} option to the value @var{vlc} will make the H.264
3290encoder use CAVLC instead of CABAC.
3291
3292@end itemize
3293
3294@subsection Common Options
3295Following options are used by all qsv encoders.
3296
3297@table @option
3298@item @var{async_depth}
3299Specifies how many asynchronous operations an application performs
3300before the application explicitly synchronizes the result. If zero,
3301the value is not specified.
3302
3303@item @var{avbr_accuracy}
3304Accuracy of the AVBR ratecontrol (unit of tenth of percent).
3305
3306@item @var{avbr_convergence}
3307Convergence of the AVBR ratecontrol (unit of 100 frames)
3308
3309The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the
3310average variable bitrate control (AVBR) algorithm.
3311The algorithm focuses on overall encoding quality while meeting the specified
3312bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy},
3313after a @var{avbr_Convergence} period. This method does not follow HRD and the
3314instant bitrate is not capped or padded.
3315
3316@item @var{preset}
3317This option itemizes a range of choices from veryfast (best speed) to veryslow
3318(best quality).
3319@table @samp
3320@item veryfast
3321@item faster
3322@item fast
3323@item medium
3324@item slow
3325@item slower
3326@item veryslow
3327@end table
3328
3329@item @var{forced_idr}
3330Forcing I frames as IDR frames.
3331
3332@item @var{low_power}
3333For encoders set this flag to ON to reduce power consumption and GPU usage.
3334@end table
3335
3336@subsection Runtime Options
3337Following options can be used durning qsv encoding.
3338
3339@table @option
3340@item @var{qsv_config_qp}
3341Supported in h264_qsv and hevc_qsv.
3342This option can be set in per-frame metadata. QP parameter can be dynamically
3343changed when encoding in CQP mode.
3344@end table
3345
3346@subsection H264 options
3347These options are used by h264_qsv
3348
3349@table @option
3350@item @var{extbrc}
3351Extended bitrate control.
3352
3353@item @var{recovery_point_sei}
3354Set this flag to insert the recovery point SEI message at the beginning of every
3355intra refresh cycle.
3356
3357@item @var{rdo}
3358Enable rate distortion optimization.
3359
3360@item @var{max_frame_size}
3361Maximum encoded frame size in bytes.
3362
3363@item @var{max_frame_size_i}
3364Maximum encoded frame size for I frames in bytes. If this value is set as larger
3365than zero, then for I frames the value set by max_frame_size is ignored.
3366
3367@item @var{max_frame_size_p}
3368Maximum encoded frame size for P frames in bytes. If this value is set as larger
3369than zero, then for P frames the value set by max_frame_size is ignored.
3370
3371@item @var{max_slice_size}
3372Maximum encoded slice size in bytes.
3373
3374@item @var{bitrate_limit}
3375Toggle bitrate limitations.
3376Modifies bitrate to be in the range imposed by the QSV encoder. Setting this
3377flag off may lead to violation of HRD conformance. Mind that specifying bitrate
3378below the QSV encoder range might significantly affect quality. If on this
3379option takes effect in non CQP modes: if bitrate is not in the range imposed
3380by the QSV encoder, it will be changed to be in the range.
3381
3382@item @var{mbbrc}
3383Setting this flag enables macroblock level bitrate control that generally
3384improves subjective visual quality. Enabling this flag may have negative impact
3385on performance and objective visual quality metric.
3386
3387@item @var{low_delay_brc}
3388Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
3389more accurate bitrate control to minimize the variance of bitstream size frame
3390by frame. Value: -1-default 0-off 1-on
3391
3392@item @var{adaptive_i}
3393This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
3394to allow changing of frame type from P and B to I.
3395
3396@item @var{adaptive_b}
3397This flag controls changing of frame type from B to P.
3398
3399@item @var{p_strategy}
3400Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
3401
3402@item @var{b_strategy}
3403This option controls usage of B frames as reference.
3404
3405@item @var{dblk_idc}
3406This option disable deblocking. It has value in range 0~2.
3407
3408@item @var{cavlc}
3409If set, CAVLC is used; if unset, CABAC is used for encoding.
3410
3411@item @var{vcm}
3412Video conferencing mode, please see ratecontrol method.
3413
3414@item @var{idr_interval}
3415Distance (in I-frames) between IDR frames.
3416
3417@item @var{pic_timing_sei}
3418Insert picture timing SEI with pic_struct_syntax element.
3419
3420@item @var{single_sei_nal_unit}
3421Put all the SEI messages into one NALU.
3422
3423@item @var{max_dec_frame_buffering}
3424Maximum number of frames buffered in the DPB.
3425
3426@item @var{look_ahead}
3427Use VBR algorithm with look ahead.
3428
3429@item @var{look_ahead_depth}
3430Depth of look ahead in number frames.
3431
3432@item @var{look_ahead_downsampling}
3433Downscaling factor for the frames saved for the lookahead analysis.
3434@table @samp
3435@item unknown
3436@item auto
3437@item off
3438@item 2x
3439@item 4x
3440@end table
3441
3442@item @var{int_ref_type}
3443Specifies intra refresh type. The major goal of intra refresh is improvement of
3444error resilience without significant impact on encoded bitstream size caused by
3445I frames. The SDK encoder achieves this by encoding part of each frame in
3446refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means
3447vertical refresh, by column of MBs. To enable intra refresh, B frame should be
3448set to 0.
3449
3450@item @var{int_ref_cycle_size}
3451Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
3452invalid values.
3453
3454@item @var{int_ref_qp_delta}
3455Specifies QP difference for inserted intra MBs. This is signed value in
3456[-51, 51] range if target encoding bit-depth for luma samples is 8 and this
3457range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
3458
3459@item @var{int_ref_cycle_dist}
3460Distance between the beginnings of the intra-refresh cycles in frames.
3461
3462@item @var{profile}
3463@table @samp
3464@item unknown
3465@item baseline
3466@item main
3467@item high
3468@end table
3469
3470@item @var{a53cc}
3471Use A53 Closed Captions (if available).
3472
3473@item @var{aud}
3474Insert the Access Unit Delimiter NAL.
3475
3476@item @var{mfmode}
3477Multi-Frame Mode.
3478@table @samp
3479@item off
3480@item auto
3481@end table
3482
3483@item @var{repeat_pps}
3484Repeat pps for every frame.
3485
3486@item @var{max_qp_i}
3487Maximum video quantizer scale for I frame.
3488
3489@item @var{min_qp_i}
3490Minimum video quantizer scale for I frame.
3491
3492@item @var{max_qp_p}
3493Maximum video quantizer scale for P frame.
3494
3495@item @var{min_qp_p}
3496Minimum video quantizer scale for P frame.
3497
3498@item @var{max_qp_b}
3499Maximum video quantizer scale for B frame.
3500
3501@item @var{min_qp_b}
3502Minimum video quantizer scale for B frame.
3503@end table
3504
3505@subsection HEVC Options
3506These options are used by hevc_qsv
3507
3508@table @option
3509@item @var{extbrc}
3510Extended bitrate control.
3511
3512@item @var{recovery_point_sei}
3513Set this flag to insert the recovery point SEI message at the beginning of every
3514intra refresh cycle.
3515
3516@item @var{rdo}
3517Enable rate distortion optimization.
3518
3519@item @var{max_frame_size}
3520Maximum encoded frame size in bytes.
3521
3522@item @var{max_frame_size_i}
3523Maximum encoded frame size for I frames in bytes. If this value is set as larger
3524than zero, then for I frames the value set by max_frame_size is ignored.
3525
3526@item @var{max_frame_size_p}
3527Maximum encoded frame size for P frames in bytes. If this value is set as larger
3528than zero, then for P frames the value set by max_frame_size is ignored.
3529
3530@item @var{max_slice_size}
3531Maximum encoded slice size in bytes.
3532
3533@item @var{mbbrc}
3534Setting this flag enables macroblock level bitrate control that generally
3535improves subjective visual quality. Enabling this flag may have negative impact
3536on performance and objective visual quality metric.
3537
3538@item @var{low_delay_brc}
3539Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
3540more accurate bitrate control to minimize the variance of bitstream size frame
3541by frame. Value: -1-default 0-off 1-on
3542
3543@item @var{p_strategy}
3544Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
3545
3546@item @var{b_strategy}
3547This option controls usage of B frames as reference.
3548
3549@item @var{dblk_idc}
3550This option disable deblocking. It has value in range 0~2.
3551
3552@item @var{idr_interval}
3553Distance (in I-frames) between IDR frames.
3554@table @samp
3555@item begin_only
3556Output an IDR-frame only at the beginning of the stream.
3557@end table
3558
3559@item @var{load_plugin}
3560A user plugin to load in an internal session.
3561@table @samp
3562@item none
3563@item hevc_sw
3564@item hevc_hw
3565@end table
3566
3567@item @var{load_plugins}
3568A :-separate list of hexadecimal plugin UIDs to load in
3569an internal session.
3570
3571@item @var{look_ahead_depth}
3572Depth of look ahead in number frames, available when extbrc option is enabled.
3573
3574@item @var{profile}
3575Set the encoding profile (scc requires libmfx >= 1.32).
3576
3577@table @samp
3578@item unknown
3579@item main
3580@item main10
3581@item mainsp
3582@item rext
3583@item scc
3584@end table
3585
3586@item @var{gpb}
35871: GPB (generalized P/B frame)
3588
35890: regular P frame.
3590
3591@item @var{tile_cols}
3592Number of columns for tiled encoding.
3593
3594@item @var{tile_rows}
3595Number of rows for tiled encoding.
3596
3597@item @var{aud}
3598Insert the Access Unit Delimiter NAL.
3599
3600@item @var{pic_timing_sei}
3601Insert picture timing SEI with pic_struct_syntax element.
3602
3603@item @var{transform_skip}
3604Turn this option ON to enable transformskip. It is supported on platform equal
3605or newer than ICL.
3606
3607@item @var{int_ref_type}
3608Specifies intra refresh type. The major goal of intra refresh is improvement of
3609error resilience without significant impact on encoded bitstream size caused by
3610I frames. The SDK encoder achieves this by encoding part of each frame in
3611refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means
3612vertical refresh, by column of MBs. To enable intra refresh, B frame should be
3613set to 0.
3614
3615@item @var{int_ref_cycle_size}
3616Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
3617invalid values.
3618
3619@item @var{int_ref_qp_delta}
3620Specifies QP difference for inserted intra MBs. This is signed value in
3621[-51, 51] range if target encoding bit-depth for luma samples is 8 and this
3622range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
3623
3624@item @var{int_ref_cycle_dist}
3625Distance between the beginnings of the intra-refresh cycles in frames.
3626
3627@item @var{max_qp_i}
3628Maximum video quantizer scale for I frame.
3629
3630@item @var{min_qp_i}
3631Minimum video quantizer scale for I frame.
3632
3633@item @var{max_qp_p}
3634Maximum video quantizer scale for P frame.
3635
3636@item @var{min_qp_p}
3637Minimum video quantizer scale for P frame.
3638
3639@item @var{max_qp_b}
3640Maximum video quantizer scale for B frame.
3641
3642@item @var{min_qp_b}
3643Minimum video quantizer scale for B frame.
3644@end table
3645
3646@subsection MPEG2 Options
3647These options are used by mpeg2_qsv
3648@table @option
3649@item @var{profile}
3650@table @samp
3651@item unknown
3652@item simple
3653@item main
3654@item high
3655@end table
3656@end table
3657
3658@subsection VP9 Options
3659These options are used by vp9_qsv
3660@table @option
3661@item @var{profile}
3662@table @samp
3663@item unknown
3664@item profile0
3665@item profile1
3666@item profile2
3667@item profile3
3668@end table
3669
3670@item @var{tile_cols}
3671Number of columns for tiled encoding (requires libmfx >= 1.29).
3672
3673@item @var{tile_rows}
3674Number of rows for tiled encoding (requires libmfx  >= 1.29).
3675@end table
3676
3677@section snow
3678
3679@subsection Options
3680
3681@table @option
3682@item iterative_dia_size
3683dia size for the iterative motion estimation
3684@end table
3685
3686@section VAAPI encoders
3687
3688Wrappers for hardware encoders accessible via VAAPI.
3689
3690These encoders only accept input in VAAPI hardware surfaces.  If you have input
3691in software frames, use the @option{hwupload} filter to upload them to the GPU.
3692
3693The following standard libavcodec options are used:
3694@itemize
3695@item
3696@option{g} / @option{gop_size}
3697@item
3698@option{bf} / @option{max_b_frames}
3699@item
3700@option{profile}
3701
3702If not set, this will be determined automatically from the format of the input
3703frames and the profiles supported by the driver.
3704@item
3705@option{level}
3706@item
3707@option{b} / @option{bit_rate}
3708@item
3709@option{maxrate} / @option{rc_max_rate}
3710@item
3711@option{bufsize} / @option{rc_buffer_size}
3712@item
3713@option{rc_init_occupancy} / @option{rc_initial_buffer_occupancy}
3714@item
3715@option{compression_level}
3716
3717Speed / quality tradeoff: higher values are faster / worse quality.
3718@item
3719@option{q} / @option{global_quality}
3720
3721Size / quality tradeoff: higher values are smaller / worse quality.
3722@item
3723@option{qmin}
3724@item
3725@option{qmax}
3726@item
3727@option{i_qfactor} / @option{i_quant_factor}
3728@item
3729@option{i_qoffset} / @option{i_quant_offset}
3730@item
3731@option{b_qfactor} / @option{b_quant_factor}
3732@item
3733@option{b_qoffset} / @option{b_quant_offset}
3734@item
3735@option{slices}
3736@end itemize
3737
3738All encoders support the following options:
3739@table @option
3740@item low_power
3741Some drivers/platforms offer a second encoder for some codecs intended to use
3742less power than the default encoder; setting this option will attempt to use
3743that encoder.  Note that it may support a reduced feature set, so some other
3744options may not be available in this mode.
3745
3746@item idr_interval
3747Set the number of normal intra frames between full-refresh (IDR) frames in
3748open-GOP mode.  The intra frames are still IRAPs, but will not include global
3749headers and may have non-decodable leading pictures.
3750
3751@item b_depth
3752Set the B-frame reference depth.  When set to one (the default), all B-frames
3753will refer only to P- or I-frames.  When set to greater values multiple layers
3754of B-frames will be present, frames in each layer only referring to frames in
3755higher layers.
3756
3757@item async_depth
3758Maximum processing parallelism. Increase this to improve single channel
3759performance. This option doesn't work if driver doesn't implement vaSyncBuffer
3760function. Please make sure there are enough hw_frames allocated if a large
3761number of async_depth is used.
3762
3763@item max_frame_size
3764Set the allowed max size in bytes for each frame. If the frame size exceeds
3765the limitation, encoder will adjust the QP value to control the frame size.
3766Invalid in CQP rate control mode.
3767
3768@item rc_mode
3769Set the rate control mode to use.  A given driver may only support a subset of
3770modes.
3771
3772Possible modes:
3773@table @option
3774@item auto
3775Choose the mode automatically based on driver support and the other options.
3776This is the default.
3777@item CQP
3778Constant-quality.
3779@item CBR
3780Constant-bitrate.
3781@item VBR
3782Variable-bitrate.
3783@item ICQ
3784Intelligent constant-quality.
3785@item QVBR
3786Quality-defined variable-bitrate.
3787@item AVBR
3788Average variable bitrate.
3789@end table
3790
3791@end table
3792
3793Each encoder also has its own specific options:
3794@table @option
3795
3796@item h264_vaapi
3797@option{profile} sets the value of @emph{profile_idc} and the @emph{constraint_set*_flag}s.
3798@option{level} sets the value of @emph{level_idc}.
3799
3800@table @option
3801@item coder
3802Set entropy encoder (default is @emph{cabac}).  Possible values:
3803
3804@table @samp
3805@item ac
3806@item cabac
3807Use CABAC.
3808
3809@item vlc
3810@item cavlc
3811Use CAVLC.
3812@end table
3813
3814@item aud
3815Include access unit delimiters in the stream (not included by default).
3816
3817@item sei
3818Set SEI message types to include.
3819Some combination of the following values:
3820@table @samp
3821@item identifier
3822Include a @emph{user_data_unregistered} message containing information about
3823the encoder.
3824@item timing
3825Include picture timing parameters (@emph{buffering_period} and
3826@emph{pic_timing} messages).
3827@item recovery_point
3828Include recovery points where appropriate (@emph{recovery_point} messages).
3829@end table
3830
3831@end table
3832
3833@item hevc_vaapi
3834@option{profile} and @option{level} set the values of
3835@emph{general_profile_idc} and @emph{general_level_idc} respectively.
3836
3837@table @option
3838@item aud
3839Include access unit delimiters in the stream (not included by default).
3840
3841@item tier
3842Set @emph{general_tier_flag}.  This may affect the level chosen for the stream
3843if it is not explicitly specified.
3844
3845@item sei
3846Set SEI message types to include.
3847Some combination of the following values:
3848@table @samp
3849@item hdr
3850Include HDR metadata if the input frames have it
3851(@emph{mastering_display_colour_volume} and @emph{content_light_level}
3852messages).
3853@end table
3854
3855@item tiles
3856Set the number of tiles to encode the input video with, as columns x rows.
3857Larger numbers allow greater parallelism in both encoding and decoding, but
3858may decrease coding efficiency.
3859
3860@end table
3861
3862@item mjpeg_vaapi
3863Only baseline DCT encoding is supported.  The encoder always uses the standard
3864quantisation and huffman tables - @option{global_quality} scales the standard
3865quantisation table (range 1-100).
3866
3867For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported.  RGB is also
3868supported, and will create an RGB JPEG.
3869
3870@table @option
3871@item jfif
3872Include JFIF header in each frame (not included by default).
3873@item huffman
3874Include standard huffman tables (on by default).  Turning this off will save
3875a few hundred bytes in each output frame, but may lose compatibility with some
3876JPEG decoders which don't fully handle MJPEG.
3877@end table
3878
3879@item mpeg2_vaapi
3880@option{profile} and @option{level} set the value of @emph{profile_and_level_indication}.
3881
3882@item vp8_vaapi
3883B-frames are not supported.
3884
3885@option{global_quality} sets the @emph{q_idx} used for non-key frames (range 0-127).
3886
3887@table @option
3888@item loop_filter_level
3889@item loop_filter_sharpness
3890Manually set the loop filter parameters.
3891@end table
3892
3893@item vp9_vaapi
3894@option{global_quality} sets the @emph{q_idx} used for P-frames (range 0-255).
3895
3896@table @option
3897@item loop_filter_level
3898@item loop_filter_sharpness
3899Manually set the loop filter parameters.
3900@end table
3901
3902B-frames are supported, but the output stream is always in encode order rather than display
3903order.  If B-frames are enabled, it may be necessary to use the @option{vp9_raw_reorder}
3904bitstream filter to modify the output stream to display frames in the correct order.
3905
3906Only normal frames are produced - the @option{vp9_superframe} bitstream filter may be
3907required to produce a stream usable with all decoders.
3908
3909@end table
3910
3911@section vbn
3912
3913Vizrt Binary Image encoder.
3914
3915This format is used by the broadcast vendor Vizrt for quick texture streaming.
3916Advanced features of the format such as LZW compression of texture data or
3917generation of mipmaps are not supported.
3918
3919@subsection Options
3920
3921@table @option
3922@item format @var{string}
3923Sets the texture compression used by the VBN file. Can be @var{dxt1},
3924@var{dxt5} or @var{raw}. Default is @var{dxt5}.
3925@end table
3926
3927@section vc2
3928
3929SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
3930professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
39318 (limited range or full range), 10 or 12 bits, this makes it suitable for
3932other tasks which require low overhead and low compression (like screen
3933recording).
3934
3935@subsection Options
3936
3937@table @option
3938
3939@item b
3940Sets target video bitrate. Usually that's around 1:6 of the uncompressed
3941video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
3942values (close to the uncompressed bitrate) turn on lossless compression mode.
3943
3944@item field_order
3945Enables field coding when set (e.g. to tt - top field first) for interlaced
3946inputs. Should increase compression with interlaced content as it splits the
3947fields and encodes each separately.
3948
3949@item wavelet_depth
3950Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
3951Lower values reduce compression and quality. Less capable decoders may not be
3952able to handle values of @option{wavelet_depth} over 3.
3953
3954@item wavelet_type
3955Sets the transform type. Currently only @var{5_3} (LeGall) and @var{9_7}
3956(Deslauriers-Dubuc)
3957are implemented, with 9_7 being the one with better compression and thus
3958is the default.
3959
3960@item slice_width
3961@item slice_height
3962Sets the slice size for each slice. Larger values result in better compression.
3963For compatibility with other more limited decoders use @option{slice_width} of
396432 and @option{slice_height} of 8.
3965
3966@item tolerance
3967Sets the undershoot tolerance of the rate control system in percent. This is
3968to prevent an expensive search from being run.
3969
3970@item qm
3971Sets the quantization matrix preset to use by default or when @option{wavelet_depth}
3972is set to 5
3973@itemize @minus
3974@item
3975@var{default}
3976Uses the default quantization matrix from the specifications, extended with
3977values for the fifth level. This provides a good balance between keeping detail
3978and omitting artifacts.
3979
3980@item
3981@var{flat}
3982Use a completely zeroed out quantization matrix. This increases PSNR but might
3983reduce perception. Use in bogus benchmarks.
3984
3985@item
3986@var{color}
3987Reduces detail but attempts to preserve color at extremely low bitrates.
3988@end itemize
3989
3990@end table
3991
3992@c man end VIDEO ENCODERS
3993
3994@chapter Subtitles Encoders
3995@c man begin SUBTITLES ENCODERS
3996
3997@section dvdsub
3998
3999This codec encodes the bitmap subtitle format that is used in DVDs.
4000Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
4001and they can also be used in Matroska files.
4002
4003@subsection Options
4004
4005@table @option
4006@item palette
4007Specify the global palette used by the bitmaps.
4008
4009The format for this option is a string containing 16 24-bits hexadecimal
4010numbers (without 0x prefix) separated by commas, for example @code{0d00ee,
4011ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
40127b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
4013
4014@item even_rows_fix
4015When set to 1, enable a work-around that makes the number of pixel rows
4016even in all subtitles.  This fixes a problem with some players that
4017cut off the bottom row if the number is odd.  The work-around just adds
4018a fully transparent row if needed.  The overhead is low, typically
4019one byte per subtitle on average.
4020
4021By default, this work-around is disabled.
4022@end table
4023
4024@c man end SUBTITLES ENCODERS
4025