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.
48 Use internal 2pass ratecontrol in first pass mode.
50 Use internal 2pass ratecontrol in second pass mode.
52 Only decode/encode grayscale.
56 Set error[?] variables during encoding.
59 Don't output frames whose parameters differ from first decoded frame in stream.
60 Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
67 Place global headers in extradata instead of every keyframe.
69 Only write platform-, build- and time-independent data. (except (I)DCT).
70 This ensures that file and data checksums are reproducible and match between
71 platforms. Its primary use is for regression testing.
73 Apply H263 advanced intra coding / mpeg4 ac prediction.
75 Deprecated, use mpegvideo private options instead.
77 Deprecated, use mpegvideo private options instead.
79 Apply interlaced motion estimation.
84 @item me_method @var{integer} (@emph{encoding,video})
85 Set motion estimation method.
90 zero motion estimation (fastest)
92 full motion estimation (slowest)
94 EPZS motion estimation (default)
96 esa motion estimation (alias for full)
98 tesa motion estimation
100 dia motion estimation (alias for epzs)
102 log motion estimation
104 phods motion estimation
108 hex motion estimation
110 umh motion estimation
112 iter motion estimation
115 @item extradata_size @var{integer}
118 @item time_base @var{rational number}
121 It is the fundamental unit of time (in seconds) in terms of which
122 frame timestamps are represented. For fixed-fps content, timebase
123 should be @code{1 / frame_rate} and timestamp increments should be
126 @item g @var{integer} (@emph{encoding,video})
127 Set the group of picture (GOP) size. Default value is 12.
129 @item ar @var{integer} (@emph{decoding/encoding,audio})
130 Set audio sampling rate (in Hz).
132 @item ac @var{integer} (@emph{decoding/encoding,audio})
133 Set number of audio channels.
135 @item cutoff @var{integer} (@emph{encoding,audio})
136 Set cutoff bandwidth. (Supported only by selected encoders, see
137 their respective documentation sections.)
139 @item frame_size @var{integer} (@emph{encoding,audio})
140 Set audio frame size.
142 Each submitted frame except the last must contain exactly frame_size
143 samples per channel. May be 0 when the codec has
144 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
145 restricted. It is set by some decoders to indicate constant frame
148 @item frame_number @var{integer}
149 Set the frame number.
151 @item delay @var{integer}
153 @item qcomp @var{float} (@emph{encoding,video})
154 Set video quantizer scale compression (VBR). It is used as a constant
155 in the ratecontrol equation. Recommended range for default rc_eq:
158 @item qblur @var{float} (@emph{encoding,video})
159 Set video quantizer scale blur (VBR).
161 @item qmin @var{integer} (@emph{encoding,video})
162 Set min video quantizer scale (VBR). Must be included between -1 and
163 69, default value is 2.
165 @item qmax @var{integer} (@emph{encoding,video})
166 Set max video quantizer scale (VBR). Must be included between -1 and
167 1024, default value is 31.
169 @item qdiff @var{integer} (@emph{encoding,video})
170 Set max difference between the quantizer scale (VBR).
172 @item bf @var{integer} (@emph{encoding,video})
173 Set max number of B frames between non-B-frames.
175 Must be an integer between -1 and 16. 0 means that B-frames are
176 disabled. If a value of -1 is used, it will choose an automatic value
177 depending on the encoder.
181 @item b_qfactor @var{float} (@emph{encoding,video})
182 Set qp factor between P and B frames.
184 @item rc_strategy @var{integer} (@emph{encoding,video})
185 Set ratecontrol method.
187 @item b_strategy @var{integer} (@emph{encoding,video})
188 Set strategy to choose between I/P/B-frames.
190 @item ps @var{integer} (@emph{encoding,video})
191 Set RTP payload size in bytes.
193 @item mv_bits @var{integer}
194 @item header_bits @var{integer}
195 @item i_tex_bits @var{integer}
196 @item p_tex_bits @var{integer}
197 @item i_count @var{integer}
198 @item p_count @var{integer}
199 @item skip_count @var{integer}
200 @item misc_bits @var{integer}
201 @item frame_bits @var{integer}
202 @item codec_tag @var{integer}
203 @item bug @var{flags} (@emph{decoding,video})
204 Workaround not auto detected encoder bugs.
211 some old lavc generated msmpeg4v3 files (no autodetection)
213 Xvid interlacing bug (autodetected if fourcc==XVIX)
215 (autodetected if fourcc==UMP4)
217 padding bug (autodetected)
221 illegal vlc bug (autodetected per fourcc)
225 old standard qpel (autodetected per fourcc/version)
228 @item direct_blocksize
229 direct-qpel-blocksize bug (autodetected per fourcc/version)
231 edge padding bug (autodetected per fourcc/version)
237 Workaround various bugs in microsoft broken decoders.
242 @item lelim @var{integer} (@emph{encoding,video})
243 Set single coefficient elimination threshold for luminance (negative
244 values also consider DC coefficient).
246 @item celim @var{integer} (@emph{encoding,video})
247 Set single coefficient elimination threshold for chrominance (negative
248 values also consider dc coefficient)
250 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
251 Specify how strictly to follow the standards.
256 strictly conform to an older more strict version of the spec or reference software
258 strictly conform to all the things in the spec no matter what consequences
262 allow unofficial extensions
264 allow non standardized experimental things, experimental
265 (unfinished/work in progress/not well tested) decoders and encoders.
266 Note: experimental decoders can pose a security risk, do not use this for
267 decoding untrusted input.
270 @item b_qoffset @var{float} (@emph{encoding,video})
271 Set QP offset between P and B frames.
273 @item err_detect @var{flags} (@emph{decoding,audio,video})
274 Set error detection flags.
281 detect bitstream specification deviations
283 detect improper bitstream length
285 abort decoding on minor error detection
287 ignore decoding errors, and continue decoding.
288 This is useful if you want to analyze the content of a video and thus want
289 everything to be decoded no matter what. This option will not result in a video
290 that is pleasing to watch in case of errors.
292 consider things that violate the spec and have not been seen in the wild as errors
294 consider all spec non compliancies as errors
296 consider things that a sane encoder should not do as an error
299 @item has_b_frames @var{integer}
301 @item block_align @var{integer}
303 @item mpeg_quant @var{integer} (@emph{encoding,video})
304 Use MPEG quantizers instead of H.263.
306 @item qsquish @var{float} (@emph{encoding,video})
307 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
308 differentiable function).
310 @item rc_qmod_amp @var{float} (@emph{encoding,video})
311 Set experimental quantizer modulation.
313 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
314 Set experimental quantizer modulation.
316 @item rc_override_count @var{integer}
318 @item rc_eq @var{string} (@emph{encoding,video})
319 Set rate control equation. When computing the expression, besides the
320 standard functions defined in the section 'Expression Evaluation', the
321 following functions are available: bits2qp(bits), qp2bits(qp). Also
322 the following constants are available: iTex pTex tex mv fCode iCount
323 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
326 @item maxrate @var{integer} (@emph{encoding,audio,video})
327 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
329 @item minrate @var{integer} (@emph{encoding,audio,video})
330 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
331 encode. It is of little use elsewise.
333 @item bufsize @var{integer} (@emph{encoding,audio,video})
334 Set ratecontrol buffer size (in bits).
336 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
339 @item i_qfactor @var{float} (@emph{encoding,video})
340 Set QP factor between P and I frames.
342 @item i_qoffset @var{float} (@emph{encoding,video})
343 Set QP offset between P and I frames.
345 @item rc_init_cplx @var{float} (@emph{encoding,video})
346 Set initial complexity for 1-pass encoding.
348 @item dct @var{integer} (@emph{encoding,video})
354 autoselect a good one (default)
364 floating point AAN DCT
367 @item lumi_mask @var{float} (@emph{encoding,video})
368 Compress bright areas stronger than medium ones.
370 @item tcplx_mask @var{float} (@emph{encoding,video})
371 Set temporal complexity masking.
373 @item scplx_mask @var{float} (@emph{encoding,video})
374 Set spatial complexity masking.
376 @item p_mask @var{float} (@emph{encoding,video})
379 @item dark_mask @var{float} (@emph{encoding,video})
380 Compress dark areas stronger than medium ones.
382 @item idct @var{integer} (@emph{decoding/encoding,video})
383 Select IDCT implementation.
396 Automatically pick a IDCT compatible with the simple one
419 floating point AAN IDCT
422 @item slice_count @var{integer}
424 @item ec @var{flags} (@emph{decoding,video})
425 Set error concealment strategy.
430 iterative motion vector (MV) search (slow)
432 use strong deblock filter for damaged MBs
434 favor predicting from the previous frame instead of the current
437 @item bits_per_coded_sample @var{integer}
439 @item pred @var{integer} (@emph{encoding,video})
440 Set prediction method.
452 @item aspect @var{rational number} (@emph{encoding,video})
453 Set sample aspect ratio.
455 @item sar @var{rational number} (@emph{encoding,video})
456 Set sample aspect ratio. Alias to @var{aspect}.
458 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
459 Print specific debug info.
472 per-block quantization parameter (QP)
476 display complexity metadata for the upcoming frame, GoP or for a given duration.
485 memory management control operations (H.264)
489 picture buffer allocations
493 skip motion compensation
496 @item cmp @var{integer} (@emph{encoding,video})
497 Set full pel me compare function.
502 sum of absolute differences, fast (default)
504 sum of squared errors
506 sum of absolute Hadamard transformed differences
508 sum of absolute DCT transformed differences
510 sum of squared quantization errors (avoid, low quality)
512 number of bits needed for the block
514 rate distortion optimal, slow
518 sum of absolute vertical differences
520 sum of squared vertical differences
522 noise preserving sum of squared differences
524 5/3 wavelet, only used in snow
526 9/7 wavelet, only used in snow
533 @item subcmp @var{integer} (@emph{encoding,video})
534 Set sub pel me compare function.
539 sum of absolute differences, fast (default)
541 sum of squared errors
543 sum of absolute Hadamard transformed differences
545 sum of absolute DCT transformed differences
547 sum of squared quantization errors (avoid, low quality)
549 number of bits needed for the block
551 rate distortion optimal, slow
555 sum of absolute vertical differences
557 sum of squared vertical differences
559 noise preserving sum of squared differences
561 5/3 wavelet, only used in snow
563 9/7 wavelet, only used in snow
570 @item mbcmp @var{integer} (@emph{encoding,video})
571 Set macroblock compare function.
576 sum of absolute differences, fast (default)
578 sum of squared errors
580 sum of absolute Hadamard transformed differences
582 sum of absolute DCT transformed differences
584 sum of squared quantization errors (avoid, low quality)
586 number of bits needed for the block
588 rate distortion optimal, slow
592 sum of absolute vertical differences
594 sum of squared vertical differences
596 noise preserving sum of squared differences
598 5/3 wavelet, only used in snow
600 9/7 wavelet, only used in snow
607 @item ildctcmp @var{integer} (@emph{encoding,video})
608 Set interlaced dct compare function.
613 sum of absolute differences, fast (default)
615 sum of squared errors
617 sum of absolute Hadamard transformed differences
619 sum of absolute DCT transformed differences
621 sum of squared quantization errors (avoid, low quality)
623 number of bits needed for the block
625 rate distortion optimal, slow
629 sum of absolute vertical differences
631 sum of squared vertical differences
633 noise preserving sum of squared differences
635 5/3 wavelet, only used in snow
637 9/7 wavelet, only used in snow
644 @item dia_size @var{integer} (@emph{encoding,video})
645 Set diamond type & size for motion estimation.
647 @item last_pred @var{integer} (@emph{encoding,video})
648 Set amount of motion predictors from the previous frame.
650 @item preme @var{integer} (@emph{encoding,video})
651 Set pre motion estimation.
653 @item precmp @var{integer} (@emph{encoding,video})
654 Set pre motion estimation compare function.
659 sum of absolute differences, fast (default)
661 sum of squared errors
663 sum of absolute Hadamard transformed differences
665 sum of absolute DCT transformed differences
667 sum of squared quantization errors (avoid, low quality)
669 number of bits needed for the block
671 rate distortion optimal, slow
675 sum of absolute vertical differences
677 sum of squared vertical differences
679 noise preserving sum of squared differences
681 5/3 wavelet, only used in snow
683 9/7 wavelet, only used in snow
690 @item pre_dia_size @var{integer} (@emph{encoding,video})
691 Set diamond type & size for motion estimation pre-pass.
693 @item subq @var{integer} (@emph{encoding,video})
694 Set sub pel motion estimation quality.
696 @item dtg_active_format @var{integer}
698 @item me_range @var{integer} (@emph{encoding,video})
699 Set limit motion vectors range (1023 for DivX player).
701 @item ibias @var{integer} (@emph{encoding,video})
702 Set intra quant bias.
704 @item pbias @var{integer} (@emph{encoding,video})
705 Set inter quant bias.
707 @item color_table_id @var{integer}
709 @item global_quality @var{integer} (@emph{encoding,audio,video})
711 @item coder @var{integer} (@emph{encoding,video})
716 variable length coder / huffman coder
727 @item context @var{integer} (@emph{encoding,video})
730 @item slice_flags @var{integer}
732 @item mbd @var{integer} (@emph{encoding,video})
733 Set macroblock decision algorithm (high quality mode).
742 use best rate distortion
745 @item stream_codec_tag @var{integer}
747 @item sc_threshold @var{integer} (@emph{encoding,video})
748 Set scene change threshold.
750 @item lmin @var{integer} (@emph{encoding,video})
751 Set min lagrange factor (VBR).
753 @item lmax @var{integer} (@emph{encoding,video})
754 Set max lagrange factor (VBR).
756 @item nr @var{integer} (@emph{encoding,video})
759 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
760 Set number of bits which should be loaded into the rc buffer before
763 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
768 Allow non spec compliant speedup tricks.
770 Deprecated, use mpegvideo private options instead.
772 Skip bitstream encoding.
774 Ignore cropping information from sps.
776 Place global headers at every keyframe instead of in extradata.
778 Frame data might be split into multiple chunks.
780 Show all frames before the first keyframe.
782 Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS})
783 for codecs that support it. See also @file{doc/examples/export_mvs.c}.
786 @item error @var{integer} (@emph{encoding,video})
788 @item qns @var{integer} (@emph{encoding,video})
789 Deprecated, use mpegvideo private options instead.
791 @item threads @var{integer} (@emph{decoding/encoding,video})
792 Set the number of threads to be used, in case the selected codec
793 implementation supports multi-threading.
798 automatically select the number of threads to set
801 Default value is @samp{auto}.
803 @item me_threshold @var{integer} (@emph{encoding,video})
804 Set motion estimation threshold.
806 @item mb_threshold @var{integer} (@emph{encoding,video})
807 Set macroblock threshold.
809 @item dc @var{integer} (@emph{encoding,video})
810 Set intra_dc_precision.
812 @item nssew @var{integer} (@emph{encoding,video})
815 @item skip_top @var{integer} (@emph{decoding,video})
816 Set number of macroblock rows at the top which are skipped.
818 @item skip_bottom @var{integer} (@emph{decoding,video})
819 Set number of macroblock rows at the bottom which are skipped.
821 @item profile @var{integer} (@emph{encoding,audio,video})
867 @item level @var{integer} (@emph{encoding,audio,video})
875 @item lowres @var{integer} (@emph{decoding,audio,video})
876 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
878 @item skip_threshold @var{integer} (@emph{encoding,video})
879 Set frame skip threshold.
881 @item skip_factor @var{integer} (@emph{encoding,video})
882 Set frame skip factor.
884 @item skip_exp @var{integer} (@emph{encoding,video})
885 Set frame skip exponent.
886 Negative values behave identical to the corresponding positive ones, except
887 that the score is normalized.
888 Positive values exist primarily for compatibility reasons and are not so useful.
890 @item skipcmp @var{integer} (@emph{encoding,video})
891 Set frame skip compare function.
896 sum of absolute differences, fast (default)
898 sum of squared errors
900 sum of absolute Hadamard transformed differences
902 sum of absolute DCT transformed differences
904 sum of squared quantization errors (avoid, low quality)
906 number of bits needed for the block
908 rate distortion optimal, slow
912 sum of absolute vertical differences
914 sum of squared vertical differences
916 noise preserving sum of squared differences
918 5/3 wavelet, only used in snow
920 9/7 wavelet, only used in snow
927 @item border_mask @var{float} (@emph{encoding,video})
928 Increase the quantizer for macroblocks close to borders.
930 @item mblmin @var{integer} (@emph{encoding,video})
931 Set min macroblock lagrange factor (VBR).
933 @item mblmax @var{integer} (@emph{encoding,video})
934 Set max macroblock lagrange factor (VBR).
936 @item mepc @var{integer} (@emph{encoding,video})
937 Set motion estimation bitrate penalty compensation (1.0 = 256).
939 @item skip_loop_filter @var{integer} (@emph{decoding,video})
940 @item skip_idct @var{integer} (@emph{decoding,video})
941 @item skip_frame @var{integer} (@emph{decoding,video})
943 Make decoder discard processing depending on the frame type selected
946 @option{skip_loop_filter} skips frame loop filtering, @option{skip_idct}
947 skips frame IDCT/dequantization, @option{skip_frame} skips decoding.
955 Discard useless frames like 0-sized frames.
958 Discard all non-reference frames.
961 Discard all bidirectional frames.
964 Discard all frames excepts keyframes.
967 Discard all frames except I frames.
973 Default value is @samp{default}.
975 @item bidir_refine @var{integer} (@emph{encoding,video})
976 Refine the two motion vectors used in bidirectional macroblocks.
978 @item brd_scale @var{integer} (@emph{encoding,video})
979 Downscale frames for dynamic B-frame decision.
981 @item keyint_min @var{integer} (@emph{encoding,video})
982 Set minimum interval between IDR-frames.
984 @item refs @var{integer} (@emph{encoding,video})
985 Set reference frames to consider for motion compensation.
987 @item chromaoffset @var{integer} (@emph{encoding,video})
988 Set chroma qp offset from luma.
990 @item trellis @var{integer} (@emph{encoding,audio,video})
991 Set rate-distortion optimal quantization.
993 @item mv0_threshold @var{integer} (@emph{encoding,video})
994 @item b_sensitivity @var{integer} (@emph{encoding,video})
995 Adjust sensitivity of b_frame_strategy 1.
997 @item compression_level @var{integer} (@emph{encoding,audio,video})
998 @item min_prediction_order @var{integer} (@emph{encoding,audio})
999 @item max_prediction_order @var{integer} (@emph{encoding,audio})
1000 @item timecode_frame_start @var{integer} (@emph{encoding,video})
1001 Set GOP timecode frame start number, in non drop frame format.
1003 @item request_channels @var{integer} (@emph{decoding,audio})
1004 Set desired number of audio channels.
1006 @item bits_per_raw_sample @var{integer}
1007 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1012 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1017 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1018 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1019 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1021 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1049 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1094 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1121 @item color_range @var{integer} (@emph{decoding/encoding,video})
1122 If used as input parameter, it serves as a hint to the decoder, which
1123 color_range the input has.
1134 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1151 @item log_level_offset @var{integer}
1152 Set the log level offset.
1154 @item slices @var{integer} (@emph{encoding,video})
1155 Number of slices, used in parallelized encoding.
1157 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1158 Select which multithreading methods to use.
1160 Use of @samp{frame} will increase decoding delay by one frame per
1161 thread, so clients which cannot provide future frames should not use
1167 Decode more than one part of a single frame at once.
1169 Multithreading using slices works only when the video was encoded with
1173 Decode more than one frame at once.
1176 Default value is @samp{slice+frame}.
1178 @item audio_service_type @var{integer} (@emph{encoding,audio})
1179 Set audio service type.
1203 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1204 Set sample format audio decoders should prefer. Default value is
1207 @item pkt_timebase @var{rational number}
1209 @item sub_charenc @var{encoding} (@emph{decoding,subtitles})
1210 Set the input subtitles character encoding.
1212 @item field_order @var{field_order} (@emph{video})
1213 Set/override the field order of the video.
1219 Interlaced video, top field coded and displayed first
1221 Interlaced video, bottom field coded and displayed first
1223 Interlaced video, top coded first, bottom displayed first
1225 Interlaced video, bottom coded first, top displayed first
1228 @item skip_alpha @var{bool} (@emph{decoding,video})
1229 Set to 1 to disable processing alpha (transparency). This works like the
1230 @samp{gray} flag in the @option{flags} option which skips chroma information
1231 instead of alpha. Default is 0.
1233 @item codec_whitelist @var{list} (@emph{input})
1234 "," separated list of allowed decoders. By default all are allowed.
1236 @item dump_separator @var{string} (@emph{input})
1237 Separator used to separate the fields printed on the command line about the
1239 For example, to separate the fields with newlines and indentation:
1241 ffprobe -dump_separator "
1242 " -i ~/videos/matrixbench_mpeg2.mpg
1245 @item max_pixels @var{integer} (@emph{decoding/encoding,video})
1246 Maximum number of pixels per image. This value can be used to avoid out of
1247 memory failures due to large images.
1249 @item apply_cropping @var{bool} (@emph{decoding,video})
1250 Enable cropping if cropping parameters are multiples of the required
1251 alignment for the left and top parameters. If the alignment is not met the
1252 cropping will be partially applied to maintain alignment.
1253 Default is 1 (enabled).
1254 Note: The required alignment depends on if @code{AV_CODEC_FLAG_UNALIGNED} is set and the
1255 CPU. @code{AV_CODEC_FLAG_UNALIGNED} cannot be changed from the command line. Also hardware
1256 decoders will not apply left/top Cropping.
1261 @c man end CODEC OPTIONS
1263 @ifclear config-writeonly
1264 @include decoders.texi
1266 @ifclear config-readonly
1267 @include encoders.texi