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 sub_id @var{integer}
88 Deprecated, currently unused.
90 @item me_method @var{integer} (@emph{encoding,video})
91 Set motion estimation method.
96 zero motion estimation (fastest)
98 full motion estimation (slowest)
100 EPZS motion estimation (default)
102 esa motion estimation (alias for full)
104 tesa motion estimation
106 dia motion estimation (alias for epzs)
108 log motion estimation
110 phods motion estimation
114 hex motion estimation
116 umh motion estimation
118 iter motion estimation
121 @item extradata_size @var{integer}
124 @item time_base @var{rational number}
127 It is the fundamental unit of time (in seconds) in terms of which
128 frame timestamps are represented. For fixed-fps content, timebase
129 should be @code{1 / frame_rate} and timestamp increments should be
132 @item g @var{integer} (@emph{encoding,video})
133 Set the group of picture size. Default value is 12.
135 @item ar @var{integer} (@emph{decoding/encoding,audio})
136 Set audio sampling rate (in Hz).
138 @item ac @var{integer} (@emph{decoding/encoding,audio})
139 Set number of audio channels.
141 @item cutoff @var{integer} (@emph{encoding,audio})
142 Set cutoff bandwidth.
144 @item frame_size @var{integer} (@emph{encoding,audio})
145 Set audio frame size.
147 Each submitted frame except the last must contain exactly frame_size
148 samples per channel. May be 0 when the codec has
149 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
150 restricted. It is set by some decoders to indicate constant frame
153 @item frame_number @var{integer}
154 Set the frame number.
156 @item delay @var{integer}
158 @item qcomp @var{float} (@emph{encoding,video})
159 Set video quantizer scale compression (VBR). It is used as a constant
160 in the ratecontrol equation. Recommended range for default rc_eq:
163 @item qblur @var{float} (@emph{encoding,video})
164 Set video quantizer scale blur (VBR).
166 @item qmin @var{integer} (@emph{encoding,video})
167 Set min video quantizer scale (VBR). Must be included between -1 and
168 69, default value is 2.
170 @item qmax @var{integer} (@emph{encoding,video})
171 Set max video quantizer scale (VBR). Must be included between -1 and
172 1024, default value is 31.
174 @item qdiff @var{integer} (@emph{encoding,video})
175 Set max difference between the quantizer scale (VBR).
177 @item bf @var{integer} (@emph{encoding,video})
178 Set max number of B frames.
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 a 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 consider things that violate the spec and have not been seen in the wild as errors
288 consider all spec non compliancies as errors
290 consider things that a sane encoder should not do as an error
293 @item has_b_frames @var{integer}
295 @item block_align @var{integer}
297 @item mpeg_quant @var{integer} (@emph{encoding,video})
298 Use MPEG quantizers instead of H.263.
300 @item qsquish @var{float} (@emph{encoding,video})
301 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
302 differentiable function).
304 @item rc_qmod_amp @var{float} (@emph{encoding,video})
305 Set experimental quantizer modulation.
307 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
308 Set experimental quantizer modulation.
310 @item rc_override_count @var{integer}
312 @item rc_eq @var{string} (@emph{encoding,video})
313 Set rate control equation. When computing the expression, besides the
314 standard functions defined in the section 'Expression Evaluation', the
315 following functions are available: bits2qp(bits), qp2bits(qp). Also
316 the following constants are available: iTex pTex tex mv fCode iCount
317 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
320 @item maxrate @var{integer} (@emph{encoding,audio,video})
321 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
323 @item minrate @var{integer} (@emph{encoding,audio,video})
324 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
325 encode. It is of little use elsewise.
327 @item bufsize @var{integer} (@emph{encoding,audio,video})
328 Set ratecontrol buffer size (in bits).
330 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
333 @item i_qfactor @var{float} (@emph{encoding,video})
334 Set QP factor between P and I frames.
336 @item i_qoffset @var{float} (@emph{encoding,video})
337 Set QP offset between P and I frames.
339 @item rc_init_cplx @var{float} (@emph{encoding,video})
340 Set initial complexity for 1-pass encoding.
342 @item dct @var{integer} (@emph{encoding,video})
348 autoselect a good one (default)
358 floating point AAN DCT
361 @item lumi_mask @var{float} (@emph{encoding,video})
362 Compress bright areas stronger than medium ones.
364 @item tcplx_mask @var{float} (@emph{encoding,video})
365 Set temporal complexity masking.
367 @item scplx_mask @var{float} (@emph{encoding,video})
368 Set spatial complexity masking.
370 @item p_mask @var{float} (@emph{encoding,video})
373 @item dark_mask @var{float} (@emph{encoding,video})
374 Compress dark areas stronger than medium ones.
376 @item idct @var{integer} (@emph{decoding/encoding,video})
377 Select IDCT implementation.
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
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 debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
453 Print specific debug info.
466 per-block quantization parameter (QP)
480 memory management control operations (H.264)
484 visualize quantization parameter (QP), lower QP are tinted greener
486 visualize block types
488 picture buffer allocations
493 @item vismv @var{integer} (@emph{decoding,video})
494 Visualize motion vectors (MVs).
499 forward predicted MVs of P-frames
501 forward predicted MVs of B-frames
503 backward predicted MVs of B-frames
506 @item cmp @var{integer} (@emph{encoding,video})
507 Set full pel me compare function.
512 sum of absolute differences, fast (default)
514 sum of squared errors
516 sum of absolute Hadamard transformed differences
518 sum of absolute DCT transformed differences
520 sum of squared quantization errors (avoid, low quality)
522 number of bits needed for the block
524 rate distortion optimal, slow
528 sum of absolute vertical differences
530 sum of squared vertical differences
532 noise preserving sum of squared differences
534 5/3 wavelet, only used in snow
536 9/7 wavelet, only used in snow
543 @item subcmp @var{integer} (@emph{encoding,video})
544 Set sub pel me compare function.
549 sum of absolute differences, fast (default)
551 sum of squared errors
553 sum of absolute Hadamard transformed differences
555 sum of absolute DCT transformed differences
557 sum of squared quantization errors (avoid, low quality)
559 number of bits needed for the block
561 rate distortion optimal, slow
565 sum of absolute vertical differences
567 sum of squared vertical differences
569 noise preserving sum of squared differences
571 5/3 wavelet, only used in snow
573 9/7 wavelet, only used in snow
580 @item mbcmp @var{integer} (@emph{encoding,video})
581 Set macroblock compare function.
586 sum of absolute differences, fast (default)
588 sum of squared errors
590 sum of absolute Hadamard transformed differences
592 sum of absolute DCT transformed differences
594 sum of squared quantization errors (avoid, low quality)
596 number of bits needed for the block
598 rate distortion optimal, slow
602 sum of absolute vertical differences
604 sum of squared vertical differences
606 noise preserving sum of squared differences
608 5/3 wavelet, only used in snow
610 9/7 wavelet, only used in snow
617 @item ildctcmp @var{integer} (@emph{encoding,video})
618 Set interlaced dct compare function.
623 sum of absolute differences, fast (default)
625 sum of squared errors
627 sum of absolute Hadamard transformed differences
629 sum of absolute DCT transformed differences
631 sum of squared quantization errors (avoid, low quality)
633 number of bits needed for the block
635 rate distortion optimal, slow
639 sum of absolute vertical differences
641 sum of squared vertical differences
643 noise preserving sum of squared differences
645 5/3 wavelet, only used in snow
647 9/7 wavelet, only used in snow
654 @item dia_size @var{integer} (@emph{encoding,video})
655 Set diamond type & size for motion estimation.
657 @item last_pred @var{integer} (@emph{encoding,video})
658 Set amount of motion predictors from the previous frame.
660 @item preme @var{integer} (@emph{encoding,video})
661 Set pre motion estimation.
663 @item precmp @var{integer} (@emph{encoding,video})
664 Set pre motion estimation compare function.
669 sum of absolute differences, fast (default)
671 sum of squared errors
673 sum of absolute Hadamard transformed differences
675 sum of absolute DCT transformed differences
677 sum of squared quantization errors (avoid, low quality)
679 number of bits needed for the block
681 rate distortion optimal, slow
685 sum of absolute vertical differences
687 sum of squared vertical differences
689 noise preserving sum of squared differences
691 5/3 wavelet, only used in snow
693 9/7 wavelet, only used in snow
700 @item pre_dia_size @var{integer} (@emph{encoding,video})
701 Set diamond type & size for motion estimation pre-pass.
703 @item subq @var{integer} (@emph{encoding,video})
704 Set sub pel motion estimation quality.
706 @item dtg_active_format @var{integer}
708 @item me_range @var{integer} (@emph{encoding,video})
709 Set limit motion vectors range (1023 for DivX player).
711 @item ibias @var{integer} (@emph{encoding,video})
712 Set intra quant bias.
714 @item pbias @var{integer} (@emph{encoding,video})
715 Set inter quant bias.
717 @item color_table_id @var{integer}
719 @item global_quality @var{integer} (@emph{encoding,audio,video})
721 @item coder @var{integer} (@emph{encoding,video})
726 variable length coder / huffman coder
737 @item context @var{integer} (@emph{encoding,video})
740 @item slice_flags @var{integer}
742 @item xvmc_acceleration @var{integer}
744 @item mbd @var{integer} (@emph{encoding,video})
745 Set macroblock decision algorithm (high quality mode).
754 use best rate distortion
757 @item stream_codec_tag @var{integer}
759 @item sc_threshold @var{integer} (@emph{encoding,video})
760 Set scene change threshold.
762 @item lmin @var{integer} (@emph{encoding,video})
763 Set min lagrange factor (VBR).
765 @item lmax @var{integer} (@emph{encoding,video})
766 Set max lagrange factor (VBR).
768 @item nr @var{integer} (@emph{encoding,video})
771 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
772 Set number of bits which should be loaded into the rc buffer before
775 @item inter_threshold @var{integer} (@emph{encoding,video})
777 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
782 allow non spec compliant speedup tricks
784 Deprecated, use mpegvideo private options instead
786 skip bitstream encoding
788 place global headers at every keyframe instead of in extradata
790 Frame data might be split into multiple chunks
792 Show all frames before the first keyframe
794 Deprecated, use mpegvideo private options instead
797 @item error @var{integer} (@emph{encoding,video})
799 @item qns @var{integer} (@emph{encoding,video})
800 Deprecated, use mpegvideo private options instead.
802 @item threads @var{integer} (@emph{decoding/encoding,video})
807 detect a good number of threads
810 @item me_threshold @var{integer} (@emph{encoding,video})
811 Set motion estimation threshold.
813 @item mb_threshold @var{integer} (@emph{encoding,video})
814 Set macroblock threshold.
816 @item dc @var{integer} (@emph{encoding,video})
817 Set intra_dc_precision.
819 @item nssew @var{integer} (@emph{encoding,video})
822 @item skip_top @var{integer} (@emph{decoding,video})
823 Set number of macroblock rows at the top which are skipped.
825 @item skip_bottom @var{integer} (@emph{decoding,video})
826 Set number of macroblock rows at the bottom which are skipped.
828 @item profile @var{integer} (@emph{encoding,audio,video})
862 @item level @var{integer} (@emph{encoding,audio,video})
870 @item lowres @var{integer} (@emph{decoding,audio,video})
871 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
873 @item skip_threshold @var{integer} (@emph{encoding,video})
874 Set frame skip threshold.
876 @item skip_factor @var{integer} (@emph{encoding,video})
877 Set frame skip factor.
879 @item skip_exp @var{integer} (@emph{encoding,video})
880 Set frame skip exponent.
882 @item skipcmp @var{integer} (@emph{encoding,video})
883 Set frame skip compare function.
888 sum of absolute differences, fast (default)
890 sum of squared errors
892 sum of absolute Hadamard transformed differences
894 sum of absolute DCT transformed differences
896 sum of squared quantization errors (avoid, low quality)
898 number of bits needed for the block
900 rate distortion optimal, slow
904 sum of absolute vertical differences
906 sum of squared vertical differences
908 noise preserving sum of squared differences
910 5/3 wavelet, only used in snow
912 9/7 wavelet, only used in snow
919 @item border_mask @var{float} (@emph{encoding,video})
920 Increase the quantizer for macroblocks close to borders.
922 @item mblmin @var{integer} (@emph{encoding,video})
923 Set min macroblock lagrange factor (VBR).
925 @item mblmax @var{integer} (@emph{encoding,video})
926 Set max macroblock lagrange factor (VBR).
928 @item mepc @var{integer} (@emph{encoding,video})
929 Set motion estimation bitrate penalty compensation (1.0 = 256).
931 @item skip_loop_filter @var{integer} (@emph{decoding,video})
932 @item skip_idct @var{integer} (@emph{decoding,video})
933 @item skip_frame @var{integer} (@emph{decoding,video})
935 Make decoder discard processing depending on the frame type selected
938 @option{skip_loop_filter} skips frame loop filtering, @option{skip_idct}
939 skips frame IDCT/dequantization, @option{skip_frame} skips decoding.
947 Discard useless frames like 0-sized frames.
950 Discard all non-reference frames.
953 Discard all bidirectional frames.
956 Discard all frames excepts keyframes.
962 Default value is @samp{default}.
964 @item bidir_refine @var{integer} (@emph{encoding,video})
965 Refine the two motion vectors used in bidirectional macroblocks.
967 @item brd_scale @var{integer} (@emph{encoding,video})
968 Downscale frames for dynamic B-frame decision.
970 @item keyint_min @var{integer} (@emph{encoding,video})
971 Set minimum interval between IDR-frames.
973 @item refs @var{integer} (@emph{encoding,video})
974 Set reference frames to consider for motion compensation.
976 @item chromaoffset @var{integer} (@emph{encoding,video})
977 Set chroma qp offset from luma.
979 @item trellis @var{integer} (@emph{encoding,audio,video})
980 Set rate-distortion optimal quantization.
982 @item sc_factor @var{integer} (@emph{encoding,video})
983 Set value multiplied by qscale for each frame and added to
986 @item mv0_threshold @var{integer} (@emph{encoding,video})
987 @item b_sensitivity @var{integer} (@emph{encoding,video})
988 Adjust sensitivity of b_frame_strategy 1.
990 @item compression_level @var{integer} (@emph{encoding,audio,video})
991 @item min_prediction_order @var{integer} (@emph{encoding,audio})
992 @item max_prediction_order @var{integer} (@emph{encoding,audio})
993 @item timecode_frame_start @var{integer} (@emph{encoding,video})
994 Set GOP timecode frame start number, in non drop frame format.
996 @item request_channels @var{integer} (@emph{decoding,audio})
997 Set desired number of audio channels.
999 @item bits_per_raw_sample @var{integer}
1000 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1005 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1010 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1011 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1012 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1013 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1014 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1015 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1016 @item color_range @var{integer} (@emph{decoding/encoding,video})
1017 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1019 @item log_level_offset @var{integer}
1020 Set the log level offset.
1022 @item slices @var{integer} (@emph{encoding,video})
1023 Number of slices, used in parallelized encoding.
1025 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1026 Select multithreading type.
1035 @item audio_service_type @var{integer} (@emph{encoding,audio})
1036 Set audio service type.
1060 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1061 Set sample format audio decoders should prefer. Default value is
1064 @item pkt_timebase @var{rational number}
1066 @item sub_charenc @var{encoding} (@emph{decoding,subtitles})
1067 Set the input subtitles character encoding.
1070 @c man end CODEC OPTIONS
1072 @include decoders.texi
1073 @include encoders.texi