2 @c man begin CODEC OPTIONS
4 libavcodec provides some generic global options, which can be set on
5 all the encoders and decoders. In addition each codec may support
6 so-called private options, which are specific for a given codec.
8 Sometimes, a global option may only affect a specific kind of codec,
9 and may be unsensical or ignored by another, so you need to be aware
10 of the meaning of the specified options. Also some options are
11 meant only for decoding or encoding.
13 Options may be set by specifying -@var{option} @var{value} in the
14 FFmpeg tools, or by setting the value explicitly in the
15 @code{AVCodecContext} options or using the @file{libavutil/opt.h} API
18 The list of supported options follow:
21 @item b @var{integer} (@emph{encoding,audio,video})
22 Set bitrate in bits/s. Default value is 200K.
24 @item ab @var{integer} (@emph{encoding,audio})
25 Set audio bitrate (in bits/s). Default value is 128K.
27 @item bt @var{integer} (@emph{encoding,video})
28 Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
29 tolerance specifies how far ratecontrol is willing to deviate from the
30 target average bitrate value. This is not related to min/max
31 bitrate. Lowering tolerance too much has an adverse effect on quality.
33 @item flags @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
39 Use four motion vector by macroblock (mpeg4).
41 Use 1/4 pel motion compensation.
49 Always try a mb with mv=<0,0>.
53 Use internal 2pass ratecontrol in first pass mode.
55 Use internal 2pass ratecontrol in second pass mode.
57 Only decode/encode grayscale.
61 Set error[?] variables during encoding.
65 Normalize adaptive quantization.
71 Place global headers in extradata instead of every keyframe.
73 Use only bitexact stuff (except (I)DCT).
75 Apply H263 advanced intra coding / mpeg4 ac prediction.
77 Deprecated, use mpegvideo private options instead.
79 Deprecated, use mpegvideo private options instead.
81 Apply interlaced motion estimation.
86 @item sub_id @var{integer}
87 Deprecated, currently unused.
89 @item me_method @var{integer} (@emph{encoding,video})
90 Set motion estimation method.
95 zero motion estimation (fastest)
97 full motion estimation (slowest)
99 EPZS motion estimation (default)
101 esa motion estimation (alias for full)
103 tesa motion estimation
105 dia motion estimation (alias for epzs)
107 log motion estimation
109 phods motion estimation
113 hex motion estimation
115 umh motion estimation
117 iter motion estimation
120 @item extradata_size @var{integer}
123 @item time_base @var{rational number}
126 It is the fundamental unit of time (in seconds) in terms of which
127 frame timestamps are represented. For fixed-fps content, timebase
128 should be @code{1 / frame_rate} and timestamp increments should be
131 @item g @var{integer} (@emph{encoding,video})
132 Set the group of picture size. Default value is 12.
134 @item ar @var{integer} (@emph{decoding/encoding,audio})
135 Set audio sampling rate (in Hz).
137 @item ac @var{integer} (@emph{decoding/encoding,audio})
138 Set number of audio channels.
140 @item cutoff @var{integer} (@emph{encoding,audio})
141 Set cutoff bandwidth.
143 @item frame_size @var{integer} (@emph{encoding,audio})
144 Set audio frame size.
146 Each submitted frame except the last must contain exactly frame_size
147 samples per channel. May be 0 when the codec has
148 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
149 restricted. It is set by some decoders to indicate constant frame
152 @item frame_number @var{integer}
153 Set the frame number.
155 @item delay @var{integer}
157 @item qcomp @var{float} (@emph{encoding,video})
158 Set video quantizer scale compression (VBR). It is used as a constant
159 in the ratecontrol equation. Recommended range for default rc_eq:
162 @item qblur @var{float} (@emph{encoding,video})
163 Set video quantizer scale blur (VBR).
165 @item qmin @var{integer} (@emph{encoding,video})
166 Set min video quantizer scale (VBR). Must be included between -1 and
167 69, default value is 2.
169 @item qmax @var{integer} (@emph{encoding,video})
170 Set max video quantizer scale (VBR). Must be included between -1 and
171 1024, default value is 31.
173 @item qdiff @var{integer} (@emph{encoding,video})
174 Set max difference between the quantizer scale (VBR).
176 @item bf @var{integer} (@emph{encoding,video})
177 Set max number of B frames.
179 @item b_qfactor @var{float} (@emph{encoding,video})
180 Set qp factor between P and B frames.
182 @item rc_strategy @var{integer} (@emph{encoding,video})
183 Set ratecontrol method.
185 @item b_strategy @var{integer} (@emph{encoding,video})
186 Set strategy to choose between I/P/B-frames.
188 @item ps @var{integer} (@emph{encoding,video})
189 Set RTP payload size in bytes.
191 @item mv_bits @var{integer}
192 @item header_bits @var{integer}
193 @item i_tex_bits @var{integer}
194 @item p_tex_bits @var{integer}
195 @item i_count @var{integer}
196 @item p_count @var{integer}
197 @item skip_count @var{integer}
198 @item misc_bits @var{integer}
199 @item frame_bits @var{integer}
200 @item codec_tag @var{integer}
201 @item bug @var{flags} (@emph{decoding,video})
202 Workaround not auto detected encoder bugs.
209 some old lavc generated msmpeg4v3 files (no autodetection)
211 Xvid interlacing bug (autodetected if fourcc==XVIX)
213 (autodetected if fourcc==UMP4)
215 padding bug (autodetected)
219 illegal vlc bug (autodetected per fourcc)
223 old standard qpel (autodetected per fourcc/version)
226 @item direct_blocksize
227 direct-qpel-blocksize bug (autodetected per fourcc/version)
229 edge padding bug (autodetected per fourcc/version)
235 Workaround various bugs in microsoft broken decoders.
240 @item lelim @var{integer} (@emph{encoding,video})
241 Set single coefficient elimination threshold for luminance (negative
242 values also consider DC coefficient).
244 @item celim @var{integer} (@emph{encoding,video})
245 Set single coefficient elimination threshold for chrominance (negative
246 values also consider dc coefficient)
248 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
249 Specify how strictly to follow the standards.
254 strictly conform to a older more strict version of the spec or reference software
256 strictly conform to all the things in the spec no matter what consequences
260 allow unofficial extensions
262 allow non standardized experimental things
265 @item b_qoffset @var{float} (@emph{encoding,video})
266 Set QP offset between P and B frames.
268 @item err_detect @var{flags} (@emph{decoding,audio,video})
269 Set error detection flags.
276 detect bitstream specification deviations
278 detect improper bitstream length
280 abort decoding on minor error detection
282 consider things that violate the spec and have not been seen in the wild as errors
284 consider all spec non compliancies as errors
286 consider things that a sane encoder should not do as an error
289 @item has_b_frames @var{integer}
291 @item block_align @var{integer}
293 @item mpeg_quant @var{integer} (@emph{encoding,video})
294 Use MPEG quantizers instead of H.263.
296 @item qsquish @var{float} (@emph{encoding,video})
297 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
298 differentiable function).
300 @item rc_qmod_amp @var{float} (@emph{encoding,video})
301 Set experimental quantizer modulation.
303 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
304 Set experimental quantizer modulation.
306 @item rc_override_count @var{integer}
308 @item rc_eq @var{string} (@emph{encoding,video})
309 Set rate control equation. When computing the expression, besides the
310 standard functions defined in the section 'Expression Evaluation', the
311 following functions are available: bits2qp(bits), qp2bits(qp). Also
312 the following constants are available: iTex pTex tex mv fCode iCount
313 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
316 @item maxrate @var{integer} (@emph{encoding,audio,video})
317 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
319 @item minrate @var{integer} (@emph{encoding,audio,video})
320 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
321 encode. It is of little use elsewise.
323 @item bufsize @var{integer} (@emph{encoding,audio,video})
324 Set ratecontrol buffer size (in bits).
326 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
329 @item i_qfactor @var{float} (@emph{encoding,video})
330 Set QP factor between P and I frames.
332 @item i_qoffset @var{float} (@emph{encoding,video})
333 Set QP offset between P and I frames.
335 @item rc_init_cplx @var{float} (@emph{encoding,video})
336 Set initial complexity for 1-pass encoding.
338 @item dct @var{integer} (@emph{encoding,video})
344 autoselect a good one (default)
354 floating point AAN DCT
357 @item lumi_mask @var{float} (@emph{encoding,video})
358 Compress bright areas stronger than medium ones.
360 @item tcplx_mask @var{float} (@emph{encoding,video})
361 Set temporal complexity masking.
363 @item scplx_mask @var{float} (@emph{encoding,video})
364 Set spatial complexity masking.
366 @item p_mask @var{float} (@emph{encoding,video})
369 @item dark_mask @var{float} (@emph{encoding,video})
370 Compress dark areas stronger than medium ones.
372 @item idct @var{integer} (@emph{decoding/encoding,video})
373 Select IDCT implementation.
414 floating point AAN IDCT
417 @item slice_count @var{integer}
419 @item ec @var{flags} (@emph{decoding,video})
420 Set error concealment strategy.
425 iterative motion vector (MV) search (slow)
427 use strong deblock filter for damaged MBs
430 @item bits_per_coded_sample @var{integer}
432 @item pred @var{integer} (@emph{encoding,video})
433 Set prediction method.
445 @item aspect @var{rational number} (@emph{encoding,video})
446 Set sample aspect ratio.
448 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
449 Print specific debug info.
462 per-block quantization parameter (QP)
476 memory management control operations (H.264)
480 visualize quantization parameter (QP), lower QP are tinted greener
482 visualize block types
484 picture buffer allocations
489 @item vismv @var{integer} (@emph{decoding,video})
490 Visualize motion vectors (MVs).
495 forward predicted MVs of P-frames
497 forward predicted MVs of B-frames
499 backward predicted MVs of B-frames
502 @item cmp @var{integer} (@emph{encoding,video})
503 Set full pel me compare function.
508 sum of absolute differences, fast (default)
510 sum of squared errors
512 sum of absolute Hadamard transformed differences
514 sum of absolute DCT transformed differences
516 sum of squared quantization errors (avoid, low quality)
518 number of bits needed for the block
520 rate distortion optimal, slow
524 sum of absolute vertical differences
526 sum of squared vertical differences
528 noise preserving sum of squared differences
530 5/3 wavelet, only used in snow
532 9/7 wavelet, only used in snow
539 @item subcmp @var{integer} (@emph{encoding,video})
540 Set sub pel me compare function.
545 sum of absolute differences, fast (default)
547 sum of squared errors
549 sum of absolute Hadamard transformed differences
551 sum of absolute DCT transformed differences
553 sum of squared quantization errors (avoid, low quality)
555 number of bits needed for the block
557 rate distortion optimal, slow
561 sum of absolute vertical differences
563 sum of squared vertical differences
565 noise preserving sum of squared differences
567 5/3 wavelet, only used in snow
569 9/7 wavelet, only used in snow
576 @item mbcmp @var{integer} (@emph{encoding,video})
577 Set macroblock compare function.
582 sum of absolute differences, fast (default)
584 sum of squared errors
586 sum of absolute Hadamard transformed differences
588 sum of absolute DCT transformed differences
590 sum of squared quantization errors (avoid, low quality)
592 number of bits needed for the block
594 rate distortion optimal, slow
598 sum of absolute vertical differences
600 sum of squared vertical differences
602 noise preserving sum of squared differences
604 5/3 wavelet, only used in snow
606 9/7 wavelet, only used in snow
613 @item ildctcmp @var{integer} (@emph{encoding,video})
614 Set interlaced dct compare function.
619 sum of absolute differences, fast (default)
621 sum of squared errors
623 sum of absolute Hadamard transformed differences
625 sum of absolute DCT transformed differences
627 sum of squared quantization errors (avoid, low quality)
629 number of bits needed for the block
631 rate distortion optimal, slow
635 sum of absolute vertical differences
637 sum of squared vertical differences
639 noise preserving sum of squared differences
641 5/3 wavelet, only used in snow
643 9/7 wavelet, only used in snow
650 @item dia_size @var{integer} (@emph{encoding,video})
651 Set diamond type & size for motion estimation.
653 @item last_pred @var{integer} (@emph{encoding,video})
654 Set amount of motion predictors from the previous frame.
656 @item preme @var{integer} (@emph{encoding,video})
657 Set pre motion estimation.
659 @item precmp @var{integer} (@emph{encoding,video})
660 Set pre motion estimation compare function.
665 sum of absolute differences, fast (default)
667 sum of squared errors
669 sum of absolute Hadamard transformed differences
671 sum of absolute DCT transformed differences
673 sum of squared quantization errors (avoid, low quality)
675 number of bits needed for the block
677 rate distortion optimal, slow
681 sum of absolute vertical differences
683 sum of squared vertical differences
685 noise preserving sum of squared differences
687 5/3 wavelet, only used in snow
689 9/7 wavelet, only used in snow
696 @item pre_dia_size @var{integer} (@emph{encoding,video})
697 Set diamond type & size for motion estimation pre-pass.
699 @item subq @var{integer} (@emph{encoding,video})
700 Set sub pel motion estimation quality.
702 @item dtg_active_format @var{integer}
704 @item me_range @var{integer} (@emph{encoding,video})
705 Set limit motion vectors range (1023 for DivX player).
707 @item ibias @var{integer} (@emph{encoding,video})
708 Set intra quant bias.
710 @item pbias @var{integer} (@emph{encoding,video})
711 Set inter quant bias.
713 @item color_table_id @var{integer}
715 @item global_quality @var{integer} (@emph{encoding,audio,video})
717 @item coder @var{integer} (@emph{encoding,video})
722 variable length coder / huffman coder
733 @item context @var{integer} (@emph{encoding,video})
736 @item slice_flags @var{integer}
738 @item xvmc_acceleration @var{integer}
740 @item mbd @var{integer} (@emph{encoding,video})
741 Set macroblock decision algorithm (high quality mode).
750 use best rate distortion
753 @item stream_codec_tag @var{integer}
755 @item sc_threshold @var{integer} (@emph{encoding,video})
756 Set scene change threshold.
758 @item lmin @var{integer} (@emph{encoding,video})
759 Set min lagrange factor (VBR).
761 @item lmax @var{integer} (@emph{encoding,video})
762 Set max lagrange factor (VBR).
764 @item nr @var{integer} (@emph{encoding,video})
767 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
768 Set number of bits which should be loaded into the rc buffer before
771 @item inter_threshold @var{integer} (@emph{encoding,video})
773 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
778 allow non spec compliant speedup tricks
780 Deprecated, use mpegvideo private options instead
782 skip bitstream encoding
784 place global headers at every keyframe instead of in extradata
786 Frame data might be split into multiple chunks
788 Show all frames before the first keyframe
790 Deprecated, use mpegvideo private options instead
793 @item error @var{integer} (@emph{encoding,video})
795 @item qns @var{integer} (@emph{encoding,video})
796 Deprecated, use mpegvideo private options instead.
798 @item threads @var{integer} (@emph{decoding/encoding,video})
803 detect a good number of threads
806 @item me_threshold @var{integer} (@emph{encoding,video})
807 Set motion estimation threshold.
809 @item mb_threshold @var{integer} (@emph{encoding,video})
810 Set macroblock threshold.
812 @item dc @var{integer} (@emph{encoding,video})
813 Set intra_dc_precision.
815 @item nssew @var{integer} (@emph{encoding,video})
818 @item skip_top @var{integer} (@emph{decoding,video})
819 Set number of macroblock rows at the top which are skipped.
821 @item skip_bottom @var{integer} (@emph{decoding,video})
822 Set number of macroblock rows at the bottom which are skipped.
824 @item profile @var{integer} (@emph{encoding,audio,video})
858 @item level @var{integer} (@emph{encoding,audio,video})
866 @item lowres @var{integer} (@emph{decoding,audio,video})
867 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
869 @item skip_threshold @var{integer} (@emph{encoding,video})
870 Set frame skip threshold.
872 @item skip_factor @var{integer} (@emph{encoding,video})
873 Set frame skip factor.
875 @item skip_exp @var{integer} (@emph{encoding,video})
876 Set frame skip exponent.
878 @item skipcmp @var{integer} (@emph{encoding,video})
879 Set frame skip compare function.
884 sum of absolute differences, fast (default)
886 sum of squared errors
888 sum of absolute Hadamard transformed differences
890 sum of absolute DCT transformed differences
892 sum of squared quantization errors (avoid, low quality)
894 number of bits needed for the block
896 rate distortion optimal, slow
900 sum of absolute vertical differences
902 sum of squared vertical differences
904 noise preserving sum of squared differences
906 5/3 wavelet, only used in snow
908 9/7 wavelet, only used in snow
915 @item border_mask @var{float} (@emph{encoding,video})
916 Increase the quantizer for macroblocks close to borders.
918 @item mblmin @var{integer} (@emph{encoding,video})
919 Set min macroblock lagrange factor (VBR).
921 @item mblmax @var{integer} (@emph{encoding,video})
922 Set max macroblock lagrange factor (VBR).
924 @item mepc @var{integer} (@emph{encoding,video})
925 Set motion estimation bitrate penalty compensation (1.0 = 256).
927 @item skip_loop_filter @var{integer} (@emph{decoding,video})
928 @item skip_idct @var{integer} (@emph{decoding,video})
929 @item skip_frame @var{integer} (@emph{decoding,video})
931 Make decoder discard processing depending on the frame type selected
934 @option{skip_loop_filter} skips frame loop filtering, @option{skip_idct}
935 skips frame IDCT/dequantization, @option{skip_frame} skips decoding.
943 Discard useless frames like 0-sized frames.
946 Discard all non-reference frames.
949 Discard all bidirectional frames.
952 Discard all frames excepts keyframes.
958 Default value is @samp{default}.
960 @item bidir_refine @var{integer} (@emph{encoding,video})
961 Refine the two motion vectors used in bidirectional macroblocks.
963 @item brd_scale @var{integer} (@emph{encoding,video})
964 Downscale frames for dynamic B-frame decision.
966 @item keyint_min @var{integer} (@emph{encoding,video})
967 Set minimum interval between IDR-frames.
969 @item refs @var{integer} (@emph{encoding,video})
970 Set reference frames to consider for motion compensation.
972 @item chromaoffset @var{integer} (@emph{encoding,video})
973 Set chroma qp offset from luma.
975 @item trellis @var{integer} (@emph{encoding,audio,video})
976 Set rate-distortion optimal quantization.
978 @item sc_factor @var{integer} (@emph{encoding,video})
979 Set value multiplied by qscale for each frame and added to
982 @item mv0_threshold @var{integer} (@emph{encoding,video})
983 @item b_sensitivity @var{integer} (@emph{encoding,video})
984 Adjust sensitivity of b_frame_strategy 1.
986 @item compression_level @var{integer} (@emph{encoding,audio,video})
987 @item min_prediction_order @var{integer} (@emph{encoding,audio})
988 @item max_prediction_order @var{integer} (@emph{encoding,audio})
989 @item timecode_frame_start @var{integer} (@emph{encoding,video})
990 Set GOP timecode frame start number, in non drop frame format.
992 @item request_channels @var{integer} (@emph{decoding,audio})
993 Set desired number of audio channels.
995 @item bits_per_raw_sample @var{integer}
996 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1001 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1006 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1007 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1008 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1009 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1010 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1011 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1012 @item color_range @var{integer} (@emph{decoding/encoding,video})
1013 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1015 @item log_level_offset @var{integer}
1016 Set the log level offset.
1018 @item slices @var{integer} (@emph{encoding,video})
1019 Number of slices, used in parallelized encoding.
1021 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1022 Select multithreading type.
1031 @item audio_service_type @var{integer} (@emph{encoding,audio})
1032 Set audio service type.
1056 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1057 Set sample format audio decoders should prefer. Default value is
1060 @item pkt_timebase @var{rational number}
1062 @item sub_charenc @var{encoding} (@emph{decoding,subtitles})
1063 Set the input subtitles character encoding.
1066 @c man end CODEC OPTIONS
1068 @include decoders.texi
1069 @include encoders.texi