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.
66 Place global headers in extradata instead of every keyframe.
68 Only write platform-, build- and time-independent data. (except (I)DCT).
69 This ensures that file and data checksums are reproducible and match between
70 platforms. Its primary use is for regression testing.
72 Apply H263 advanced intra coding / mpeg4 ac prediction.
74 Deprecated, use mpegvideo private options instead.
76 Deprecated, use mpegvideo private options instead.
78 Apply interlaced motion estimation.
83 @item me_method @var{integer} (@emph{encoding,video})
84 Set motion estimation method.
89 zero motion estimation (fastest)
91 full motion estimation (slowest)
93 EPZS motion estimation (default)
95 esa motion estimation (alias for full)
97 tesa motion estimation
99 dia motion estimation (alias for epzs)
101 log motion estimation
103 phods motion estimation
107 hex motion estimation
109 umh motion estimation
111 iter motion estimation
114 @item extradata_size @var{integer}
117 @item time_base @var{rational number}
120 It is the fundamental unit of time (in seconds) in terms of which
121 frame timestamps are represented. For fixed-fps content, timebase
122 should be @code{1 / frame_rate} and timestamp increments should be
125 @item g @var{integer} (@emph{encoding,video})
126 Set the group of picture (GOP) size. Default value is 12.
128 @item ar @var{integer} (@emph{decoding/encoding,audio})
129 Set audio sampling rate (in Hz).
131 @item ac @var{integer} (@emph{decoding/encoding,audio})
132 Set number of audio channels.
134 @item cutoff @var{integer} (@emph{encoding,audio})
135 Set cutoff bandwidth. (Supported only by selected encoders, see
136 their respective documentation sections.)
138 @item frame_size @var{integer} (@emph{encoding,audio})
139 Set audio frame size.
141 Each submitted frame except the last must contain exactly frame_size
142 samples per channel. May be 0 when the codec has
143 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
144 restricted. It is set by some decoders to indicate constant frame
147 @item frame_number @var{integer}
148 Set the frame number.
150 @item delay @var{integer}
152 @item qcomp @var{float} (@emph{encoding,video})
153 Set video quantizer scale compression (VBR). It is used as a constant
154 in the ratecontrol equation. Recommended range for default rc_eq:
157 @item qblur @var{float} (@emph{encoding,video})
158 Set video quantizer scale blur (VBR).
160 @item qmin @var{integer} (@emph{encoding,video})
161 Set min video quantizer scale (VBR). Must be included between -1 and
162 69, default value is 2.
164 @item qmax @var{integer} (@emph{encoding,video})
165 Set max video quantizer scale (VBR). Must be included between -1 and
166 1024, default value is 31.
168 @item qdiff @var{integer} (@emph{encoding,video})
169 Set max difference between the quantizer scale (VBR).
171 @item bf @var{integer} (@emph{encoding,video})
172 Set max number of B frames between non-B-frames.
174 Must be an integer between -1 and 16. 0 means that B-frames are
175 disabled. If a value of -1 is used, it will choose an automatic value
176 depending on the encoder.
180 @item b_qfactor @var{float} (@emph{encoding,video})
181 Set qp factor between P and B frames.
183 @item rc_strategy @var{integer} (@emph{encoding,video})
184 Set ratecontrol method.
186 @item b_strategy @var{integer} (@emph{encoding,video})
187 Set strategy to choose between I/P/B-frames.
189 @item ps @var{integer} (@emph{encoding,video})
190 Set RTP payload size in bytes.
192 @item mv_bits @var{integer}
193 @item header_bits @var{integer}
194 @item i_tex_bits @var{integer}
195 @item p_tex_bits @var{integer}
196 @item i_count @var{integer}
197 @item p_count @var{integer}
198 @item skip_count @var{integer}
199 @item misc_bits @var{integer}
200 @item frame_bits @var{integer}
201 @item codec_tag @var{integer}
202 @item bug @var{flags} (@emph{decoding,video})
203 Workaround not auto detected encoder bugs.
210 some old lavc generated msmpeg4v3 files (no autodetection)
212 Xvid interlacing bug (autodetected if fourcc==XVIX)
214 (autodetected if fourcc==UMP4)
216 padding bug (autodetected)
220 illegal vlc bug (autodetected per fourcc)
224 old standard qpel (autodetected per fourcc/version)
227 @item direct_blocksize
228 direct-qpel-blocksize bug (autodetected per fourcc/version)
230 edge padding bug (autodetected per fourcc/version)
236 Workaround various bugs in microsoft broken decoders.
241 @item lelim @var{integer} (@emph{encoding,video})
242 Set single coefficient elimination threshold for luminance (negative
243 values also consider DC coefficient).
245 @item celim @var{integer} (@emph{encoding,video})
246 Set single coefficient elimination threshold for chrominance (negative
247 values also consider dc coefficient)
249 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
250 Specify how strictly to follow the standards.
255 strictly conform to an older more strict version of the spec or reference software
257 strictly conform to all the things in the spec no matter what consequences
261 allow unofficial extensions
263 allow non standardized experimental things, experimental
264 (unfinished/work in progress/not well tested) decoders and encoders.
265 Note: experimental decoders can pose a security risk, do not use this for
266 decoding untrusted input.
269 @item b_qoffset @var{float} (@emph{encoding,video})
270 Set QP offset between P and B frames.
272 @item err_detect @var{flags} (@emph{decoding,audio,video})
273 Set error detection flags.
280 detect bitstream specification deviations
282 detect improper bitstream length
284 abort decoding on minor error detection
286 ignore decoding errors, and continue decoding.
287 This is useful if you want to analyze the content of a video and thus want
288 everything to be decoded no matter what. This option will not result in a video
289 that is pleasing to watch in case of errors.
291 consider things that violate the spec and have not been seen in the wild as errors
293 consider all spec non compliancies as errors
295 consider things that a sane encoder should not do as an error
298 @item has_b_frames @var{integer}
300 @item block_align @var{integer}
302 @item mpeg_quant @var{integer} (@emph{encoding,video})
303 Use MPEG quantizers instead of H.263.
305 @item qsquish @var{float} (@emph{encoding,video})
306 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
307 differentiable function).
309 @item rc_qmod_amp @var{float} (@emph{encoding,video})
310 Set experimental quantizer modulation.
312 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
313 Set experimental quantizer modulation.
315 @item rc_override_count @var{integer}
317 @item rc_eq @var{string} (@emph{encoding,video})
318 Set rate control equation. When computing the expression, besides the
319 standard functions defined in the section 'Expression Evaluation', the
320 following functions are available: bits2qp(bits), qp2bits(qp). Also
321 the following constants are available: iTex pTex tex mv fCode iCount
322 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
325 @item maxrate @var{integer} (@emph{encoding,audio,video})
326 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
328 @item minrate @var{integer} (@emph{encoding,audio,video})
329 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
330 encode. It is of little use elsewise.
332 @item bufsize @var{integer} (@emph{encoding,audio,video})
333 Set ratecontrol buffer size (in bits).
335 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
338 @item i_qfactor @var{float} (@emph{encoding,video})
339 Set QP factor between P and I frames.
341 @item i_qoffset @var{float} (@emph{encoding,video})
342 Set QP offset between P and I frames.
344 @item rc_init_cplx @var{float} (@emph{encoding,video})
345 Set initial complexity for 1-pass encoding.
347 @item dct @var{integer} (@emph{encoding,video})
353 autoselect a good one (default)
363 floating point AAN DCT
366 @item lumi_mask @var{float} (@emph{encoding,video})
367 Compress bright areas stronger than medium ones.
369 @item tcplx_mask @var{float} (@emph{encoding,video})
370 Set temporal complexity masking.
372 @item scplx_mask @var{float} (@emph{encoding,video})
373 Set spatial complexity masking.
375 @item p_mask @var{float} (@emph{encoding,video})
378 @item dark_mask @var{float} (@emph{encoding,video})
379 Compress dark areas stronger than medium ones.
381 @item idct @var{integer} (@emph{decoding/encoding,video})
382 Select IDCT implementation.
395 Automatically pick a IDCT compatible with the simple one
418 floating point AAN IDCT
421 @item slice_count @var{integer}
423 @item ec @var{flags} (@emph{decoding,video})
424 Set error concealment strategy.
429 iterative motion vector (MV) search (slow)
431 use strong deblock filter for damaged MBs
433 favor predicting from the previous frame instead of the current
436 @item bits_per_coded_sample @var{integer}
438 @item pred @var{integer} (@emph{encoding,video})
439 Set prediction method.
451 @item aspect @var{rational number} (@emph{encoding,video})
452 Set sample aspect ratio.
454 @item sar @var{rational number} (@emph{encoding,video})
455 Set sample aspect ratio. Alias to @var{aspect}.
457 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
458 Print specific debug info.
471 per-block quantization parameter (QP)
475 display complexity metadata for the upcoming frame, GoP or for a given duration.
484 memory management control operations (H.264)
488 picture buffer allocations
492 skip motion compensation
495 @item cmp @var{integer} (@emph{encoding,video})
496 Set full pel me compare function.
501 sum of absolute differences, fast (default)
503 sum of squared errors
505 sum of absolute Hadamard transformed differences
507 sum of absolute DCT transformed differences
509 sum of squared quantization errors (avoid, low quality)
511 number of bits needed for the block
513 rate distortion optimal, slow
517 sum of absolute vertical differences
519 sum of squared vertical differences
521 noise preserving sum of squared differences
523 5/3 wavelet, only used in snow
525 9/7 wavelet, only used in snow
532 @item subcmp @var{integer} (@emph{encoding,video})
533 Set sub pel me compare function.
538 sum of absolute differences, fast (default)
540 sum of squared errors
542 sum of absolute Hadamard transformed differences
544 sum of absolute DCT transformed differences
546 sum of squared quantization errors (avoid, low quality)
548 number of bits needed for the block
550 rate distortion optimal, slow
554 sum of absolute vertical differences
556 sum of squared vertical differences
558 noise preserving sum of squared differences
560 5/3 wavelet, only used in snow
562 9/7 wavelet, only used in snow
569 @item mbcmp @var{integer} (@emph{encoding,video})
570 Set macroblock compare function.
575 sum of absolute differences, fast (default)
577 sum of squared errors
579 sum of absolute Hadamard transformed differences
581 sum of absolute DCT transformed differences
583 sum of squared quantization errors (avoid, low quality)
585 number of bits needed for the block
587 rate distortion optimal, slow
591 sum of absolute vertical differences
593 sum of squared vertical differences
595 noise preserving sum of squared differences
597 5/3 wavelet, only used in snow
599 9/7 wavelet, only used in snow
606 @item ildctcmp @var{integer} (@emph{encoding,video})
607 Set interlaced dct compare function.
612 sum of absolute differences, fast (default)
614 sum of squared errors
616 sum of absolute Hadamard transformed differences
618 sum of absolute DCT transformed differences
620 sum of squared quantization errors (avoid, low quality)
622 number of bits needed for the block
624 rate distortion optimal, slow
628 sum of absolute vertical differences
630 sum of squared vertical differences
632 noise preserving sum of squared differences
634 5/3 wavelet, only used in snow
636 9/7 wavelet, only used in snow
643 @item dia_size @var{integer} (@emph{encoding,video})
644 Set diamond type & size for motion estimation.
646 @item last_pred @var{integer} (@emph{encoding,video})
647 Set amount of motion predictors from the previous frame.
649 @item preme @var{integer} (@emph{encoding,video})
650 Set pre motion estimation.
652 @item precmp @var{integer} (@emph{encoding,video})
653 Set pre motion estimation compare function.
658 sum of absolute differences, fast (default)
660 sum of squared errors
662 sum of absolute Hadamard transformed differences
664 sum of absolute DCT transformed differences
666 sum of squared quantization errors (avoid, low quality)
668 number of bits needed for the block
670 rate distortion optimal, slow
674 sum of absolute vertical differences
676 sum of squared vertical differences
678 noise preserving sum of squared differences
680 5/3 wavelet, only used in snow
682 9/7 wavelet, only used in snow
689 @item pre_dia_size @var{integer} (@emph{encoding,video})
690 Set diamond type & size for motion estimation pre-pass.
692 @item subq @var{integer} (@emph{encoding,video})
693 Set sub pel motion estimation quality.
695 @item dtg_active_format @var{integer}
697 @item me_range @var{integer} (@emph{encoding,video})
698 Set limit motion vectors range (1023 for DivX player).
700 @item ibias @var{integer} (@emph{encoding,video})
701 Set intra quant bias.
703 @item pbias @var{integer} (@emph{encoding,video})
704 Set inter quant bias.
706 @item color_table_id @var{integer}
708 @item global_quality @var{integer} (@emph{encoding,audio,video})
710 @item coder @var{integer} (@emph{encoding,video})
715 variable length coder / huffman coder
726 @item context @var{integer} (@emph{encoding,video})
729 @item slice_flags @var{integer}
731 @item mbd @var{integer} (@emph{encoding,video})
732 Set macroblock decision algorithm (high quality mode).
741 use best rate distortion
744 @item stream_codec_tag @var{integer}
746 @item sc_threshold @var{integer} (@emph{encoding,video})
747 Set scene change threshold.
749 @item lmin @var{integer} (@emph{encoding,video})
750 Set min lagrange factor (VBR).
752 @item lmax @var{integer} (@emph{encoding,video})
753 Set max lagrange factor (VBR).
755 @item nr @var{integer} (@emph{encoding,video})
758 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
759 Set number of bits which should be loaded into the rc buffer before
762 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
767 Allow non spec compliant speedup tricks.
769 Deprecated, use mpegvideo private options instead.
771 Skip bitstream encoding.
773 Ignore cropping information from sps.
775 Place global headers at every keyframe instead of in extradata.
777 Frame data might be split into multiple chunks.
779 Show all frames before the first keyframe.
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 mv0_threshold @var{integer} (@emph{encoding,video})
990 @item b_sensitivity @var{integer} (@emph{encoding,video})
991 Adjust sensitivity of b_frame_strategy 1.
993 @item compression_level @var{integer} (@emph{encoding,audio,video})
994 @item min_prediction_order @var{integer} (@emph{encoding,audio})
995 @item max_prediction_order @var{integer} (@emph{encoding,audio})
996 @item timecode_frame_start @var{integer} (@emph{encoding,video})
997 Set GOP timecode frame start number, in non drop frame format.
999 @item request_channels @var{integer} (@emph{decoding,audio})
1000 Set desired number of audio channels.
1002 @item bits_per_raw_sample @var{integer}
1003 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1008 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1013 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1014 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1015 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1017 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1045 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1090 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1117 @item color_range @var{integer} (@emph{decoding/encoding,video})
1118 If used as input parameter, it serves as a hint to the decoder, which
1119 color_range the input has.
1130 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1147 @item log_level_offset @var{integer}
1148 Set the log level offset.
1150 @item slices @var{integer} (@emph{encoding,video})
1151 Number of slices, used in parallelized encoding.
1153 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1154 Select which multithreading methods to use.
1156 Use of @samp{frame} will increase decoding delay by one frame per
1157 thread, so clients which cannot provide future frames should not use
1163 Decode more than one part of a single frame at once.
1165 Multithreading using slices works only when the video was encoded with
1169 Decode more than one frame at once.
1172 Default value is @samp{slice+frame}.
1174 @item audio_service_type @var{integer} (@emph{encoding,audio})
1175 Set audio service type.
1199 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1200 Set sample format audio decoders should prefer. Default value is
1203 @item pkt_timebase @var{rational number}
1205 @item sub_charenc @var{encoding} (@emph{decoding,subtitles})
1206 Set the input subtitles character encoding.
1208 @item field_order @var{field_order} (@emph{video})
1209 Set/override the field order of the video.
1215 Interlaced video, top field coded and displayed first
1217 Interlaced video, bottom field coded and displayed first
1219 Interlaced video, top coded first, bottom displayed first
1221 Interlaced video, bottom coded first, top displayed first
1224 @item skip_alpha @var{bool} (@emph{decoding,video})
1225 Set to 1 to disable processing alpha (transparency). This works like the
1226 @samp{gray} flag in the @option{flags} option which skips chroma information
1227 instead of alpha. Default is 0.
1229 @item codec_whitelist @var{list} (@emph{input})
1230 "," separated list of allowed decoders. By default all are allowed.
1232 @item dump_separator @var{string} (@emph{input})
1233 Separator used to separate the fields printed on the command line about the
1235 For example, to separate the fields with newlines and indentation:
1237 ffprobe -dump_separator "
1238 " -i ~/videos/matrixbench_mpeg2.mpg
1241 @item max_pixels @var{integer} (@emph{decoding/encoding,video})
1242 Maximum number of pixels per image. This value can be used to avoid out of
1243 memory failures due to large images.
1245 @item apply_cropping @var{bool} (@emph{decoding,video})
1246 Enable cropping if cropping parameters are multiples of the required
1247 alignment for the left and top parameters. If the alignment is not met the
1248 cropping will be partially applied to maintain alignment.
1249 Default is 1 (enabled).
1250 Note: The required alignment depends on if @code{AV_CODEC_FLAG_UNALIGNED} is set and the
1251 CPU. @code{AV_CODEC_FLAG_UNALIGNED} cannot be changed from the command line. Also hardware
1252 decoders will not apply left/top Cropping.
1257 @c man end CODEC OPTIONS
1259 @ifclear config-writeonly
1260 @include decoders.texi
1262 @ifclear config-readonly
1263 @include encoders.texi