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.
64 Place global headers in extradata instead of every keyframe.
66 Only write platform-, build- and time-independent data. (except (I)DCT).
67 This ensures that file and data checksums are reproducible and match between
68 platforms. Its primary use is for regression testing.
70 Apply H263 advanced intra coding / mpeg4 ac prediction.
72 Deprecated, use mpegvideo private options instead.
74 Deprecated, use mpegvideo private options instead.
76 Apply interlaced motion estimation.
81 @item me_method @var{integer} (@emph{encoding,video})
82 Set motion estimation method.
87 zero motion estimation (fastest)
89 full motion estimation (slowest)
91 EPZS motion estimation (default)
93 esa motion estimation (alias for full)
95 tesa motion estimation
97 dia motion estimation (alias for epzs)
101 phods motion estimation
105 hex motion estimation
107 umh motion estimation
109 iter motion estimation
112 @item extradata_size @var{integer}
115 @item time_base @var{rational number}
118 It is the fundamental unit of time (in seconds) in terms of which
119 frame timestamps are represented. For fixed-fps content, timebase
120 should be @code{1 / frame_rate} and timestamp increments should be
123 @item g @var{integer} (@emph{encoding,video})
124 Set the group of picture (GOP) size. Default value is 12.
126 @item ar @var{integer} (@emph{decoding/encoding,audio})
127 Set audio sampling rate (in Hz).
129 @item ac @var{integer} (@emph{decoding/encoding,audio})
130 Set number of audio channels.
132 @item cutoff @var{integer} (@emph{encoding,audio})
133 Set cutoff bandwidth. (Supported only by selected encoders, see
134 their respective documentation sections.)
136 @item frame_size @var{integer} (@emph{encoding,audio})
137 Set audio frame size.
139 Each submitted frame except the last must contain exactly frame_size
140 samples per channel. May be 0 when the codec has
141 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
142 restricted. It is set by some decoders to indicate constant frame
145 @item frame_number @var{integer}
146 Set the frame number.
148 @item delay @var{integer}
150 @item qcomp @var{float} (@emph{encoding,video})
151 Set video quantizer scale compression (VBR). It is used as a constant
152 in the ratecontrol equation. Recommended range for default rc_eq:
155 @item qblur @var{float} (@emph{encoding,video})
156 Set video quantizer scale blur (VBR).
158 @item qmin @var{integer} (@emph{encoding,video})
159 Set min video quantizer scale (VBR). Must be included between -1 and
160 69, default value is 2.
162 @item qmax @var{integer} (@emph{encoding,video})
163 Set max video quantizer scale (VBR). Must be included between -1 and
164 1024, default value is 31.
166 @item qdiff @var{integer} (@emph{encoding,video})
167 Set max difference between the quantizer scale (VBR).
169 @item bf @var{integer} (@emph{encoding,video})
170 Set max number of B frames between non-B-frames.
172 Must be an integer between -1 and 16. 0 means that B-frames are
173 disabled. If a value of -1 is used, it will choose an automatic value
174 depending on the encoder.
178 @item b_qfactor @var{float} (@emph{encoding,video})
179 Set qp factor between P and B frames.
181 @item rc_strategy @var{integer} (@emph{encoding,video})
182 Set ratecontrol method.
184 @item b_strategy @var{integer} (@emph{encoding,video})
185 Set strategy to choose between I/P/B-frames.
187 @item ps @var{integer} (@emph{encoding,video})
188 Set RTP payload size in bytes.
190 @item mv_bits @var{integer}
191 @item header_bits @var{integer}
192 @item i_tex_bits @var{integer}
193 @item p_tex_bits @var{integer}
194 @item i_count @var{integer}
195 @item p_count @var{integer}
196 @item skip_count @var{integer}
197 @item misc_bits @var{integer}
198 @item frame_bits @var{integer}
199 @item codec_tag @var{integer}
200 @item bug @var{flags} (@emph{decoding,video})
201 Workaround not auto detected encoder bugs.
208 some old lavc generated msmpeg4v3 files (no autodetection)
210 Xvid interlacing bug (autodetected if fourcc==XVIX)
212 (autodetected if fourcc==UMP4)
214 padding bug (autodetected)
218 illegal vlc bug (autodetected per fourcc)
222 old standard qpel (autodetected per fourcc/version)
225 @item direct_blocksize
226 direct-qpel-blocksize bug (autodetected per fourcc/version)
228 edge padding bug (autodetected per fourcc/version)
234 Workaround various bugs in microsoft broken decoders.
239 @item lelim @var{integer} (@emph{encoding,video})
240 Set single coefficient elimination threshold for luminance (negative
241 values also consider DC coefficient).
243 @item celim @var{integer} (@emph{encoding,video})
244 Set single coefficient elimination threshold for chrominance (negative
245 values also consider dc coefficient)
247 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
248 Specify how strictly to follow the standards.
253 strictly conform to an older more strict version of the spec or reference software
255 strictly conform to all the things in the spec no matter what consequences
259 allow unofficial extensions
261 allow non standardized experimental things, experimental
262 (unfinished/work in progress/not well tested) decoders and encoders.
263 Note: experimental decoders can pose a security risk, do not use this for
264 decoding untrusted input.
267 @item b_qoffset @var{float} (@emph{encoding,video})
268 Set QP offset between P and B frames.
270 @item err_detect @var{flags} (@emph{decoding,audio,video})
271 Set error detection flags.
278 detect bitstream specification deviations
280 detect improper bitstream length
282 abort decoding on minor error detection
284 ignore decoding errors, and continue decoding.
285 This is useful if you want to analyze the content of a video and thus want
286 everything to be decoded no matter what. This option will not result in a video
287 that is pleasing to watch in case of errors.
289 consider things that violate the spec and have not been seen in the wild as errors
291 consider all spec non compliancies as errors
293 consider things that a sane encoder should not do as an error
296 @item has_b_frames @var{integer}
298 @item block_align @var{integer}
300 @item mpeg_quant @var{integer} (@emph{encoding,video})
301 Use MPEG quantizers instead of H.263.
303 @item qsquish @var{float} (@emph{encoding,video})
304 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
305 differentiable function).
307 @item rc_qmod_amp @var{float} (@emph{encoding,video})
308 Set experimental quantizer modulation.
310 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
311 Set experimental quantizer modulation.
313 @item rc_override_count @var{integer}
315 @item rc_eq @var{string} (@emph{encoding,video})
316 Set rate control equation. When computing the expression, besides the
317 standard functions defined in the section 'Expression Evaluation', the
318 following functions are available: bits2qp(bits), qp2bits(qp). Also
319 the following constants are available: iTex pTex tex mv fCode iCount
320 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
323 @item maxrate @var{integer} (@emph{encoding,audio,video})
324 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
326 @item minrate @var{integer} (@emph{encoding,audio,video})
327 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
328 encode. It is of little use elsewise.
330 @item bufsize @var{integer} (@emph{encoding,audio,video})
331 Set ratecontrol buffer size (in bits).
333 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
336 @item i_qfactor @var{float} (@emph{encoding,video})
337 Set QP factor between P and I frames.
339 @item i_qoffset @var{float} (@emph{encoding,video})
340 Set QP offset between P and I frames.
342 @item rc_init_cplx @var{float} (@emph{encoding,video})
343 Set initial complexity for 1-pass encoding.
345 @item dct @var{integer} (@emph{encoding,video})
351 autoselect a good one (default)
361 floating point AAN DCT
364 @item lumi_mask @var{float} (@emph{encoding,video})
365 Compress bright areas stronger than medium ones.
367 @item tcplx_mask @var{float} (@emph{encoding,video})
368 Set temporal complexity masking.
370 @item scplx_mask @var{float} (@emph{encoding,video})
371 Set spatial complexity masking.
373 @item p_mask @var{float} (@emph{encoding,video})
376 @item dark_mask @var{float} (@emph{encoding,video})
377 Compress dark areas stronger than medium ones.
379 @item idct @var{integer} (@emph{decoding/encoding,video})
380 Select IDCT implementation.
393 Automatically pick a IDCT compatible with the simple one
416 floating point AAN IDCT
419 @item slice_count @var{integer}
421 @item ec @var{flags} (@emph{decoding,video})
422 Set error concealment strategy.
427 iterative motion vector (MV) search (slow)
429 use strong deblock filter for damaged MBs
431 favor predicting from the previous frame instead of the current
434 @item bits_per_coded_sample @var{integer}
436 @item pred @var{integer} (@emph{encoding,video})
437 Set prediction method.
449 @item aspect @var{rational number} (@emph{encoding,video})
450 Set sample aspect ratio.
452 @item sar @var{rational number} (@emph{encoding,video})
453 Set sample aspect ratio. Alias to @var{aspect}.
455 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
456 Print specific debug info.
469 per-block quantization parameter (QP)
473 display complexity metadata for the upcoming frame, GoP or for a given duration.
482 memory management control operations (H.264)
486 picture buffer allocations
490 skip motion compensation
493 @item cmp @var{integer} (@emph{encoding,video})
494 Set full pel me compare function.
499 sum of absolute differences, fast (default)
501 sum of squared errors
503 sum of absolute Hadamard transformed differences
505 sum of absolute DCT transformed differences
507 sum of squared quantization errors (avoid, low quality)
509 number of bits needed for the block
511 rate distortion optimal, slow
515 sum of absolute vertical differences
517 sum of squared vertical differences
519 noise preserving sum of squared differences
521 5/3 wavelet, only used in snow
523 9/7 wavelet, only used in snow
530 @item subcmp @var{integer} (@emph{encoding,video})
531 Set sub pel me compare function.
536 sum of absolute differences, fast (default)
538 sum of squared errors
540 sum of absolute Hadamard transformed differences
542 sum of absolute DCT transformed differences
544 sum of squared quantization errors (avoid, low quality)
546 number of bits needed for the block
548 rate distortion optimal, slow
552 sum of absolute vertical differences
554 sum of squared vertical differences
556 noise preserving sum of squared differences
558 5/3 wavelet, only used in snow
560 9/7 wavelet, only used in snow
567 @item mbcmp @var{integer} (@emph{encoding,video})
568 Set macroblock compare function.
573 sum of absolute differences, fast (default)
575 sum of squared errors
577 sum of absolute Hadamard transformed differences
579 sum of absolute DCT transformed differences
581 sum of squared quantization errors (avoid, low quality)
583 number of bits needed for the block
585 rate distortion optimal, slow
589 sum of absolute vertical differences
591 sum of squared vertical differences
593 noise preserving sum of squared differences
595 5/3 wavelet, only used in snow
597 9/7 wavelet, only used in snow
604 @item ildctcmp @var{integer} (@emph{encoding,video})
605 Set interlaced dct compare function.
610 sum of absolute differences, fast (default)
612 sum of squared errors
614 sum of absolute Hadamard transformed differences
616 sum of absolute DCT transformed differences
618 sum of squared quantization errors (avoid, low quality)
620 number of bits needed for the block
622 rate distortion optimal, slow
626 sum of absolute vertical differences
628 sum of squared vertical differences
630 noise preserving sum of squared differences
632 5/3 wavelet, only used in snow
634 9/7 wavelet, only used in snow
641 @item dia_size @var{integer} (@emph{encoding,video})
642 Set diamond type & size for motion estimation.
644 @item last_pred @var{integer} (@emph{encoding,video})
645 Set amount of motion predictors from the previous frame.
647 @item preme @var{integer} (@emph{encoding,video})
648 Set pre motion estimation.
650 @item precmp @var{integer} (@emph{encoding,video})
651 Set pre motion estimation compare function.
656 sum of absolute differences, fast (default)
658 sum of squared errors
660 sum of absolute Hadamard transformed differences
662 sum of absolute DCT transformed differences
664 sum of squared quantization errors (avoid, low quality)
666 number of bits needed for the block
668 rate distortion optimal, slow
672 sum of absolute vertical differences
674 sum of squared vertical differences
676 noise preserving sum of squared differences
678 5/3 wavelet, only used in snow
680 9/7 wavelet, only used in snow
687 @item pre_dia_size @var{integer} (@emph{encoding,video})
688 Set diamond type & size for motion estimation pre-pass.
690 @item subq @var{integer} (@emph{encoding,video})
691 Set sub pel motion estimation quality.
693 @item dtg_active_format @var{integer}
695 @item me_range @var{integer} (@emph{encoding,video})
696 Set limit motion vectors range (1023 for DivX player).
698 @item ibias @var{integer} (@emph{encoding,video})
699 Set intra quant bias.
701 @item pbias @var{integer} (@emph{encoding,video})
702 Set inter quant bias.
704 @item color_table_id @var{integer}
706 @item global_quality @var{integer} (@emph{encoding,audio,video})
708 @item coder @var{integer} (@emph{encoding,video})
713 variable length coder / huffman coder
724 @item context @var{integer} (@emph{encoding,video})
727 @item slice_flags @var{integer}
729 @item mbd @var{integer} (@emph{encoding,video})
730 Set macroblock decision algorithm (high quality mode).
739 use best rate distortion
742 @item stream_codec_tag @var{integer}
744 @item sc_threshold @var{integer} (@emph{encoding,video})
745 Set scene change threshold.
747 @item lmin @var{integer} (@emph{encoding,video})
748 Set min lagrange factor (VBR).
750 @item lmax @var{integer} (@emph{encoding,video})
751 Set max lagrange factor (VBR).
753 @item nr @var{integer} (@emph{encoding,video})
756 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
757 Set number of bits which should be loaded into the rc buffer before
760 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
765 Allow non spec compliant speedup tricks.
767 Deprecated, use mpegvideo private options instead.
769 Skip bitstream encoding.
771 Ignore cropping information from sps.
773 Place global headers at every keyframe instead of in extradata.
775 Frame data might be split into multiple chunks.
777 Show all frames before the first keyframe.
779 Deprecated, use mpegvideo private options instead.
781 Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS})
782 for codecs that support it. See also @file{doc/examples/export_mvs.c}.
785 @item error @var{integer} (@emph{encoding,video})
787 @item qns @var{integer} (@emph{encoding,video})
788 Deprecated, use mpegvideo private options instead.
790 @item threads @var{integer} (@emph{decoding/encoding,video})
791 Set the number of threads to be used, in case the selected codec
792 implementation supports multi-threading.
797 automatically select the number of threads to set
800 Default value is @samp{auto}.
802 @item me_threshold @var{integer} (@emph{encoding,video})
803 Set motion estimation threshold.
805 @item mb_threshold @var{integer} (@emph{encoding,video})
806 Set macroblock threshold.
808 @item dc @var{integer} (@emph{encoding,video})
809 Set intra_dc_precision.
811 @item nssew @var{integer} (@emph{encoding,video})
814 @item skip_top @var{integer} (@emph{decoding,video})
815 Set number of macroblock rows at the top which are skipped.
817 @item skip_bottom @var{integer} (@emph{decoding,video})
818 Set number of macroblock rows at the bottom which are skipped.
820 @item profile @var{integer} (@emph{encoding,audio,video})
866 @item level @var{integer} (@emph{encoding,audio,video})
874 @item lowres @var{integer} (@emph{decoding,audio,video})
875 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
877 @item skip_threshold @var{integer} (@emph{encoding,video})
878 Set frame skip threshold.
880 @item skip_factor @var{integer} (@emph{encoding,video})
881 Set frame skip factor.
883 @item skip_exp @var{integer} (@emph{encoding,video})
884 Set frame skip exponent.
885 Negative values behave identical to the corresponding positive ones, except
886 that the score is normalized.
887 Positive values exist primarily for compatibility reasons and are not so useful.
889 @item skipcmp @var{integer} (@emph{encoding,video})
890 Set frame skip compare function.
895 sum of absolute differences, fast (default)
897 sum of squared errors
899 sum of absolute Hadamard transformed differences
901 sum of absolute DCT transformed differences
903 sum of squared quantization errors (avoid, low quality)
905 number of bits needed for the block
907 rate distortion optimal, slow
911 sum of absolute vertical differences
913 sum of squared vertical differences
915 noise preserving sum of squared differences
917 5/3 wavelet, only used in snow
919 9/7 wavelet, only used in snow
926 @item border_mask @var{float} (@emph{encoding,video})
927 Increase the quantizer for macroblocks close to borders.
929 @item mblmin @var{integer} (@emph{encoding,video})
930 Set min macroblock lagrange factor (VBR).
932 @item mblmax @var{integer} (@emph{encoding,video})
933 Set max macroblock lagrange factor (VBR).
935 @item mepc @var{integer} (@emph{encoding,video})
936 Set motion estimation bitrate penalty compensation (1.0 = 256).
938 @item skip_loop_filter @var{integer} (@emph{decoding,video})
939 @item skip_idct @var{integer} (@emph{decoding,video})
940 @item skip_frame @var{integer} (@emph{decoding,video})
942 Make decoder discard processing depending on the frame type selected
945 @option{skip_loop_filter} skips frame loop filtering, @option{skip_idct}
946 skips frame IDCT/dequantization, @option{skip_frame} skips decoding.
954 Discard useless frames like 0-sized frames.
957 Discard all non-reference frames.
960 Discard all bidirectional frames.
963 Discard all frames excepts keyframes.
969 Default value is @samp{default}.
971 @item bidir_refine @var{integer} (@emph{encoding,video})
972 Refine the two motion vectors used in bidirectional macroblocks.
974 @item brd_scale @var{integer} (@emph{encoding,video})
975 Downscale frames for dynamic B-frame decision.
977 @item keyint_min @var{integer} (@emph{encoding,video})
978 Set minimum interval between IDR-frames.
980 @item refs @var{integer} (@emph{encoding,video})
981 Set reference frames to consider for motion compensation.
983 @item chromaoffset @var{integer} (@emph{encoding,video})
984 Set chroma qp offset from luma.
986 @item trellis @var{integer} (@emph{encoding,audio,video})
987 Set rate-distortion optimal quantization.
989 @item sc_factor @var{integer} (@emph{encoding,video})
990 Set value multiplied by qscale for each frame and added to
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 indention:
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