3 @c man begin CODEC OPTIONS
5 libavcodec provides some generic global options, which can be set on
6 all the encoders and decoders. In addition each codec may support
7 so-called private options, which are specific for a given codec.
9 Sometimes, a global option may only affect a specific kind of codec,
10 and may be nonsensical or ignored by another, so you need to be aware
11 of the meaning of the specified options. Also some options are
12 meant only for decoding or encoding.
14 Options may be set by specifying -@var{option} @var{value} in the
15 FFmpeg tools, or by setting the value explicitly in the
16 @code{AVCodecContext} options or using the @file{libavutil/opt.h} API
19 The list of supported options follow:
22 @item b @var{integer} (@emph{encoding,audio,video})
23 Set bitrate in bits/s. Default value is 200K.
25 @item ab @var{integer} (@emph{encoding,audio})
26 Set audio bitrate (in bits/s). Default value is 128K.
28 @item bt @var{integer} (@emph{encoding,video})
29 Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
30 tolerance specifies how far ratecontrol is willing to deviate from the
31 target average bitrate value. This is not related to min/max
32 bitrate. Lowering tolerance too much has an adverse effect on quality.
34 @item flags @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
40 Use four motion vector by macroblock (mpeg4).
42 Use 1/4 pel motion compensation.
50 Always try a mb with mv=<0,0>.
54 Use internal 2pass ratecontrol in first pass mode.
56 Use internal 2pass ratecontrol in second pass mode.
58 Only decode/encode grayscale.
62 Set error[?] variables during encoding.
66 Normalize adaptive quantization.
72 Place global headers in extradata instead of every keyframe.
74 Only write platform-, build- and time-independent data. (except (I)DCT).
75 This ensures that file and data checksums are reproducible and match between
76 platforms. Its primary use is for regression testing.
78 Apply H263 advanced intra coding / mpeg4 ac prediction.
80 Deprecated, use mpegvideo private options instead.
82 Deprecated, use mpegvideo private options instead.
84 Apply interlaced motion estimation.
89 @item me_method @var{integer} (@emph{encoding,video})
90 Set motion estimation method.
95 zero motion estimation (fastest)
97 full motion estimation (slowest)
99 EPZS motion estimation (default)
101 esa motion estimation (alias for full)
103 tesa motion estimation
105 dia motion estimation (alias for epzs)
107 log motion estimation
109 phods motion estimation
113 hex motion estimation
115 umh motion estimation
117 iter motion estimation
120 @item extradata_size @var{integer}
123 @item time_base @var{rational number}
126 It is the fundamental unit of time (in seconds) in terms of which
127 frame timestamps are represented. For fixed-fps content, timebase
128 should be @code{1 / frame_rate} and timestamp increments should be
131 @item g @var{integer} (@emph{encoding,video})
132 Set the group of picture size. Default value is 12.
134 @item ar @var{integer} (@emph{decoding/encoding,audio})
135 Set audio sampling rate (in Hz).
137 @item ac @var{integer} (@emph{decoding/encoding,audio})
138 Set number of audio channels.
140 @item cutoff @var{integer} (@emph{encoding,audio})
141 Set cutoff bandwidth.
143 @item frame_size @var{integer} (@emph{encoding,audio})
144 Set audio frame size.
146 Each submitted frame except the last must contain exactly frame_size
147 samples per channel. May be 0 when the codec has
148 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
149 restricted. It is set by some decoders to indicate constant frame
152 @item frame_number @var{integer}
153 Set the frame number.
155 @item delay @var{integer}
157 @item qcomp @var{float} (@emph{encoding,video})
158 Set video quantizer scale compression (VBR). It is used as a constant
159 in the ratecontrol equation. Recommended range for default rc_eq:
162 @item qblur @var{float} (@emph{encoding,video})
163 Set video quantizer scale blur (VBR).
165 @item qmin @var{integer} (@emph{encoding,video})
166 Set min video quantizer scale (VBR). Must be included between -1 and
167 69, default value is 2.
169 @item qmax @var{integer} (@emph{encoding,video})
170 Set max video quantizer scale (VBR). Must be included between -1 and
171 1024, default value is 31.
173 @item qdiff @var{integer} (@emph{encoding,video})
174 Set max difference between the quantizer scale (VBR).
176 @item bf @var{integer} (@emph{encoding,video})
177 Set max number of B frames between non-B-frames.
179 Must be an integer between -1 and 16. 0 means that B-frames are
180 disabled. If a value of -1 is used, it will choose an automatic value
181 depending on the encoder.
185 @item b_qfactor @var{float} (@emph{encoding,video})
186 Set qp factor between P and B frames.
188 @item rc_strategy @var{integer} (@emph{encoding,video})
189 Set ratecontrol method.
191 @item b_strategy @var{integer} (@emph{encoding,video})
192 Set strategy to choose between I/P/B-frames.
194 @item ps @var{integer} (@emph{encoding,video})
195 Set RTP payload size in bytes.
197 @item mv_bits @var{integer}
198 @item header_bits @var{integer}
199 @item i_tex_bits @var{integer}
200 @item p_tex_bits @var{integer}
201 @item i_count @var{integer}
202 @item p_count @var{integer}
203 @item skip_count @var{integer}
204 @item misc_bits @var{integer}
205 @item frame_bits @var{integer}
206 @item codec_tag @var{integer}
207 @item bug @var{flags} (@emph{decoding,video})
208 Workaround not auto detected encoder bugs.
215 some old lavc generated msmpeg4v3 files (no autodetection)
217 Xvid interlacing bug (autodetected if fourcc==XVIX)
219 (autodetected if fourcc==UMP4)
221 padding bug (autodetected)
225 illegal vlc bug (autodetected per fourcc)
229 old standard qpel (autodetected per fourcc/version)
232 @item direct_blocksize
233 direct-qpel-blocksize bug (autodetected per fourcc/version)
235 edge padding bug (autodetected per fourcc/version)
241 Workaround various bugs in microsoft broken decoders.
246 @item lelim @var{integer} (@emph{encoding,video})
247 Set single coefficient elimination threshold for luminance (negative
248 values also consider DC coefficient).
250 @item celim @var{integer} (@emph{encoding,video})
251 Set single coefficient elimination threshold for chrominance (negative
252 values also consider dc coefficient)
254 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
255 Specify how strictly to follow the standards.
260 strictly conform to a older more strict version of the spec or reference software
262 strictly conform to all the things in the spec no matter what consequences
266 allow unofficial extensions
268 allow non standardized experimental things, experimental
269 (unfinished/work in progress/not well tested) decoders and encoders.
270 Note: experimental decoders can pose a security risk, do not use this for
271 decoding untrusted input.
274 @item b_qoffset @var{float} (@emph{encoding,video})
275 Set QP offset between P and B frames.
277 @item err_detect @var{flags} (@emph{decoding,audio,video})
278 Set error detection flags.
285 detect bitstream specification deviations
287 detect improper bitstream length
289 abort decoding on minor error detection
291 ignore decoding errors, and continue decoding.
292 This is useful if you want to analyze the content of a video and thus want
293 everything to be decoded no matter what. This option will not result in a video
294 that is pleasing to watch in case of errors.
296 consider things that violate the spec and have not been seen in the wild as errors
298 consider all spec non compliancies as errors
300 consider things that a sane encoder should not do as an error
303 @item has_b_frames @var{integer}
305 @item block_align @var{integer}
307 @item mpeg_quant @var{integer} (@emph{encoding,video})
308 Use MPEG quantizers instead of H.263.
310 @item qsquish @var{float} (@emph{encoding,video})
311 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
312 differentiable function).
314 @item rc_qmod_amp @var{float} (@emph{encoding,video})
315 Set experimental quantizer modulation.
317 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
318 Set experimental quantizer modulation.
320 @item rc_override_count @var{integer}
322 @item rc_eq @var{string} (@emph{encoding,video})
323 Set rate control equation. When computing the expression, besides the
324 standard functions defined in the section 'Expression Evaluation', the
325 following functions are available: bits2qp(bits), qp2bits(qp). Also
326 the following constants are available: iTex pTex tex mv fCode iCount
327 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
330 @item maxrate @var{integer} (@emph{encoding,audio,video})
331 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
333 @item minrate @var{integer} (@emph{encoding,audio,video})
334 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
335 encode. It is of little use elsewise.
337 @item bufsize @var{integer} (@emph{encoding,audio,video})
338 Set ratecontrol buffer size (in bits).
340 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
343 @item i_qfactor @var{float} (@emph{encoding,video})
344 Set QP factor between P and I frames.
346 @item i_qoffset @var{float} (@emph{encoding,video})
347 Set QP offset between P and I frames.
349 @item rc_init_cplx @var{float} (@emph{encoding,video})
350 Set initial complexity for 1-pass encoding.
352 @item dct @var{integer} (@emph{encoding,video})
358 autoselect a good one (default)
368 floating point AAN DCT
371 @item lumi_mask @var{float} (@emph{encoding,video})
372 Compress bright areas stronger than medium ones.
374 @item tcplx_mask @var{float} (@emph{encoding,video})
375 Set temporal complexity masking.
377 @item scplx_mask @var{float} (@emph{encoding,video})
378 Set spatial complexity masking.
380 @item p_mask @var{float} (@emph{encoding,video})
383 @item dark_mask @var{float} (@emph{encoding,video})
384 Compress dark areas stronger than medium ones.
386 @item idct @var{integer} (@emph{decoding/encoding,video})
387 Select IDCT implementation.
400 Automatically pick a IDCT compatible with the simple one
423 floating point AAN IDCT
426 @item slice_count @var{integer}
428 @item ec @var{flags} (@emph{decoding,video})
429 Set error concealment strategy.
434 iterative motion vector (MV) search (slow)
436 use strong deblock filter for damaged MBs
438 favor predicting from the previous frame instead of the current
441 @item bits_per_coded_sample @var{integer}
443 @item pred @var{integer} (@emph{encoding,video})
444 Set prediction method.
456 @item aspect @var{rational number} (@emph{encoding,video})
457 Set sample aspect ratio.
459 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
460 Print specific debug info.
473 per-block quantization parameter (QP)
487 memory management control operations (H.264)
491 visualize quantization parameter (QP), lower QP are tinted greener
493 visualize block types
495 picture buffer allocations
499 skip motion compensation
502 @item vismv @var{integer} (@emph{decoding,video})
503 Visualize motion vectors (MVs).
505 This option is deprecated, see the codecview filter instead.
510 forward predicted MVs of P-frames
512 forward predicted MVs of B-frames
514 backward predicted MVs of B-frames
517 @item cmp @var{integer} (@emph{encoding,video})
518 Set full pel me compare function.
523 sum of absolute differences, fast (default)
525 sum of squared errors
527 sum of absolute Hadamard transformed differences
529 sum of absolute DCT transformed differences
531 sum of squared quantization errors (avoid, low quality)
533 number of bits needed for the block
535 rate distortion optimal, slow
539 sum of absolute vertical differences
541 sum of squared vertical differences
543 noise preserving sum of squared differences
545 5/3 wavelet, only used in snow
547 9/7 wavelet, only used in snow
554 @item subcmp @var{integer} (@emph{encoding,video})
555 Set sub pel me compare function.
560 sum of absolute differences, fast (default)
562 sum of squared errors
564 sum of absolute Hadamard transformed differences
566 sum of absolute DCT transformed differences
568 sum of squared quantization errors (avoid, low quality)
570 number of bits needed for the block
572 rate distortion optimal, slow
576 sum of absolute vertical differences
578 sum of squared vertical differences
580 noise preserving sum of squared differences
582 5/3 wavelet, only used in snow
584 9/7 wavelet, only used in snow
591 @item mbcmp @var{integer} (@emph{encoding,video})
592 Set macroblock compare function.
597 sum of absolute differences, fast (default)
599 sum of squared errors
601 sum of absolute Hadamard transformed differences
603 sum of absolute DCT transformed differences
605 sum of squared quantization errors (avoid, low quality)
607 number of bits needed for the block
609 rate distortion optimal, slow
613 sum of absolute vertical differences
615 sum of squared vertical differences
617 noise preserving sum of squared differences
619 5/3 wavelet, only used in snow
621 9/7 wavelet, only used in snow
628 @item ildctcmp @var{integer} (@emph{encoding,video})
629 Set interlaced dct compare function.
634 sum of absolute differences, fast (default)
636 sum of squared errors
638 sum of absolute Hadamard transformed differences
640 sum of absolute DCT transformed differences
642 sum of squared quantization errors (avoid, low quality)
644 number of bits needed for the block
646 rate distortion optimal, slow
650 sum of absolute vertical differences
652 sum of squared vertical differences
654 noise preserving sum of squared differences
656 5/3 wavelet, only used in snow
658 9/7 wavelet, only used in snow
665 @item dia_size @var{integer} (@emph{encoding,video})
666 Set diamond type & size for motion estimation.
668 @item last_pred @var{integer} (@emph{encoding,video})
669 Set amount of motion predictors from the previous frame.
671 @item preme @var{integer} (@emph{encoding,video})
672 Set pre motion estimation.
674 @item precmp @var{integer} (@emph{encoding,video})
675 Set pre motion estimation compare function.
680 sum of absolute differences, fast (default)
682 sum of squared errors
684 sum of absolute Hadamard transformed differences
686 sum of absolute DCT transformed differences
688 sum of squared quantization errors (avoid, low quality)
690 number of bits needed for the block
692 rate distortion optimal, slow
696 sum of absolute vertical differences
698 sum of squared vertical differences
700 noise preserving sum of squared differences
702 5/3 wavelet, only used in snow
704 9/7 wavelet, only used in snow
711 @item pre_dia_size @var{integer} (@emph{encoding,video})
712 Set diamond type & size for motion estimation pre-pass.
714 @item subq @var{integer} (@emph{encoding,video})
715 Set sub pel motion estimation quality.
717 @item dtg_active_format @var{integer}
719 @item me_range @var{integer} (@emph{encoding,video})
720 Set limit motion vectors range (1023 for DivX player).
722 @item ibias @var{integer} (@emph{encoding,video})
723 Set intra quant bias.
725 @item pbias @var{integer} (@emph{encoding,video})
726 Set inter quant bias.
728 @item color_table_id @var{integer}
730 @item global_quality @var{integer} (@emph{encoding,audio,video})
732 @item coder @var{integer} (@emph{encoding,video})
737 variable length coder / huffman coder
748 @item context @var{integer} (@emph{encoding,video})
751 @item slice_flags @var{integer}
753 @item xvmc_acceleration @var{integer}
755 @item mbd @var{integer} (@emph{encoding,video})
756 Set macroblock decision algorithm (high quality mode).
765 use best rate distortion
768 @item stream_codec_tag @var{integer}
770 @item sc_threshold @var{integer} (@emph{encoding,video})
771 Set scene change threshold.
773 @item lmin @var{integer} (@emph{encoding,video})
774 Set min lagrange factor (VBR).
776 @item lmax @var{integer} (@emph{encoding,video})
777 Set max lagrange factor (VBR).
779 @item nr @var{integer} (@emph{encoding,video})
782 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
783 Set number of bits which should be loaded into the rc buffer before
786 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
791 Allow non spec compliant speedup tricks.
793 Deprecated, use mpegvideo private options instead.
795 Skip bitstream encoding.
797 Ignore cropping information from sps.
799 Place global headers at every keyframe instead of in extradata.
801 Frame data might be split into multiple chunks.
803 Show all frames before the first keyframe.
805 Deprecated, use mpegvideo private options instead.
807 Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS})
808 for codecs that support it. See also @file{doc/examples/export_mvs.c}.
811 @item error @var{integer} (@emph{encoding,video})
813 @item qns @var{integer} (@emph{encoding,video})
814 Deprecated, use mpegvideo private options instead.
816 @item threads @var{integer} (@emph{decoding/encoding,video})
821 detect a good number of threads
824 @item me_threshold @var{integer} (@emph{encoding,video})
825 Set motion estimation threshold.
827 @item mb_threshold @var{integer} (@emph{encoding,video})
828 Set macroblock threshold.
830 @item dc @var{integer} (@emph{encoding,video})
831 Set intra_dc_precision.
833 @item nssew @var{integer} (@emph{encoding,video})
836 @item skip_top @var{integer} (@emph{decoding,video})
837 Set number of macroblock rows at the top which are skipped.
839 @item skip_bottom @var{integer} (@emph{decoding,video})
840 Set number of macroblock rows at the bottom which are skipped.
842 @item profile @var{integer} (@emph{encoding,audio,video})
888 @item level @var{integer} (@emph{encoding,audio,video})
896 @item lowres @var{integer} (@emph{decoding,audio,video})
897 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
899 @item skip_threshold @var{integer} (@emph{encoding,video})
900 Set frame skip threshold.
902 @item skip_factor @var{integer} (@emph{encoding,video})
903 Set frame skip factor.
905 @item skip_exp @var{integer} (@emph{encoding,video})
906 Set frame skip exponent.
907 Negative values behave identical to the corresponding positive ones, except
908 that the score is normalized.
909 Positive values exist primarily for compatibility reasons and are not so useful.
911 @item skipcmp @var{integer} (@emph{encoding,video})
912 Set frame skip compare function.
917 sum of absolute differences, fast (default)
919 sum of squared errors
921 sum of absolute Hadamard transformed differences
923 sum of absolute DCT transformed differences
925 sum of squared quantization errors (avoid, low quality)
927 number of bits needed for the block
929 rate distortion optimal, slow
933 sum of absolute vertical differences
935 sum of squared vertical differences
937 noise preserving sum of squared differences
939 5/3 wavelet, only used in snow
941 9/7 wavelet, only used in snow
948 @item border_mask @var{float} (@emph{encoding,video})
949 Increase the quantizer for macroblocks close to borders.
951 @item mblmin @var{integer} (@emph{encoding,video})
952 Set min macroblock lagrange factor (VBR).
954 @item mblmax @var{integer} (@emph{encoding,video})
955 Set max macroblock lagrange factor (VBR).
957 @item mepc @var{integer} (@emph{encoding,video})
958 Set motion estimation bitrate penalty compensation (1.0 = 256).
960 @item skip_loop_filter @var{integer} (@emph{decoding,video})
961 @item skip_idct @var{integer} (@emph{decoding,video})
962 @item skip_frame @var{integer} (@emph{decoding,video})
964 Make decoder discard processing depending on the frame type selected
967 @option{skip_loop_filter} skips frame loop filtering, @option{skip_idct}
968 skips frame IDCT/dequantization, @option{skip_frame} skips decoding.
976 Discard useless frames like 0-sized frames.
979 Discard all non-reference frames.
982 Discard all bidirectional frames.
985 Discard all frames excepts keyframes.
991 Default value is @samp{default}.
993 @item bidir_refine @var{integer} (@emph{encoding,video})
994 Refine the two motion vectors used in bidirectional macroblocks.
996 @item brd_scale @var{integer} (@emph{encoding,video})
997 Downscale frames for dynamic B-frame decision.
999 @item keyint_min @var{integer} (@emph{encoding,video})
1000 Set minimum interval between IDR-frames.
1002 @item refs @var{integer} (@emph{encoding,video})
1003 Set reference frames to consider for motion compensation.
1005 @item chromaoffset @var{integer} (@emph{encoding,video})
1006 Set chroma qp offset from luma.
1008 @item trellis @var{integer} (@emph{encoding,audio,video})
1009 Set rate-distortion optimal quantization.
1011 @item sc_factor @var{integer} (@emph{encoding,video})
1012 Set value multiplied by qscale for each frame and added to
1015 @item mv0_threshold @var{integer} (@emph{encoding,video})
1016 @item b_sensitivity @var{integer} (@emph{encoding,video})
1017 Adjust sensitivity of b_frame_strategy 1.
1019 @item compression_level @var{integer} (@emph{encoding,audio,video})
1020 @item min_prediction_order @var{integer} (@emph{encoding,audio})
1021 @item max_prediction_order @var{integer} (@emph{encoding,audio})
1022 @item timecode_frame_start @var{integer} (@emph{encoding,video})
1023 Set GOP timecode frame start number, in non drop frame format.
1025 @item request_channels @var{integer} (@emph{decoding,audio})
1026 Set desired number of audio channels.
1028 @item bits_per_raw_sample @var{integer}
1029 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1034 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1039 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1040 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1041 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1042 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1043 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1044 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1045 @item color_range @var{integer} (@emph{decoding/encoding,video})
1046 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1048 @item log_level_offset @var{integer}
1049 Set the log level offset.
1051 @item slices @var{integer} (@emph{encoding,video})
1052 Number of slices, used in parallelized encoding.
1054 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1055 Select which multithreading methods to use.
1057 Use of @samp{frame} will increase decoding delay by one frame per
1058 thread, so clients which cannot provide future frames should not use
1064 Decode more than one part of a single frame at once.
1066 Multithreading using slices works only when the video was encoded with
1070 Decode more than one frame at once.
1073 Default value is @samp{slice+frame}.
1075 @item audio_service_type @var{integer} (@emph{encoding,audio})
1076 Set audio service type.
1100 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1101 Set sample format audio decoders should prefer. Default value is
1104 @item pkt_timebase @var{rational number}
1106 @item sub_charenc @var{encoding} (@emph{decoding,subtitles})
1107 Set the input subtitles character encoding.
1109 @item field_order @var{field_order} (@emph{video})
1110 Set/override the field order of the video.
1116 Interlaced video, top field coded and displayed first
1118 Interlaced video, bottom field coded and displayed first
1120 Interlaced video, top coded first, bottom displayed first
1122 Interlaced video, bottom coded first, top displayed first
1125 @item skip_alpha @var{integer} (@emph{decoding,video})
1126 Set to 1 to disable processing alpha (transparency). This works like the
1127 @samp{gray} flag in the @option{flags} option which skips chroma information
1128 instead of alpha. Default is 0.
1130 @item codec_whitelist @var{list} (@emph{input})
1131 "," separated List of allowed decoders. By default all are allowed.
1133 @item dump_separator @var{string} (@emph{input})
1134 Separator used to separate the fields printed on the command line about the
1136 For example to separate the fields with newlines and indention:
1138 ffprobe -dump_separator "
1139 " -i ~/videos/matrixbench_mpeg2.mpg
1144 @c man end CODEC OPTIONS
1146 @ifclear config-writeonly
1147 @include decoders.texi
1149 @ifclear config-readonly
1150 @include encoders.texi