1 \input texinfo @c -*- texinfo -*-
3 @settitle Libavcodec Documentation
5 @center @titlefont{Libavcodec Documentation}
13 @c man begin DESCRIPTION
15 libavcodec is a library providing a generic encoding/decoding
16 framework, and containing decoders and encoders for audio, video and
19 @c man end DESCRIPTION
21 @chapter Codec Options
22 @c man begin CODEC OPTIONS
24 libavcodec provides some generic global options, which can be set on
25 all the encoders and decoders. In addition each codec may support
26 so-called private options, which are specific for a given codec.
28 Sometimes, a global option may only affect a specific kind of codec,
29 and may be unsensical or ignored by another, so you need to be aware
30 of the meaning of the specified options. Also some options are
31 meant only for decoding or encoding.
33 Options may be set by specifying -@var{option} @var{value} in the
34 FFmpeg tools, or by setting the value explicitly in the
35 @code{AVCodecContext} options or using the @file{libavutil/opt.h} API
38 The list of supported options follow:
41 @item b @var{integer} (@emph{encoding,audio,video})
42 Set bitrate in bits/s. Default value is 200K.
44 @item ab @var{integer} (@emph{encoding,audio})
45 Set audio bitrate (in bits/s). Default value is 128K.
47 @item bt @var{integer} (@emph{encoding,video})
48 Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
49 tolerance specifies how far ratecontrol is willing to deviate from the
50 target average bitrate value. This is not related to min/max
51 bitrate. Lowering tolerance too much has an adverse effect on quality.
53 @item flags @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
59 Use four motion vector by macroblock (mpeg4).
61 Use 1/4 pel motion compensation.
69 Always try a mb with mv=<0,0>.
73 Use internal 2pass ratecontrol in first pass mode.
75 Use internal 2pass ratecontrol in second pass mode.
77 Only decode/encode grayscale.
81 Set error[?] variables during encoding.
85 Normalize adaptive quantization.
91 Place global headers in extradata instead of every keyframe.
93 Use only bitexact stuff (except (I)DCT).
95 Apply H263 advanced intra coding / mpeg4 ac prediction.
97 Deprecated, use mpegvideo private options instead.
99 Deprecated, use mpegvideo private options instead.
101 Apply interlaced motion estimation.
106 @item sub_id @var{integer}
107 Deprecated, currently unused.
109 @item me_method @var{integer} (@emph{encoding,video})
110 Set motion estimation method.
115 zero motion estimation (fastest)
117 full motion estimation (slowest)
119 EPZS motion estimation (default)
121 esa motion estimation (alias for full)
123 tesa motion estimation
125 dia motion estimation (alias for epzs)
127 log motion estimation
129 phods motion estimation
133 hex motion estimation
135 umh motion estimation
137 iter motion estimation
140 @item extradata_size @var{integer}
143 @item time_base @var{rational number}
146 It is the fundamental unit of time (in seconds) in terms of which
147 frame timestamps are represented. For fixed-fps content, timebase
148 should be 1/framerate and timestamp increments should be identically
151 @item g @var{integer} (@emph{encoding,video})
152 Set the group of picture size. Default value is 12.
154 @item ar @var{integer} (@emph{decoding/encoding,audio})
155 Set audio sampling rate (in Hz).
157 @item ac @var{integer} (@emph{decoding/encoding,audio})
158 Set number of audio channels.
160 @item cutoff @var{integer} (@emph{encoding,audio})
161 Set cutoff bandwidth.
163 @item frame_size @var{integer} (@emph{encoding,audio})
164 Set audio frame size.
166 Each submitted frame except the last must contain exactly frame_size
167 samples per channel. May be 0 when the codec has
168 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
169 restricted. It is set by some decoders to indicate constant frame
172 @item frame_number @var{integer}
173 Set the frame number.
175 @item delay @var{integer}
177 @item qcomp @var{float} (@emph{encoding,video})
178 Set video quantizer scale compression (VBR). It is used as a constant
179 in the ratecontrol equation. Recommended range for default rc_eq:
182 @item qblur @var{float} (@emph{encoding,video})
183 Set video quantizer scale blur (VBR).
185 @item qmin @var{integer} (@emph{encoding,video})
186 Set min video quantizer scale (VBR). Must be included between -1 and
187 69, default value is 2.
189 @item qmax @var{integer} (@emph{encoding,video})
190 Set max video quantizer scale (VBR). Must be included between -1 and
191 1024, default value is 31.
193 @item qdiff @var{integer} (@emph{encoding,video})
194 Set max difference between the quantizer scale (VBR).
196 @item bf @var{integer} (@emph{encoding,video})
197 Set max number of B frames.
199 @item b_qfactor @var{float} (@emph{encoding,video})
200 Set qp factor between P and B frames.
202 @item rc_strategy @var{integer} (@emph{encoding,video})
203 Set ratecontrol method.
205 @item b_strategy @var{integer} (@emph{encoding,video})
206 Set strategy to choose between I/P/B-frames.
208 @item ps @var{integer} (@emph{encoding,video})
209 Set RTP payload size in bytes.
211 @item mv_bits @var{integer}
212 @item header_bits @var{integer}
213 @item i_tex_bits @var{integer}
214 @item p_tex_bits @var{integer}
215 @item i_count @var{integer}
216 @item p_count @var{integer}
217 @item skip_count @var{integer}
218 @item misc_bits @var{integer}
219 @item frame_bits @var{integer}
220 @item codec_tag @var{integer}
221 @item bug @var{flags} (@emph{decoding,video})
222 Workaround not auto detected encoder bugs.
229 some old lavc generated msmpeg4v3 files (no autodetection)
231 Xvid interlacing bug (autodetected if fourcc==XVIX)
233 (autodetected if fourcc==UMP4)
235 padding bug (autodetected)
239 illegal vlc bug (autodetected per fourcc)
243 old standard qpel (autodetected per fourcc/version)
246 @item direct_blocksize
247 direct-qpel-blocksize bug (autodetected per fourcc/version)
249 edge padding bug (autodetected per fourcc/version)
255 Workaround various bugs in microsoft broken decoders.
260 @item lelim @var{integer} (@emph{encoding,video})
261 Set single coefficient elimination threshold for luminance (negative
262 values also consider DC coefficient).
264 @item celim @var{integer} (@emph{encoding,video})
265 Set single coefficient elimination threshold for chrominance (negative
266 values also consider dc coefficient)
268 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
269 Specify how strictly to follow the standards.
274 strictly conform to a older more strict version of the spec or reference software
276 strictly conform to all the things in the spec no matter what consequences
280 allow unofficial extensions
282 allow non standardized experimental things
285 @item b_qoffset @var{float} (@emph{encoding,video})
286 Set QP offset between P and B frames.
288 @item err_detect @var{flags} (@emph{decoding,audio,video})
289 Set error detection flags.
296 detect bitstream specification deviations
298 detect improper bitstream length
300 abort decoding on minor error detection
302 consider things that violate the spec and have not been seen in the wild as errors
304 consider all spec non compliancies as errors
306 consider things that a sane encoder should not do as an error
309 @item has_b_frames @var{integer}
311 @item block_align @var{integer}
313 @item mpeg_quant @var{integer} (@emph{encoding,video})
314 Use MPEG quantizers instead of H.263.
316 @item qsquish @var{float} (@emph{encoding,video})
317 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
318 differentiable function).
320 @item rc_qmod_amp @var{float} (@emph{encoding,video})
321 Set experimental quantizer modulation.
323 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
324 Set experimental quantizer modulation.
326 @item rc_override_count @var{integer}
328 @item rc_eq @var{string} (@emph{encoding,video})
329 Set rate control equation. When computing the expression, besides the
330 standard functions defined in the section 'Expression Evaluation', the
331 following functions are available: bits2qp(bits), qp2bits(qp). Also
332 the following constants are available: iTex pTex tex mv fCode iCount
333 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
336 @item maxrate @var{integer} (@emph{encoding,audio,video})
337 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
339 @item minrate @var{integer} (@emph{encoding,audio,video})
340 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
341 encode. It is of little use elsewise.
343 @item bufsize @var{integer} (@emph{encoding,audio,video})
344 Set ratecontrol buffer size (in bits).
346 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
349 @item i_qfactor @var{float} (@emph{encoding,video})
350 Set QP factor between P and I frames.
352 @item i_qoffset @var{float} (@emph{encoding,video})
353 Set QP offset between P and I frames.
355 @item rc_init_cplx @var{float} (@emph{encoding,video})
356 Set initial complexity for 1-pass encoding.
358 @item dct @var{integer} (@emph{encoding,video})
364 autoselect a good one (default)
374 floating point AAN DCT
377 @item lumi_mask @var{float} (@emph{encoding,video})
378 Compress bright areas stronger than medium ones.
380 @item tcplx_mask @var{float} (@emph{encoding,video})
381 Set temporal complexity masking.
383 @item scplx_mask @var{float} (@emph{encoding,video})
384 Set spatial complexity masking.
386 @item p_mask @var{float} (@emph{encoding,video})
389 @item dark_mask @var{float} (@emph{encoding,video})
390 Compress dark areas stronger than medium ones.
392 @item idct @var{integer} (@emph{decoding/encoding,video})
393 Select IDCT implementation.
434 floating point AAN IDCT
437 @item slice_count @var{integer}
439 @item ec @var{flags} (@emph{decoding,video})
440 Set error concealment strategy.
445 iterative motion vector (MV) search (slow)
447 use strong deblock filter for damaged MBs
450 @item bits_per_coded_sample @var{integer}
452 @item pred @var{integer} (@emph{encoding,video})
453 Set prediction method.
465 @item aspect @var{rational number} (@emph{encoding,video})
466 Set sample aspect ratio.
468 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
469 Print specific debug info.
482 per-block quantization parameter (QP)
496 memory management control operations (H.264)
500 visualize quantization parameter (QP), lower QP are tinted greener
502 visualize block types
504 picture buffer allocations
509 @item vismv @var{integer} (@emph{decoding,video})
510 Visualize motion vectors (MVs).
515 forward predicted MVs of P-frames
517 forward predicted MVs of B-frames
519 backward predicted MVs of B-frames
522 @item cmp @var{integer} (@emph{encoding,video})
523 Set full pel me compare function.
528 sum of absolute differences, fast (default)
530 sum of squared errors
532 sum of absolute Hadamard transformed differences
534 sum of absolute DCT transformed differences
536 sum of squared quantization errors (avoid, low quality)
538 number of bits needed for the block
540 rate distortion optimal, slow
544 sum of absolute vertical differences
546 sum of squared vertical differences
548 noise preserving sum of squared differences
550 5/3 wavelet, only used in snow
552 9/7 wavelet, only used in snow
559 @item subcmp @var{integer} (@emph{encoding,video})
560 Set sub pel me compare function.
565 sum of absolute differences, fast (default)
567 sum of squared errors
569 sum of absolute Hadamard transformed differences
571 sum of absolute DCT transformed differences
573 sum of squared quantization errors (avoid, low quality)
575 number of bits needed for the block
577 rate distortion optimal, slow
581 sum of absolute vertical differences
583 sum of squared vertical differences
585 noise preserving sum of squared differences
587 5/3 wavelet, only used in snow
589 9/7 wavelet, only used in snow
596 @item mbcmp @var{integer} (@emph{encoding,video})
597 Set macroblock compare function.
602 sum of absolute differences, fast (default)
604 sum of squared errors
606 sum of absolute Hadamard transformed differences
608 sum of absolute DCT transformed differences
610 sum of squared quantization errors (avoid, low quality)
612 number of bits needed for the block
614 rate distortion optimal, slow
618 sum of absolute vertical differences
620 sum of squared vertical differences
622 noise preserving sum of squared differences
624 5/3 wavelet, only used in snow
626 9/7 wavelet, only used in snow
633 @item ildctcmp @var{integer} (@emph{encoding,video})
634 Set interlaced dct compare function.
639 sum of absolute differences, fast (default)
641 sum of squared errors
643 sum of absolute Hadamard transformed differences
645 sum of absolute DCT transformed differences
647 sum of squared quantization errors (avoid, low quality)
649 number of bits needed for the block
651 rate distortion optimal, slow
655 sum of absolute vertical differences
657 sum of squared vertical differences
659 noise preserving sum of squared differences
661 5/3 wavelet, only used in snow
663 9/7 wavelet, only used in snow
670 @item dia_size @var{integer} (@emph{encoding,video})
671 Set diamond type & size for motion estimation.
673 @item last_pred @var{integer} (@emph{encoding,video})
674 Set amount of motion predictors from the previous frame.
676 @item preme @var{integer} (@emph{encoding,video})
677 Set pre motion estimation.
679 @item precmp @var{integer} (@emph{encoding,video})
680 Set pre motion estimation compare function.
685 sum of absolute differences, fast (default)
687 sum of squared errors
689 sum of absolute Hadamard transformed differences
691 sum of absolute DCT transformed differences
693 sum of squared quantization errors (avoid, low quality)
695 number of bits needed for the block
697 rate distortion optimal, slow
701 sum of absolute vertical differences
703 sum of squared vertical differences
705 noise preserving sum of squared differences
707 5/3 wavelet, only used in snow
709 9/7 wavelet, only used in snow
716 @item pre_dia_size @var{integer} (@emph{encoding,video})
717 Set diamond type & size for motion estimation pre-pass.
719 @item subq @var{integer} (@emph{encoding,video})
720 Set sub pel motion estimation quality.
722 @item dtg_active_format @var{integer}
724 @item me_range @var{integer} (@emph{encoding,video})
725 Set limit motion vectors range (1023 for DivX player).
727 @item ibias @var{integer} (@emph{encoding,video})
728 Set intra quant bias.
730 @item pbias @var{integer} (@emph{encoding,video})
731 Set inter quant bias.
733 @item color_table_id @var{integer}
735 @item global_quality @var{integer} (@emph{encoding,audio,video})
737 @item coder @var{integer} (@emph{encoding,video})
742 variable length coder / huffman coder
753 @item context @var{integer} (@emph{encoding,video})
756 @item slice_flags @var{integer}
758 @item xvmc_acceleration @var{integer}
760 @item mbd @var{integer} (@emph{encoding,video})
761 Set macroblock decision algorithm (high quality mode).
770 use best rate distortion
773 @item stream_codec_tag @var{integer}
775 @item sc_threshold @var{integer} (@emph{encoding,video})
776 Set scene change threshold.
778 @item lmin @var{integer} (@emph{encoding,video})
779 Set min lagrange factor (VBR).
781 @item lmax @var{integer} (@emph{encoding,video})
782 Set max lagrange factor (VBR).
784 @item nr @var{integer} (@emph{encoding,video})
787 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
788 Set number of bits which should be loaded into the rc buffer before
791 @item inter_threshold @var{integer} (@emph{encoding,video})
793 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
798 allow non spec compliant speedup tricks
800 Deprecated, use mpegvideo private options instead
802 skip bitstream encoding
804 place global headers at every keyframe instead of in extradata
806 Frame data might be split into multiple chunks
808 Show all frames before the first keyframe
810 Deprecated, use mpegvideo private options instead
813 @item error @var{integer} (@emph{encoding,video})
815 @item qns @var{integer} (@emph{encoding,video})
816 Deprecated, use mpegvideo private options instead.
818 @item threads @var{integer} (@emph{decoding/encoding,video})
823 detect a good number of threads
826 @item me_threshold @var{integer} (@emph{encoding,video})
827 Set motion estimaton threshold.
829 @item mb_threshold @var{integer} (@emph{encoding,video})
830 Set macroblock threshold.
832 @item dc @var{integer} (@emph{encoding,video})
833 Set intra_dc_precision.
835 @item nssew @var{integer} (@emph{encoding,video})
838 @item skip_top @var{integer} (@emph{decoding,video})
839 Set number of macroblock rows at the top which are skipped.
841 @item skip_bottom @var{integer} (@emph{decoding,video})
842 Set number of macroblock rows at the bottom which are skipped.
844 @item profile @var{integer} (@emph{encoding,audio,video})
878 @item level @var{integer} (@emph{encoding,audio,video})
886 @item lowres @var{integer} (@emph{decoding,audio,video})
887 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
889 @item skip_threshold @var{integer} (@emph{encoding,video})
890 Set frame skip threshold.
892 @item skip_factor @var{integer} (@emph{encoding,video})
893 Set frame skip factor.
895 @item skip_exp @var{integer} (@emph{encoding,video})
896 Set frame skip exponent.
898 @item skipcmp @var{integer} (@emph{encoding,video})
899 Set frame skip compare function.
904 sum of absolute differences, fast (default)
906 sum of squared errors
908 sum of absolute Hadamard transformed differences
910 sum of absolute DCT transformed differences
912 sum of squared quantization errors (avoid, low quality)
914 number of bits needed for the block
916 rate distortion optimal, slow
920 sum of absolute vertical differences
922 sum of squared vertical differences
924 noise preserving sum of squared differences
926 5/3 wavelet, only used in snow
928 9/7 wavelet, only used in snow
935 @item border_mask @var{float} (@emph{encoding,video})
936 Increase the quantizer for macroblocks close to borders.
938 @item mblmin @var{integer} (@emph{encoding,video})
939 Set min macroblock lagrange factor (VBR).
941 @item mblmax @var{integer} (@emph{encoding,video})
942 Set max macroblock lagrange factor (VBR).
944 @item mepc @var{integer} (@emph{encoding,video})
945 Set motion estimation bitrate penalty compensation (1.0 = 256).
947 @item skip_loop_filter @var{integer} (@emph{decoding,video})
965 @item skip_idct @var{integer} (@emph{decoding,video})
983 @item skip_frame @var{integer} (@emph{decoding,video})
1001 @item bidir_refine @var{integer} (@emph{encoding,video})
1002 Refine the two motion vectors used in bidirectional macroblocks.
1004 @item brd_scale @var{integer} (@emph{encoding,video})
1005 Downscale frames for dynamic B-frame decision.
1007 @item keyint_min @var{integer} (@emph{encoding,video})
1008 Set minimum interval between IDR-frames.
1010 @item refs @var{integer} (@emph{encoding,video})
1011 Set reference frames to consider for motion compensation.
1013 @item chromaoffset @var{integer} (@emph{encoding,video})
1014 Set chroma qp offset from luma.
1016 @item trellis @var{integer} (@emph{encoding,audio,video})
1017 Set rate-distortion optimal quantization.
1019 @item sc_factor @var{integer} (@emph{encoding,video})
1020 Set value multiplied by qscale for each frame and added to
1023 @item mv0_threshold @var{integer} (@emph{encoding,video})
1024 @item b_sensitivity @var{integer} (@emph{encoding,video})
1025 Adjust sensitivity of b_frame_strategy 1.
1027 @item compression_level @var{integer} (@emph{encoding,audio,video})
1028 @item min_prediction_order @var{integer} (@emph{encoding,audio})
1029 @item max_prediction_order @var{integer} (@emph{encoding,audio})
1030 @item timecode_frame_start @var{integer} (@emph{encoding,video})
1031 Set GOP timecode frame start number, in non drop frame format.
1033 @item request_channels @var{integer} (@emph{decoding,audio})
1034 Set desired number of audio channels.
1036 @item bits_per_raw_sample @var{integer}
1037 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1042 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1047 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1048 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1049 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1050 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1051 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1052 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1053 @item color_range @var{integer} (@emph{decoding/encoding,video})
1054 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1056 @item log_level_offset @var{integer}
1057 Set the log level offset.
1059 @item slices @var{integer} (@emph{encoding,video})
1060 Number of slices, used in parallelized encoding.
1062 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1063 Select multithreading type.
1072 @item audio_service_type @var{integer} (@emph{encoding,audio})
1073 Set audio service type.
1097 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1098 Set sample format audio decoders should prefer. Default value is
1101 @item pkt_timebase @var{rational number}
1104 @c man end CODEC OPTIONS
1106 @include decoders.texi
1107 @include encoders.texi
1111 @setfilename libavcodec
1112 @settitle multimedia streams decoding and encoding library
1114 @c man begin SEEALSO
1115 ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1)
1118 @c man begin AUTHORS