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 (GOP) 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. (Supported only by selected encoders, see
142 their respective documentation sections.)
144 @item frame_size @var{integer} (@emph{encoding,audio})
145 Set audio frame size.
147 Each submitted frame except the last must contain exactly frame_size
148 samples per channel. May be 0 when the codec has
149 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
150 restricted. It is set by some decoders to indicate constant frame
153 @item frame_number @var{integer}
154 Set the frame number.
156 @item delay @var{integer}
158 @item qcomp @var{float} (@emph{encoding,video})
159 Set video quantizer scale compression (VBR). It is used as a constant
160 in the ratecontrol equation. Recommended range for default rc_eq:
163 @item qblur @var{float} (@emph{encoding,video})
164 Set video quantizer scale blur (VBR).
166 @item qmin @var{integer} (@emph{encoding,video})
167 Set min video quantizer scale (VBR). Must be included between -1 and
168 69, default value is 2.
170 @item qmax @var{integer} (@emph{encoding,video})
171 Set max video quantizer scale (VBR). Must be included between -1 and
172 1024, default value is 31.
174 @item qdiff @var{integer} (@emph{encoding,video})
175 Set max difference between the quantizer scale (VBR).
177 @item bf @var{integer} (@emph{encoding,video})
178 Set max number of B frames between non-B-frames.
180 Must be an integer between -1 and 16. 0 means that B-frames are
181 disabled. If a value of -1 is used, it will choose an automatic value
182 depending on the encoder.
186 @item b_qfactor @var{float} (@emph{encoding,video})
187 Set qp factor between P and B frames.
189 @item rc_strategy @var{integer} (@emph{encoding,video})
190 Set ratecontrol method.
192 @item b_strategy @var{integer} (@emph{encoding,video})
193 Set strategy to choose between I/P/B-frames.
195 @item ps @var{integer} (@emph{encoding,video})
196 Set RTP payload size in bytes.
198 @item mv_bits @var{integer}
199 @item header_bits @var{integer}
200 @item i_tex_bits @var{integer}
201 @item p_tex_bits @var{integer}
202 @item i_count @var{integer}
203 @item p_count @var{integer}
204 @item skip_count @var{integer}
205 @item misc_bits @var{integer}
206 @item frame_bits @var{integer}
207 @item codec_tag @var{integer}
208 @item bug @var{flags} (@emph{decoding,video})
209 Workaround not auto detected encoder bugs.
216 some old lavc generated msmpeg4v3 files (no autodetection)
218 Xvid interlacing bug (autodetected if fourcc==XVIX)
220 (autodetected if fourcc==UMP4)
222 padding bug (autodetected)
226 illegal vlc bug (autodetected per fourcc)
230 old standard qpel (autodetected per fourcc/version)
233 @item direct_blocksize
234 direct-qpel-blocksize bug (autodetected per fourcc/version)
236 edge padding bug (autodetected per fourcc/version)
242 Workaround various bugs in microsoft broken decoders.
247 @item lelim @var{integer} (@emph{encoding,video})
248 Set single coefficient elimination threshold for luminance (negative
249 values also consider DC coefficient).
251 @item celim @var{integer} (@emph{encoding,video})
252 Set single coefficient elimination threshold for chrominance (negative
253 values also consider dc coefficient)
255 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
256 Specify how strictly to follow the standards.
261 strictly conform to an older more strict version of the spec or reference software
263 strictly conform to all the things in the spec no matter what consequences
267 allow unofficial extensions
269 allow non standardized experimental things, experimental
270 (unfinished/work in progress/not well tested) decoders and encoders.
271 Note: experimental decoders can pose a security risk, do not use this for
272 decoding untrusted input.
275 @item b_qoffset @var{float} (@emph{encoding,video})
276 Set QP offset between P and B frames.
278 @item err_detect @var{flags} (@emph{decoding,audio,video})
279 Set error detection flags.
286 detect bitstream specification deviations
288 detect improper bitstream length
290 abort decoding on minor error detection
292 ignore decoding errors, and continue decoding.
293 This is useful if you want to analyze the content of a video and thus want
294 everything to be decoded no matter what. This option will not result in a video
295 that is pleasing to watch in case of errors.
297 consider things that violate the spec and have not been seen in the wild as errors
299 consider all spec non compliancies as errors
301 consider things that a sane encoder should not do as an error
304 @item has_b_frames @var{integer}
306 @item block_align @var{integer}
308 @item mpeg_quant @var{integer} (@emph{encoding,video})
309 Use MPEG quantizers instead of H.263.
311 @item qsquish @var{float} (@emph{encoding,video})
312 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
313 differentiable function).
315 @item rc_qmod_amp @var{float} (@emph{encoding,video})
316 Set experimental quantizer modulation.
318 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
319 Set experimental quantizer modulation.
321 @item rc_override_count @var{integer}
323 @item rc_eq @var{string} (@emph{encoding,video})
324 Set rate control equation. When computing the expression, besides the
325 standard functions defined in the section 'Expression Evaluation', the
326 following functions are available: bits2qp(bits), qp2bits(qp). Also
327 the following constants are available: iTex pTex tex mv fCode iCount
328 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
331 @item maxrate @var{integer} (@emph{encoding,audio,video})
332 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
334 @item minrate @var{integer} (@emph{encoding,audio,video})
335 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
336 encode. It is of little use elsewise.
338 @item bufsize @var{integer} (@emph{encoding,audio,video})
339 Set ratecontrol buffer size (in bits).
341 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
344 @item i_qfactor @var{float} (@emph{encoding,video})
345 Set QP factor between P and I frames.
347 @item i_qoffset @var{float} (@emph{encoding,video})
348 Set QP offset between P and I frames.
350 @item rc_init_cplx @var{float} (@emph{encoding,video})
351 Set initial complexity for 1-pass encoding.
353 @item dct @var{integer} (@emph{encoding,video})
359 autoselect a good one (default)
369 floating point AAN DCT
372 @item lumi_mask @var{float} (@emph{encoding,video})
373 Compress bright areas stronger than medium ones.
375 @item tcplx_mask @var{float} (@emph{encoding,video})
376 Set temporal complexity masking.
378 @item scplx_mask @var{float} (@emph{encoding,video})
379 Set spatial complexity masking.
381 @item p_mask @var{float} (@emph{encoding,video})
384 @item dark_mask @var{float} (@emph{encoding,video})
385 Compress dark areas stronger than medium ones.
387 @item idct @var{integer} (@emph{decoding/encoding,video})
388 Select IDCT implementation.
401 Automatically pick a IDCT compatible with the simple one
424 floating point AAN IDCT
427 @item slice_count @var{integer}
429 @item ec @var{flags} (@emph{decoding,video})
430 Set error concealment strategy.
435 iterative motion vector (MV) search (slow)
437 use strong deblock filter for damaged MBs
439 favor predicting from the previous frame instead of the current
442 @item bits_per_coded_sample @var{integer}
444 @item pred @var{integer} (@emph{encoding,video})
445 Set prediction method.
457 @item aspect @var{rational number} (@emph{encoding,video})
458 Set sample aspect ratio.
460 @item sar @var{rational number} (@emph{encoding,video})
461 Set sample aspect ratio. Alias to @var{aspect}.
463 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
464 Print specific debug info.
477 per-block quantization parameter (QP)
483 display complexity metadata for the upcoming frame, GoP or for a given duration.
494 memory management control operations (H.264)
498 visualize quantization parameter (QP), lower QP are tinted greener
500 visualize block types
502 picture buffer allocations
506 skip motion compensation
509 @item vismv @var{integer} (@emph{decoding,video})
510 Visualize motion vectors (MVs).
512 This option is deprecated, see the codecview filter instead.
517 forward predicted MVs of P-frames
519 forward predicted MVs of B-frames
521 backward predicted MVs of B-frames
524 @item cmp @var{integer} (@emph{encoding,video})
525 Set full pel me compare function.
530 sum of absolute differences, fast (default)
532 sum of squared errors
534 sum of absolute Hadamard transformed differences
536 sum of absolute DCT transformed differences
538 sum of squared quantization errors (avoid, low quality)
540 number of bits needed for the block
542 rate distortion optimal, slow
546 sum of absolute vertical differences
548 sum of squared vertical differences
550 noise preserving sum of squared differences
552 5/3 wavelet, only used in snow
554 9/7 wavelet, only used in snow
561 @item subcmp @var{integer} (@emph{encoding,video})
562 Set sub pel me compare function.
567 sum of absolute differences, fast (default)
569 sum of squared errors
571 sum of absolute Hadamard transformed differences
573 sum of absolute DCT transformed differences
575 sum of squared quantization errors (avoid, low quality)
577 number of bits needed for the block
579 rate distortion optimal, slow
583 sum of absolute vertical differences
585 sum of squared vertical differences
587 noise preserving sum of squared differences
589 5/3 wavelet, only used in snow
591 9/7 wavelet, only used in snow
598 @item mbcmp @var{integer} (@emph{encoding,video})
599 Set macroblock compare function.
604 sum of absolute differences, fast (default)
606 sum of squared errors
608 sum of absolute Hadamard transformed differences
610 sum of absolute DCT transformed differences
612 sum of squared quantization errors (avoid, low quality)
614 number of bits needed for the block
616 rate distortion optimal, slow
620 sum of absolute vertical differences
622 sum of squared vertical differences
624 noise preserving sum of squared differences
626 5/3 wavelet, only used in snow
628 9/7 wavelet, only used in snow
635 @item ildctcmp @var{integer} (@emph{encoding,video})
636 Set interlaced dct compare function.
641 sum of absolute differences, fast (default)
643 sum of squared errors
645 sum of absolute Hadamard transformed differences
647 sum of absolute DCT transformed differences
649 sum of squared quantization errors (avoid, low quality)
651 number of bits needed for the block
653 rate distortion optimal, slow
657 sum of absolute vertical differences
659 sum of squared vertical differences
661 noise preserving sum of squared differences
663 5/3 wavelet, only used in snow
665 9/7 wavelet, only used in snow
672 @item dia_size @var{integer} (@emph{encoding,video})
673 Set diamond type & size for motion estimation.
675 @item last_pred @var{integer} (@emph{encoding,video})
676 Set amount of motion predictors from the previous frame.
678 @item preme @var{integer} (@emph{encoding,video})
679 Set pre motion estimation.
681 @item precmp @var{integer} (@emph{encoding,video})
682 Set pre motion estimation compare function.
687 sum of absolute differences, fast (default)
689 sum of squared errors
691 sum of absolute Hadamard transformed differences
693 sum of absolute DCT transformed differences
695 sum of squared quantization errors (avoid, low quality)
697 number of bits needed for the block
699 rate distortion optimal, slow
703 sum of absolute vertical differences
705 sum of squared vertical differences
707 noise preserving sum of squared differences
709 5/3 wavelet, only used in snow
711 9/7 wavelet, only used in snow
718 @item pre_dia_size @var{integer} (@emph{encoding,video})
719 Set diamond type & size for motion estimation pre-pass.
721 @item subq @var{integer} (@emph{encoding,video})
722 Set sub pel motion estimation quality.
724 @item dtg_active_format @var{integer}
726 @item me_range @var{integer} (@emph{encoding,video})
727 Set limit motion vectors range (1023 for DivX player).
729 @item ibias @var{integer} (@emph{encoding,video})
730 Set intra quant bias.
732 @item pbias @var{integer} (@emph{encoding,video})
733 Set inter quant bias.
735 @item color_table_id @var{integer}
737 @item global_quality @var{integer} (@emph{encoding,audio,video})
739 @item coder @var{integer} (@emph{encoding,video})
744 variable length coder / huffman coder
755 @item context @var{integer} (@emph{encoding,video})
758 @item slice_flags @var{integer}
760 @item xvmc_acceleration @var{integer}
762 @item mbd @var{integer} (@emph{encoding,video})
763 Set macroblock decision algorithm (high quality mode).
772 use best rate distortion
775 @item stream_codec_tag @var{integer}
777 @item sc_threshold @var{integer} (@emph{encoding,video})
778 Set scene change threshold.
780 @item lmin @var{integer} (@emph{encoding,video})
781 Set min lagrange factor (VBR).
783 @item lmax @var{integer} (@emph{encoding,video})
784 Set max lagrange factor (VBR).
786 @item nr @var{integer} (@emph{encoding,video})
789 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
790 Set number of bits which should be loaded into the rc buffer before
793 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
798 Allow non spec compliant speedup tricks.
800 Deprecated, use mpegvideo private options instead.
802 Skip bitstream encoding.
804 Ignore cropping information from sps.
806 Place global headers at every keyframe instead of in extradata.
808 Frame data might be split into multiple chunks.
810 Show all frames before the first keyframe.
812 Deprecated, use mpegvideo private options instead.
814 Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS})
815 for codecs that support it. See also @file{doc/examples/export_mvs.c}.
818 @item error @var{integer} (@emph{encoding,video})
820 @item qns @var{integer} (@emph{encoding,video})
821 Deprecated, use mpegvideo private options instead.
823 @item threads @var{integer} (@emph{decoding/encoding,video})
824 Set the number of threads to be used, in case the selected codec
825 implementation supports multi-threading.
830 automatically select the number of threads to set
833 Default value is @samp{auto}.
835 @item me_threshold @var{integer} (@emph{encoding,video})
836 Set motion estimation threshold.
838 @item mb_threshold @var{integer} (@emph{encoding,video})
839 Set macroblock threshold.
841 @item dc @var{integer} (@emph{encoding,video})
842 Set intra_dc_precision.
844 @item nssew @var{integer} (@emph{encoding,video})
847 @item skip_top @var{integer} (@emph{decoding,video})
848 Set number of macroblock rows at the top which are skipped.
850 @item skip_bottom @var{integer} (@emph{decoding,video})
851 Set number of macroblock rows at the bottom which are skipped.
853 @item profile @var{integer} (@emph{encoding,audio,video})
899 @item level @var{integer} (@emph{encoding,audio,video})
907 @item lowres @var{integer} (@emph{decoding,audio,video})
908 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
910 @item skip_threshold @var{integer} (@emph{encoding,video})
911 Set frame skip threshold.
913 @item skip_factor @var{integer} (@emph{encoding,video})
914 Set frame skip factor.
916 @item skip_exp @var{integer} (@emph{encoding,video})
917 Set frame skip exponent.
918 Negative values behave identical to the corresponding positive ones, except
919 that the score is normalized.
920 Positive values exist primarily for compatibility reasons and are not so useful.
922 @item skipcmp @var{integer} (@emph{encoding,video})
923 Set frame skip compare function.
928 sum of absolute differences, fast (default)
930 sum of squared errors
932 sum of absolute Hadamard transformed differences
934 sum of absolute DCT transformed differences
936 sum of squared quantization errors (avoid, low quality)
938 number of bits needed for the block
940 rate distortion optimal, slow
944 sum of absolute vertical differences
946 sum of squared vertical differences
948 noise preserving sum of squared differences
950 5/3 wavelet, only used in snow
952 9/7 wavelet, only used in snow
959 @item border_mask @var{float} (@emph{encoding,video})
960 Increase the quantizer for macroblocks close to borders.
962 @item mblmin @var{integer} (@emph{encoding,video})
963 Set min macroblock lagrange factor (VBR).
965 @item mblmax @var{integer} (@emph{encoding,video})
966 Set max macroblock lagrange factor (VBR).
968 @item mepc @var{integer} (@emph{encoding,video})
969 Set motion estimation bitrate penalty compensation (1.0 = 256).
971 @item skip_loop_filter @var{integer} (@emph{decoding,video})
972 @item skip_idct @var{integer} (@emph{decoding,video})
973 @item skip_frame @var{integer} (@emph{decoding,video})
975 Make decoder discard processing depending on the frame type selected
978 @option{skip_loop_filter} skips frame loop filtering, @option{skip_idct}
979 skips frame IDCT/dequantization, @option{skip_frame} skips decoding.
987 Discard useless frames like 0-sized frames.
990 Discard all non-reference frames.
993 Discard all bidirectional frames.
996 Discard all frames excepts keyframes.
1002 Default value is @samp{default}.
1004 @item bidir_refine @var{integer} (@emph{encoding,video})
1005 Refine the two motion vectors used in bidirectional macroblocks.
1007 @item brd_scale @var{integer} (@emph{encoding,video})
1008 Downscale frames for dynamic B-frame decision.
1010 @item keyint_min @var{integer} (@emph{encoding,video})
1011 Set minimum interval between IDR-frames.
1013 @item refs @var{integer} (@emph{encoding,video})
1014 Set reference frames to consider for motion compensation.
1016 @item chromaoffset @var{integer} (@emph{encoding,video})
1017 Set chroma qp offset from luma.
1019 @item trellis @var{integer} (@emph{encoding,audio,video})
1020 Set rate-distortion optimal quantization.
1022 @item sc_factor @var{integer} (@emph{encoding,video})
1023 Set value multiplied by qscale for each frame and added to
1026 @item mv0_threshold @var{integer} (@emph{encoding,video})
1027 @item b_sensitivity @var{integer} (@emph{encoding,video})
1028 Adjust sensitivity of b_frame_strategy 1.
1030 @item compression_level @var{integer} (@emph{encoding,audio,video})
1031 @item min_prediction_order @var{integer} (@emph{encoding,audio})
1032 @item max_prediction_order @var{integer} (@emph{encoding,audio})
1033 @item timecode_frame_start @var{integer} (@emph{encoding,video})
1034 Set GOP timecode frame start number, in non drop frame format.
1036 @item request_channels @var{integer} (@emph{decoding,audio})
1037 Set desired number of audio channels.
1039 @item bits_per_raw_sample @var{integer}
1040 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1045 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1050 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1051 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1052 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1054 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1080 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1125 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1152 @item color_range @var{integer} (@emph{decoding/encoding,video})
1153 If used as input parameter, it serves as a hint to the decoder, which
1154 color_range the input has.
1165 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1182 @item log_level_offset @var{integer}
1183 Set the log level offset.
1185 @item slices @var{integer} (@emph{encoding,video})
1186 Number of slices, used in parallelized encoding.
1188 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1189 Select which multithreading methods to use.
1191 Use of @samp{frame} will increase decoding delay by one frame per
1192 thread, so clients which cannot provide future frames should not use
1198 Decode more than one part of a single frame at once.
1200 Multithreading using slices works only when the video was encoded with
1204 Decode more than one frame at once.
1207 Default value is @samp{slice+frame}.
1209 @item audio_service_type @var{integer} (@emph{encoding,audio})
1210 Set audio service type.
1234 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1235 Set sample format audio decoders should prefer. Default value is
1238 @item pkt_timebase @var{rational number}
1240 @item sub_charenc @var{encoding} (@emph{decoding,subtitles})
1241 Set the input subtitles character encoding.
1243 @item field_order @var{field_order} (@emph{video})
1244 Set/override the field order of the video.
1250 Interlaced video, top field coded and displayed first
1252 Interlaced video, bottom field coded and displayed first
1254 Interlaced video, top coded first, bottom displayed first
1256 Interlaced video, bottom coded first, top displayed first
1259 @item skip_alpha @var{integer} (@emph{decoding,video})
1260 Set to 1 to disable processing alpha (transparency). This works like the
1261 @samp{gray} flag in the @option{flags} option which skips chroma information
1262 instead of alpha. Default is 0.
1264 @item codec_whitelist @var{list} (@emph{input})
1265 "," separated list of allowed decoders. By default all are allowed.
1267 @item dump_separator @var{string} (@emph{input})
1268 Separator used to separate the fields printed on the command line about the
1270 For example to separate the fields with newlines and indention:
1272 ffprobe -dump_separator "
1273 " -i ~/videos/matrixbench_mpeg2.mpg
1276 @item max_pixels @var{integer} (@emph{decoding/encoding,video})
1277 Maximum number of pixels per image. This value can be used to avoid out of
1278 memory failures due to large images.
1282 @c man end CODEC OPTIONS
1284 @ifclear config-writeonly
1285 @include decoders.texi
1287 @ifclear config-readonly
1288 @include encoders.texi