1 \input texinfo @c -*- texinfo -*-
3 @settitle FFmpeg Codecs Documentation
5 @center @titlefont{FFmpeg Codecs Documentation}
13 @c man begin DESCRIPTION
15 This document describes the codecs (decoders and encoders) provided by
16 the libavcodec library.
18 @c man end DESCRIPTION
20 @chapter Codec Options
21 @c man begin CODEC OPTIONS
23 libavcodec provides some generic global options, which can be set on
24 all the encoders and decoders. In addition each codec may support
25 so-called private options, which are specific for a given codec.
27 Sometimes, a global option may only affect a specific kind of codec,
28 and may be unsensical or ignored by another, so you need to be aware
29 of the meaning of the specified options. Also some options are
30 meant only for decoding or encoding.
32 Options may be set by specifying -@var{option} @var{value} in the
33 FFmpeg tools, or by setting the value explicitly in the
34 @code{AVCodecContext} options or using the @file{libavutil/opt.h} API
37 The list of supported options follow:
40 @item b @var{integer} (@emph{encoding,audio,video})
41 Set bitrate in bits/s. Default value is 200K.
43 @item ab @var{integer} (@emph{encoding,audio})
44 Set audio bitrate (in bits/s). Default value is 128K.
46 @item bt @var{integer} (@emph{encoding,video})
47 Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
48 tolerance specifies how far ratecontrol is willing to deviate from the
49 target average bitrate value. This is not related to min/max
50 bitrate. Lowering tolerance too much has an adverse effect on quality.
52 @item flags @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
58 Use four motion vector by macroblock (mpeg4).
60 Use 1/4 pel motion compensation.
68 Always try a mb with mv=<0,0>.
72 Use internal 2pass ratecontrol in first pass mode.
74 Use internal 2pass ratecontrol in second pass mode.
76 Only decode/encode grayscale.
80 Set error[?] variables during encoding.
84 Normalize adaptive quantization.
90 Place global headers in extradata instead of every keyframe.
92 Use only bitexact stuff (except (I)DCT).
94 Apply H263 advanced intra coding / mpeg4 ac prediction.
96 Deprecated, use mpegvideo private options instead.
98 Deprecated, use mpegvideo private options instead.
100 Apply interlaced motion estimation.
105 @item sub_id @var{integer}
106 Deprecated, currently unused.
108 @item me_method @var{integer} (@emph{encoding,video})
109 Set motion estimation method.
114 zero motion estimation (fastest)
116 full motion estimation (slowest)
118 EPZS motion estimation (default)
120 esa motion estimation (alias for full)
122 tesa motion estimation
124 dia motion estimation (alias for epzs)
126 log motion estimation
128 phods motion estimation
132 hex motion estimation
134 umh motion estimation
136 iter motion estimation
139 @item extradata_size @var{integer}
142 @item time_base @var{rational number}
145 It is the fundamental unit of time (in seconds) in terms of which
146 frame timestamps are represented. For fixed-fps content, timebase
147 should be 1/framerate and timestamp increments should be identically
150 @item g @var{integer} (@emph{encoding,video})
151 Set the group of picture size. Default value is 12.
153 @item ar @var{integer} (@emph{decoding/encoding,audio})
154 Set audio sampling rate (in Hz).
156 @item ac @var{integer} (@emph{decoding/encoding,audio})
157 Set number of audio channels.
159 @item cutoff @var{integer} (@emph{encoding,audio})
160 Set cutoff bandwidth.
162 @item frame_size @var{integer} (@emph{encoding,audio})
163 Set audio frame size.
165 Each submitted frame except the last must contain exactly frame_size
166 samples per channel. May be 0 when the codec has
167 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
168 restricted. It is set by some decoders to indicate constant frame
171 @item frame_number @var{integer}
172 Set the frame number.
174 @item delay @var{integer}
176 @item qcomp @var{float} (@emph{encoding,video})
177 Set video quantizer scale compression (VBR). It is used as a constant
178 in the ratecontrol equation. Recommended range for default rc_eq:
181 @item qblur @var{float} (@emph{encoding,video})
182 Set video quantizer scale blur (VBR).
184 @item qmin @var{integer} (@emph{encoding,video})
185 Set min video quantizer scale (VBR). Must be included between -1 and
186 69, default value is 2.
188 @item qmax @var{integer} (@emph{encoding,video})
189 Set max video quantizer scale (VBR). Must be included between -1 and
190 1024, default value is 31.
192 @item qdiff @var{integer} (@emph{encoding,video})
193 Set max difference between the quantizer scale (VBR).
195 @item bf @var{integer} (@emph{encoding,video})
196 Set max number of B frames.
198 @item b_qfactor @var{float} (@emph{encoding,video})
199 Set qp factor between P and B frames.
201 @item rc_strategy @var{integer} (@emph{encoding,video})
202 Set ratecontrol method.
204 @item b_strategy @var{integer} (@emph{encoding,video})
205 Set strategy to choose between I/P/B-frames.
207 @item ps @var{integer} (@emph{encoding,video})
208 Set RTP payload size in bytes.
210 @item mv_bits @var{integer}
211 @item header_bits @var{integer}
212 @item i_tex_bits @var{integer}
213 @item p_tex_bits @var{integer}
214 @item i_count @var{integer}
215 @item p_count @var{integer}
216 @item skip_count @var{integer}
217 @item misc_bits @var{integer}
218 @item frame_bits @var{integer}
219 @item codec_tag @var{integer}
220 @item bug @var{flags} (@emph{decoding,video})
221 Workaround not auto detected encoder bugs.
228 some old lavc generated msmpeg4v3 files (no autodetection)
230 Xvid interlacing bug (autodetected if fourcc==XVIX)
232 (autodetected if fourcc==UMP4)
234 padding bug (autodetected)
238 illegal vlc bug (autodetected per fourcc)
242 old standard qpel (autodetected per fourcc/version)
245 @item direct_blocksize
246 direct-qpel-blocksize bug (autodetected per fourcc/version)
248 edge padding bug (autodetected per fourcc/version)
254 Workaround various bugs in microsoft broken decoders.
259 @item lelim @var{integer} (@emph{encoding,video})
260 Set single coefficient elimination threshold for luminance (negative
261 values also consider DC coefficient).
263 @item celim @var{integer} (@emph{encoding,video})
264 Set single coefficient elimination threshold for chrominance (negative
265 values also consider dc coefficient)
267 @item strict @var{integer} (@emph{decoding/encoding,audio,video})
268 Specify how strictly to follow the standards.
273 strictly conform to a older more strict version of the spec or reference software
275 strictly conform to all the things in the spec no matter what consequences
279 allow unofficial extensions
281 allow non standardized experimental things
284 @item b_qoffset @var{float} (@emph{encoding,video})
285 Set QP offset between P and B frames.
287 @item err_detect @var{flags} (@emph{decoding,audio,video})
288 Set error detection flags.
295 detect bitstream specification deviations
297 detect improper bitstream length
299 abort decoding on minor error detection
301 consider things that violate the spec and have not been seen in the wild as errors
303 consider all spec non compliancies as errors
305 consider things that a sane encoder should not do as an error
308 @item has_b_frames @var{integer}
310 @item block_align @var{integer}
312 @item mpeg_quant @var{integer} (@emph{encoding,video})
313 Use MPEG quantizers instead of H.263.
315 @item qsquish @var{float} (@emph{encoding,video})
316 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
317 differentiable function).
319 @item rc_qmod_amp @var{float} (@emph{encoding,video})
320 Set experimental quantizer modulation.
322 @item rc_qmod_freq @var{integer} (@emph{encoding,video})
323 Set experimental quantizer modulation.
325 @item rc_override_count @var{integer}
327 @item rc_eq @var{string} (@emph{encoding,video})
328 Set rate control equation. When computing the expression, besides the
329 standard functions defined in the section 'Expression Evaluation', the
330 following functions are available: bits2qp(bits), qp2bits(qp). Also
331 the following constants are available: iTex pTex tex mv fCode iCount
332 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
335 @item maxrate @var{integer} (@emph{encoding,audio,video})
336 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
338 @item minrate @var{integer} (@emph{encoding,audio,video})
339 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
340 encode. It is of little use elsewise.
342 @item bufsize @var{integer} (@emph{encoding,audio,video})
343 Set ratecontrol buffer size (in bits).
345 @item rc_buf_aggressivity @var{float} (@emph{encoding,video})
348 @item i_qfactor @var{float} (@emph{encoding,video})
349 Set QP factor between P and I frames.
351 @item i_qoffset @var{float} (@emph{encoding,video})
352 Set QP offset between P and I frames.
354 @item rc_init_cplx @var{float} (@emph{encoding,video})
355 Set initial complexity for 1-pass encoding.
357 @item dct @var{integer} (@emph{encoding,video})
363 autoselect a good one (default)
373 floating point AAN DCT
376 @item lumi_mask @var{float} (@emph{encoding,video})
377 Compress bright areas stronger than medium ones.
379 @item tcplx_mask @var{float} (@emph{encoding,video})
380 Set temporal complexity masking.
382 @item scplx_mask @var{float} (@emph{encoding,video})
383 Set spatial complexity masking.
385 @item p_mask @var{float} (@emph{encoding,video})
388 @item dark_mask @var{float} (@emph{encoding,video})
389 Compress dark areas stronger than medium ones.
391 @item idct @var{integer} (@emph{decoding/encoding,video})
392 Select IDCT implementation.
433 floating point AAN IDCT
436 @item slice_count @var{integer}
438 @item ec @var{flags} (@emph{decoding,video})
439 Set error concealment strategy.
444 iterative motion vector (MV) search (slow)
446 use strong deblock filter for damaged MBs
449 @item bits_per_coded_sample @var{integer}
451 @item pred @var{integer} (@emph{encoding,video})
452 Set prediction method.
464 @item aspect @var{rational number} (@emph{encoding,video})
465 Set sample aspect ratio.
467 @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
468 Print specific debug info.
481 per-block quantization parameter (QP)
495 memory management control operations (H.264)
499 visualize quantization parameter (QP), lower QP are tinted greener
501 visualize block types
503 picture buffer allocations
508 @item vismv @var{integer} (@emph{decoding,video})
509 Visualize motion vectors (MVs).
514 forward predicted MVs of P-frames
516 forward predicted MVs of B-frames
518 backward predicted MVs of B-frames
521 @item cmp @var{integer} (@emph{encoding,video})
522 Set full pel me compare function.
527 sum of absolute differences, fast (default)
529 sum of squared errors
531 sum of absolute Hadamard transformed differences
533 sum of absolute DCT transformed differences
535 sum of squared quantization errors (avoid, low quality)
537 number of bits needed for the block
539 rate distortion optimal, slow
543 sum of absolute vertical differences
545 sum of squared vertical differences
547 noise preserving sum of squared differences
549 5/3 wavelet, only used in snow
551 9/7 wavelet, only used in snow
558 @item subcmp @var{integer} (@emph{encoding,video})
559 Set sub pel me compare function.
564 sum of absolute differences, fast (default)
566 sum of squared errors
568 sum of absolute Hadamard transformed differences
570 sum of absolute DCT transformed differences
572 sum of squared quantization errors (avoid, low quality)
574 number of bits needed for the block
576 rate distortion optimal, slow
580 sum of absolute vertical differences
582 sum of squared vertical differences
584 noise preserving sum of squared differences
586 5/3 wavelet, only used in snow
588 9/7 wavelet, only used in snow
595 @item mbcmp @var{integer} (@emph{encoding,video})
596 Set macroblock compare function.
601 sum of absolute differences, fast (default)
603 sum of squared errors
605 sum of absolute Hadamard transformed differences
607 sum of absolute DCT transformed differences
609 sum of squared quantization errors (avoid, low quality)
611 number of bits needed for the block
613 rate distortion optimal, slow
617 sum of absolute vertical differences
619 sum of squared vertical differences
621 noise preserving sum of squared differences
623 5/3 wavelet, only used in snow
625 9/7 wavelet, only used in snow
632 @item ildctcmp @var{integer} (@emph{encoding,video})
633 Set interlaced dct compare function.
638 sum of absolute differences, fast (default)
640 sum of squared errors
642 sum of absolute Hadamard transformed differences
644 sum of absolute DCT transformed differences
646 sum of squared quantization errors (avoid, low quality)
648 number of bits needed for the block
650 rate distortion optimal, slow
654 sum of absolute vertical differences
656 sum of squared vertical differences
658 noise preserving sum of squared differences
660 5/3 wavelet, only used in snow
662 9/7 wavelet, only used in snow
669 @item dia_size @var{integer} (@emph{encoding,video})
670 Set diamond type & size for motion estimation.
672 @item last_pred @var{integer} (@emph{encoding,video})
673 Set amount of motion predictors from the previous frame.
675 @item preme @var{integer} (@emph{encoding,video})
676 Set pre motion estimation.
678 @item precmp @var{integer} (@emph{encoding,video})
679 Set pre motion estimation compare function.
684 sum of absolute differences, fast (default)
686 sum of squared errors
688 sum of absolute Hadamard transformed differences
690 sum of absolute DCT transformed differences
692 sum of squared quantization errors (avoid, low quality)
694 number of bits needed for the block
696 rate distortion optimal, slow
700 sum of absolute vertical differences
702 sum of squared vertical differences
704 noise preserving sum of squared differences
706 5/3 wavelet, only used in snow
708 9/7 wavelet, only used in snow
715 @item pre_dia_size @var{integer} (@emph{encoding,video})
716 Set diamond type & size for motion estimation pre-pass.
718 @item subq @var{integer} (@emph{encoding,video})
719 Set sub pel motion estimation quality.
721 @item dtg_active_format @var{integer}
723 @item me_range @var{integer} (@emph{encoding,video})
724 Set limit motion vectors range (1023 for DivX player).
726 @item ibias @var{integer} (@emph{encoding,video})
727 Set intra quant bias.
729 @item pbias @var{integer} (@emph{encoding,video})
730 Set inter quant bias.
732 @item color_table_id @var{integer}
734 @item global_quality @var{integer} (@emph{encoding,audio,video})
736 @item coder @var{integer} (@emph{encoding,video})
741 variable length coder / huffman coder
752 @item context @var{integer} (@emph{encoding,video})
755 @item slice_flags @var{integer}
757 @item xvmc_acceleration @var{integer}
759 @item mbd @var{integer} (@emph{encoding,video})
760 Set macroblock decision algorithm (high quality mode).
769 use best rate distortion
772 @item stream_codec_tag @var{integer}
774 @item sc_threshold @var{integer} (@emph{encoding,video})
775 Set scene change threshold.
777 @item lmin @var{integer} (@emph{encoding,video})
778 Set min lagrange factor (VBR).
780 @item lmax @var{integer} (@emph{encoding,video})
781 Set max lagrange factor (VBR).
783 @item nr @var{integer} (@emph{encoding,video})
786 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
787 Set number of bits which should be loaded into the rc buffer before
790 @item inter_threshold @var{integer} (@emph{encoding,video})
792 @item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
797 allow non spec compliant speedup tricks
799 Deprecated, use mpegvideo private options instead
801 skip bitstream encoding
803 place global headers at every keyframe instead of in extradata
805 Frame data might be split into multiple chunks
807 Show all frames before the first keyframe
809 Deprecated, use mpegvideo private options instead
812 @item error @var{integer} (@emph{encoding,video})
814 @item qns @var{integer} (@emph{encoding,video})
815 Deprecated, use mpegvideo private options instead.
817 @item threads @var{integer} (@emph{decoding/encoding,video})
822 detect a good number of threads
825 @item me_threshold @var{integer} (@emph{encoding,video})
826 Set motion estimation threshold.
828 @item mb_threshold @var{integer} (@emph{encoding,video})
829 Set macroblock threshold.
831 @item dc @var{integer} (@emph{encoding,video})
832 Set intra_dc_precision.
834 @item nssew @var{integer} (@emph{encoding,video})
837 @item skip_top @var{integer} (@emph{decoding,video})
838 Set number of macroblock rows at the top which are skipped.
840 @item skip_bottom @var{integer} (@emph{decoding,video})
841 Set number of macroblock rows at the bottom which are skipped.
843 @item profile @var{integer} (@emph{encoding,audio,video})
877 @item level @var{integer} (@emph{encoding,audio,video})
885 @item lowres @var{integer} (@emph{decoding,audio,video})
886 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
888 @item skip_threshold @var{integer} (@emph{encoding,video})
889 Set frame skip threshold.
891 @item skip_factor @var{integer} (@emph{encoding,video})
892 Set frame skip factor.
894 @item skip_exp @var{integer} (@emph{encoding,video})
895 Set frame skip exponent.
897 @item skipcmp @var{integer} (@emph{encoding,video})
898 Set frame skip compare function.
903 sum of absolute differences, fast (default)
905 sum of squared errors
907 sum of absolute Hadamard transformed differences
909 sum of absolute DCT transformed differences
911 sum of squared quantization errors (avoid, low quality)
913 number of bits needed for the block
915 rate distortion optimal, slow
919 sum of absolute vertical differences
921 sum of squared vertical differences
923 noise preserving sum of squared differences
925 5/3 wavelet, only used in snow
927 9/7 wavelet, only used in snow
934 @item border_mask @var{float} (@emph{encoding,video})
935 Increase the quantizer for macroblocks close to borders.
937 @item mblmin @var{integer} (@emph{encoding,video})
938 Set min macroblock lagrange factor (VBR).
940 @item mblmax @var{integer} (@emph{encoding,video})
941 Set max macroblock lagrange factor (VBR).
943 @item mepc @var{integer} (@emph{encoding,video})
944 Set motion estimation bitrate penalty compensation (1.0 = 256).
946 @item skip_loop_filter @var{integer} (@emph{decoding,video})
964 @item skip_idct @var{integer} (@emph{decoding,video})
982 @item skip_frame @var{integer} (@emph{decoding,video})
1000 @item bidir_refine @var{integer} (@emph{encoding,video})
1001 Refine the two motion vectors used in bidirectional macroblocks.
1003 @item brd_scale @var{integer} (@emph{encoding,video})
1004 Downscale frames for dynamic B-frame decision.
1006 @item keyint_min @var{integer} (@emph{encoding,video})
1007 Set minimum interval between IDR-frames.
1009 @item refs @var{integer} (@emph{encoding,video})
1010 Set reference frames to consider for motion compensation.
1012 @item chromaoffset @var{integer} (@emph{encoding,video})
1013 Set chroma qp offset from luma.
1015 @item trellis @var{integer} (@emph{encoding,audio,video})
1016 Set rate-distortion optimal quantization.
1018 @item sc_factor @var{integer} (@emph{encoding,video})
1019 Set value multiplied by qscale for each frame and added to
1022 @item mv0_threshold @var{integer} (@emph{encoding,video})
1023 @item b_sensitivity @var{integer} (@emph{encoding,video})
1024 Adjust sensitivity of b_frame_strategy 1.
1026 @item compression_level @var{integer} (@emph{encoding,audio,video})
1027 @item min_prediction_order @var{integer} (@emph{encoding,audio})
1028 @item max_prediction_order @var{integer} (@emph{encoding,audio})
1029 @item timecode_frame_start @var{integer} (@emph{encoding,video})
1030 Set GOP timecode frame start number, in non drop frame format.
1032 @item request_channels @var{integer} (@emph{decoding,audio})
1033 Set desired number of audio channels.
1035 @item bits_per_raw_sample @var{integer}
1036 @item channel_layout @var{integer} (@emph{decoding/encoding,audio})
1041 @item request_channel_layout @var{integer} (@emph{decoding,audio})
1046 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
1047 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
1048 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
1049 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
1050 @item color_trc @var{integer} (@emph{decoding/encoding,video})
1051 @item colorspace @var{integer} (@emph{decoding/encoding,video})
1052 @item color_range @var{integer} (@emph{decoding/encoding,video})
1053 @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
1055 @item log_level_offset @var{integer}
1056 Set the log level offset.
1058 @item slices @var{integer} (@emph{encoding,video})
1059 Number of slices, used in parallelized encoding.
1061 @item thread_type @var{flags} (@emph{decoding/encoding,video})
1062 Select multithreading type.
1071 @item audio_service_type @var{integer} (@emph{encoding,audio})
1072 Set audio service type.
1096 @item request_sample_fmt @var{sample_fmt} (@emph{decoding,audio})
1097 Set sample format audio decoders should prefer. Default value is
1100 @item pkt_timebase @var{rational number}
1103 @c man end CODEC OPTIONS
1105 @include decoders.texi
1106 @include encoders.texi
1110 @setfilename ffmpeg-codecs
1111 @settitle FFmpeg codecs
1113 @c man begin SEEALSO
1114 ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libavcodec(3)
1117 @c man begin AUTHORS
1118 See Git history (git://source.ffmpeg.org/ffmpeg)