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 unsensical 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 Use only bitexact stuff (except (I)DCT).
76 Apply H263 advanced intra coding / mpeg4 ac prediction.
78 Deprecated, use mpegvideo private options instead.
80 Deprecated, use mpegvideo private options instead.
82 Apply interlaced motion estimation.
87 @item me_method @var{integer} (@emph{encoding,video})
88 Set motion estimation method.
93 zero motion estimation (fastest)
95 full motion estimation (slowest)
97 EPZS motion estimation (default)
99 esa motion estimation (alias for full)
101 tesa motion estimation
103 dia motion estimation (alias for epzs)
105 log motion estimation
107 phods motion estimation
111 hex motion estimation
113 umh motion estimation
115 iter motion estimation
118 @item extradata_size @var{integer}
121 @item time_base @var{rational number}
124 It is the fundamental unit of time (in seconds) in terms of which
125 frame timestamps are represented. For fixed-fps content, timebase
126 should be @code{1 / frame_rate} and timestamp increments should be
129 @item g @var{integer} (@emph{encoding,video})
130 Set the group of picture size. Default value is 12.
132 @item ar @var{integer} (@emph{decoding/encoding,audio})
133 Set audio sampling rate (in Hz).
135 @item ac @var{integer} (@emph{decoding/encoding,audio})
136 Set number of audio channels.
138 @item cutoff @var{integer} (@emph{encoding,audio})
139 Set cutoff bandwidth.
141 @item frame_size @var{integer} (@emph{encoding,audio})
142 Set audio frame size.
144 Each submitted frame except the last must contain exactly frame_size
145 samples per channel. May be 0 when the codec has
146 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
147 restricted. It is set by some decoders to indicate constant frame
150 @item frame_number @var{integer}
151 Set the frame number.
153 @item delay @var{integer}
155 @item qcomp @var{float} (@emph{encoding,video})
156 Set video quantizer scale compression (VBR). It is used as a constant
157 in the ratecontrol equation. Recommended range for default rc_eq:
160 @item qblur @var{float} (@emph{encoding,video})
161 Set video quantizer scale blur (VBR).
163 @item qmin @var{integer} (@emph{encoding,video})
164 Set min video quantizer scale (VBR). Must be included between -1 and
165 69, default value is 2.
167 @item qmax @var{integer} (@emph{encoding,video})
168 Set max video quantizer scale (VBR). Must be included between -1 and
169 1024, default value is 31.
171 @item qdiff @var{integer} (@emph{encoding,video})
172 Set max difference between the quantizer scale (VBR).
174 @item bf @var{integer} (@emph{encoding,video})
175 Set max number of B frames between non-B-frames.
177 Must be an integer between -1 and 16. 0 means that B-frames are
178 disabled. If a value of -1 is used, it will choose an automatic value
179 depending on the encoder.
183 @item b_qfactor @var{float} (@emph{encoding,video})
184 Set qp factor between P and B frames.
186 @item rc_strategy @var{integer} (@emph{encoding,video})
187 Set ratecontrol method.
189 @item b_strategy @var{integer} (@emph{encoding,video})
190 Set strategy to choose between I/P/B-frames.
192 @item ps @var{integer} (@emph{encoding,video})
193 Set RTP payload size in bytes.
195 @item mv_bits @var{integer}
196 @item header_bits @var{integer}
197 @item i_tex_bits @var{integer}
198 @item p_tex_bits @var{integer}
199 @item i_count @var{integer}
200 @item p_count @var{integer}
201 @item skip_count @var{integer}
202 @item misc_bits @var{integer}
203 @item frame_bits @var{integer}
204 @item codec_tag @var{integer}
205 @item bug @var{flags} (@emph{decoding,video})
206 Workaround not auto detected encoder bugs.
213 some old lavc generated msmpeg4v3 files (no autodetection)
215 Xvid interlacing bug (autodetected if fourcc==XVIX)
217 (autodetected if fourcc==UMP4)
219 padding bug (autodetected)
223 illegal vlc bug (autodetected per fourcc)
227 old standard qpel (autodetected per fourcc/version)
230 @item direct_blocksize
231 direct-qpel-blocksize bug (autodetected per fourcc/version)
233 edge padding bug (autodetected per fourcc/version)
239 Workaround various bugs in microsoft broken decoders.
244 @item lelim @var{integer} (@emph{encoding,video})
245 Set single coefficient elimination threshold for luminance (negative
246 values also consider DC coefficient).
248 @item celim @var{integer} (@emph{encoding,video})
249 Set single coefficient elimination threshold for chrominance (negative
250 values also consider dc coefficient)
252 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
253 Specify how strictly to follow the standards.
258 strictly conform to a older more strict version of the spec or reference software
260 strictly conform to all the things in the spec no matter what consequences
264 allow unofficial extensions
266 allow non standardized experimental things, experimental
267 (unfinished/work in progress/not well tested) decoders and encoders.
268 Note: experimental decoders can pose a security risk, do not use this for
269 decoding untrusted input.
272 @item b_qoffset @var{float} (@emph{encoding,video})
273 Set QP offset between P and B frames.
275 @item err_detect @var{flags} (@emph{decoding,audio,video})
276 Set error detection flags.
283 detect bitstream specification deviations
285 detect improper bitstream length
287 abort decoding on minor error detection
289 ignore decoding errors, and continue decoding.
290 This is useful if you want to analyze the content of a video and thus want
291 everything to be decoded no matter what. This option will not result in a video
292 that is pleasing to watch in case of errors.
294 consider things that violate the spec and have not been seen in the wild as errors
296 consider all spec non compliancies as errors
298 consider things that a sane encoder should not do as an error
301 @item has_b_frames @var{integer}
303 @item block_align @var{integer}
305 @item mpeg_quant @var{integer} (@emph{encoding,video})
306 Use MPEG quantizers instead of H.263.
308 @item qsquish @var{float} (@emph{encoding,video})
309 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
310 differentiable function).
312 @item rc_qmod_amp @var{float} (@emph{encoding,video})
313 Set experimental quantizer modulation.
315 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
316 Set experimental quantizer modulation.
318 @item rc_override_count @var{integer}
320 @item rc_eq @var{string} (@emph{encoding,video})
321 Set rate control equation. When computing the expression, besides the
322 standard functions defined in the section 'Expression Evaluation', the
323 following functions are available: bits2qp(bits), qp2bits(qp). Also
324 the following constants are available: iTex pTex tex mv fCode iCount
325 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
328 @item maxrate @var{integer} (@emph{encoding,audio,video})
329 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
331 @item minrate @var{integer} (@emph{encoding,audio,video})
332 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
333 encode. It is of little use elsewise.
335 @item bufsize @var{integer} (@emph{encoding,audio,video})
336 Set ratecontrol buffer size (in bits).
338 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
341 @item i_qfactor @var{float} (@emph{encoding,video})
342 Set QP factor between P and I frames.
344 @item i_qoffset @var{float} (@emph{encoding,video})
345 Set QP offset between P and I frames.
347 @item rc_init_cplx @var{float} (@emph{encoding,video})
348 Set initial complexity for 1-pass encoding.
350 @item dct @var{integer} (@emph{encoding,video})
356 autoselect a good one (default)
366 floating point AAN DCT
369 @item lumi_mask @var{float} (@emph{encoding,video})
370 Compress bright areas stronger than medium ones.
372 @item tcplx_mask @var{float} (@emph{encoding,video})
373 Set temporal complexity masking.
375 @item scplx_mask @var{float} (@emph{encoding,video})
376 Set spatial complexity masking.
378 @item p_mask @var{float} (@emph{encoding,video})
381 @item dark_mask @var{float} (@emph{encoding,video})
382 Compress dark areas stronger than medium ones.
384 @item idct @var{integer} (@emph{decoding/encoding,video})
385 Select IDCT implementation.
398 Automatically pick a IDCT compatible with the simple one
421 floating point AAN IDCT
424 @item slice_count @var{integer}
426 @item ec @var{flags} (@emph{decoding,video})
427 Set error concealment strategy.
432 iterative motion vector (MV) search (slow)
434 use strong deblock filter for damaged MBs
436 favor predicting from the previous frame instead of the current
439 @item bits_per_coded_sample @var{integer}
441 @item pred @var{integer} (@emph{encoding,video})
442 Set prediction method.
454 @item aspect @var{rational number} (@emph{encoding,video})
455 Set sample aspect ratio.
457 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
458 Print specific debug info.
471 per-block quantization parameter (QP)
485 memory management control operations (H.264)
489 visualize quantization parameter (QP), lower QP are tinted greener
491 visualize block types
493 picture buffer allocations
498 @item vismv @var{integer} (@emph{decoding,video})
499 Visualize motion vectors (MVs).
504 forward predicted MVs of P-frames
506 forward predicted MVs of B-frames
508 backward predicted MVs of B-frames
511 @item cmp @var{integer} (@emph{encoding,video})
512 Set full pel me compare function.
517 sum of absolute differences, fast (default)
519 sum of squared errors
521 sum of absolute Hadamard transformed differences
523 sum of absolute DCT transformed differences
525 sum of squared quantization errors (avoid, low quality)
527 number of bits needed for the block
529 rate distortion optimal, slow
533 sum of absolute vertical differences
535 sum of squared vertical differences
537 noise preserving sum of squared differences
539 5/3 wavelet, only used in snow
541 9/7 wavelet, only used in snow
548 @item subcmp @var{integer} (@emph{encoding,video})
549 Set sub pel me compare function.
554 sum of absolute differences, fast (default)
556 sum of squared errors
558 sum of absolute Hadamard transformed differences
560 sum of absolute DCT transformed differences
562 sum of squared quantization errors (avoid, low quality)
564 number of bits needed for the block
566 rate distortion optimal, slow
570 sum of absolute vertical differences
572 sum of squared vertical differences
574 noise preserving sum of squared differences
576 5/3 wavelet, only used in snow
578 9/7 wavelet, only used in snow
585 @item mbcmp @var{integer} (@emph{encoding,video})
586 Set macroblock compare function.
591 sum of absolute differences, fast (default)
593 sum of squared errors
595 sum of absolute Hadamard transformed differences
597 sum of absolute DCT transformed differences
599 sum of squared quantization errors (avoid, low quality)
601 number of bits needed for the block
603 rate distortion optimal, slow
607 sum of absolute vertical differences
609 sum of squared vertical differences
611 noise preserving sum of squared differences
613 5/3 wavelet, only used in snow
615 9/7 wavelet, only used in snow
622 @item ildctcmp @var{integer} (@emph{encoding,video})
623 Set interlaced dct compare function.
628 sum of absolute differences, fast (default)
630 sum of squared errors
632 sum of absolute Hadamard transformed differences
634 sum of absolute DCT transformed differences
636 sum of squared quantization errors (avoid, low quality)
638 number of bits needed for the block
640 rate distortion optimal, slow
644 sum of absolute vertical differences
646 sum of squared vertical differences
648 noise preserving sum of squared differences
650 5/3 wavelet, only used in snow
652 9/7 wavelet, only used in snow
659 @item dia_size @var{integer} (@emph{encoding,video})
660 Set diamond type & size for motion estimation.
662 @item last_pred @var{integer} (@emph{encoding,video})
663 Set amount of motion predictors from the previous frame.
665 @item preme @var{integer} (@emph{encoding,video})
666 Set pre motion estimation.
668 @item precmp @var{integer} (@emph{encoding,video})
669 Set pre motion estimation compare function.
674 sum of absolute differences, fast (default)
676 sum of squared errors
678 sum of absolute Hadamard transformed differences
680 sum of absolute DCT transformed differences
682 sum of squared quantization errors (avoid, low quality)
684 number of bits needed for the block
686 rate distortion optimal, slow
690 sum of absolute vertical differences
692 sum of squared vertical differences
694 noise preserving sum of squared differences
696 5/3 wavelet, only used in snow
698 9/7 wavelet, only used in snow
705 @item pre_dia_size @var{integer} (@emph{encoding,video})
706 Set diamond type & size for motion estimation pre-pass.
708 @item subq @var{integer} (@emph{encoding,video})
709 Set sub pel motion estimation quality.
711 @item dtg_active_format @var{integer}
713 @item me_range @var{integer} (@emph{encoding,video})
714 Set limit motion vectors range (1023 for DivX player).
716 @item ibias @var{integer} (@emph{encoding,video})
717 Set intra quant bias.
719 @item pbias @var{integer} (@emph{encoding,video})
720 Set inter quant bias.
722 @item color_table_id @var{integer}
724 @item global_quality @var{integer} (@emph{encoding,audio,video})
726 @item coder @var{integer} (@emph{encoding,video})
731 variable length coder / huffman coder
742 @item context @var{integer} (@emph{encoding,video})
745 @item slice_flags @var{integer}
747 @item xvmc_acceleration @var{integer}
749 @item mbd @var{integer} (@emph{encoding,video})
750 Set macroblock decision algorithm (high quality mode).
759 use best rate distortion
762 @item stream_codec_tag @var{integer}
764 @item sc_threshold @var{integer} (@emph{encoding,video})
765 Set scene change threshold.
767 @item lmin @var{integer} (@emph{encoding,video})
768 Set min lagrange factor (VBR).
770 @item lmax @var{integer} (@emph{encoding,video})
771 Set max lagrange factor (VBR).
773 @item nr @var{integer} (@emph{encoding,video})
776 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
777 Set number of bits which should be loaded into the rc buffer before
780 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
785 Allow non spec compliant speedup tricks.
787 Deprecated, use mpegvideo private options instead.
789 Skip bitstream encoding.
791 Ignore cropping information from sps.
793 Place global headers at every keyframe instead of in extradata.
795 Frame data might be split into multiple chunks.
797 Show all frames before the first keyframe.
799 Deprecated, use mpegvideo private options instead.
802 @item error @var{integer} (@emph{encoding,video})
804 @item qns @var{integer} (@emph{encoding,video})
805 Deprecated, use mpegvideo private options instead.
807 @item threads @var{integer} (@emph{decoding/encoding,video})
812 detect a good number of threads
815 @item me_threshold @var{integer} (@emph{encoding,video})
816 Set motion estimation threshold.
818 @item mb_threshold @var{integer} (@emph{encoding,video})
819 Set macroblock threshold.
821 @item dc @var{integer} (@emph{encoding,video})
822 Set intra_dc_precision.
824 @item nssew @var{integer} (@emph{encoding,video})
827 @item skip_top @var{integer} (@emph{decoding,video})
828 Set number of macroblock rows at the top which are skipped.
830 @item skip_bottom @var{integer} (@emph{decoding,video})
831 Set number of macroblock rows at the bottom which are skipped.
833 @item profile @var{integer} (@emph{encoding,audio,video})
871 @item level @var{integer} (@emph{encoding,audio,video})
879 @item lowres @var{integer} (@emph{decoding,audio,video})
880 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
882 @item skip_threshold @var{integer} (@emph{encoding,video})
883 Set frame skip threshold.
885 @item skip_factor @var{integer} (@emph{encoding,video})
886 Set frame skip factor.
888 @item skip_exp @var{integer} (@emph{encoding,video})
889 Set frame skip exponent.
890 Negative values behave identical to the corresponding positive ones, except
891 that the score is normalized.
892 Positive values exist primarily for compatibility reasons and are not so useful.
894 @item skipcmp @var{integer} (@emph{encoding,video})
895 Set frame skip compare function.
900 sum of absolute differences, fast (default)
902 sum of squared errors
904 sum of absolute Hadamard transformed differences
906 sum of absolute DCT transformed differences
908 sum of squared quantization errors (avoid, low quality)
910 number of bits needed for the block
912 rate distortion optimal, slow
916 sum of absolute vertical differences
918 sum of squared vertical differences
920 noise preserving sum of squared differences
922 5/3 wavelet, only used in snow
924 9/7 wavelet, only used in snow
931 @item border_mask @var{float} (@emph{encoding,video})
932 Increase the quantizer for macroblocks close to borders.
934 @item mblmin @var{integer} (@emph{encoding,video})
935 Set min macroblock lagrange factor (VBR).
937 @item mblmax @var{integer} (@emph{encoding,video})
938 Set max macroblock lagrange factor (VBR).
940 @item mepc @var{integer} (@emph{encoding,video})
941 Set motion estimation bitrate penalty compensation (1.0 = 256).
943 @item skip_loop_filter @var{integer} (@emph{decoding,video})
944 @item skip_idct @var{integer} (@emph{decoding,video})
945 @item skip_frame @var{integer} (@emph{decoding,video})
947 Make decoder discard processing depending on the frame type selected
950 @option{skip_loop_filter} skips frame loop filtering, @option{skip_idct}
951 skips frame IDCT/dequantization, @option{skip_frame} skips decoding.
959 Discard useless frames like 0-sized frames.
962 Discard all non-reference frames.
965 Discard all bidirectional frames.
968 Discard all frames excepts keyframes.
974 Default value is @samp{default}.
976 @item bidir_refine @var{integer} (@emph{encoding,video})
977 Refine the two motion vectors used in bidirectional macroblocks.
979 @item brd_scale @var{integer} (@emph{encoding,video})
980 Downscale frames for dynamic B-frame decision.
982 @item keyint_min @var{integer} (@emph{encoding,video})
983 Set minimum interval between IDR-frames.
985 @item refs @var{integer} (@emph{encoding,video})
986 Set reference frames to consider for motion compensation.
988 @item chromaoffset @var{integer} (@emph{encoding,video})
989 Set chroma qp offset from luma.
991 @item trellis @var{integer} (@emph{encoding,audio,video})
992 Set rate-distortion optimal quantization.
994 @item sc_factor @var{integer} (@emph{encoding,video})
995 Set value multiplied by qscale for each frame and added to
998 @item mv0_threshold @var{integer} (@emph{encoding,video})
999 @item b_sensitivity @var{integer} (@emph{encoding,video})
1000 Adjust sensitivity of b_frame_strategy 1.
1002 @item compression_level @var{integer} (@emph{encoding,audio,video})
1003 @item min_prediction_order @var{integer} (@emph{encoding,audio})
1004 @item max_prediction_order @var{integer} (@emph{encoding,audio})
1005 @item timecode_frame_start @var{integer} (@emph{encoding,video})
1006 Set GOP timecode frame start number, in non drop frame format.
1008 @item request_channels @var{integer} (@emph{decoding,audio})
1009 Set desired number of audio channels.
1011 @item bits_per_raw_sample @var{integer}
1012 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1017 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1022 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1023 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1024 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1025 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1026 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1027 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1028 @item color_range @var{integer} (@emph{decoding/encoding,video})
1029 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1031 @item log_level_offset @var{integer}
1032 Set the log level offset.
1034 @item slices @var{integer} (@emph{encoding,video})
1035 Number of slices, used in parallelized encoding.
1037 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1038 Select multithreading type.
1047 @item audio_service_type @var{integer} (@emph{encoding,audio})
1048 Set audio service type.
1072 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1073 Set sample format audio decoders should prefer. Default value is
1076 @item pkt_timebase @var{rational number}
1078 @item sub_charenc @var{encoding} (@emph{decoding,subtitles})
1079 Set the input subtitles character encoding.
1081 @item field_order @var{field_order} (@emph{video})
1082 Set/override the field order of the video.
1088 Interlaced video, top field coded and displayed first
1090 Interlaced video, bottom field coded and displayed first
1092 Interlaced video, top coded first, bottom displayed first
1094 Interlaced video, bottom coded first, top displayed first
1097 @item skip_alpha @var{integer} (@emph{decoding,video})
1098 Set to 1 to disable processing alpha (transparency). This works like the
1099 @samp{gray} flag in the @option{flags} option which skips chroma information
1100 instead of alpha. Default is 0.
1103 @c man end CODEC OPTIONS
1105 @ifclear config-writeonly
1106 @include decoders.texi
1108 @ifclear config-readonly
1109 @include encoders.texi