neulab/tldr huggingface dataset:
vqblur=<0.0-1.0> (pass one) Quantizer blur (default: 0.5), larger values will average the quantizer more over time (slower change). 0.0  Quantizer blur disabled. 1.0  Average the quantizer over all previous frames.
vqblur=<0.0-99.0> (pass two) Quantizer gaussian blur (default: 0.5), larger values will average the quantizer more over time (slower change).
vqcomp=<0.0-1.0> Quantizer compression, vrc_eq depends upon this (default: 0.5). NOTE: Perceptual quality will be optimal somewhere in between the range's extremes.
vrc_eq=<equation> main ratecontrol equation
1+(tex/avgTex-1)*qComp approximately the equation of the old ratecontrol code
tex^qComp with qcomp 0.5 or something like that (default)
infix operators:
+,-,*,/,^
tex texture complexity
iTex,pTex intra, non-intra texture complexity
avgTex average texture complexity
avgIITex average intra texture complexity in I-frames
avgPITex average intra texture complexity in P-frames
avgPPTex average non-intra texture complexity in P-frames
avgBPTex average non-intra texture complexity in B-frames
mv bits used for motion vectors
fCode maximum length of motion vector in log2 scale
iCount number of intra macroblocks / number of macroblocks
var spatial complexity
mcVar temporal complexity
qComp qcomp from the command line
isI, isP, isB Is 1 if picture type is I/P/B else 0.
Pi,E See your favorite math book.
functions:
max(a,b),min(a,b) maximum / minimum
gt(a,b) is 1 if a>b, 0 otherwise
lt(a,b) is 1 if a<b, 0 otherwise
eq(a,b) is 1 if a==b, 0 otherwise
sin, cos, tan, sinh, cosh, tanh, exp, log, abs
vrc_override=<options> User specified quality for specific parts (ending, credits, ...). The options are <start-frame>, <end-frame>, <quality>[/<start- frame>, <end-frame>, <quality>[/...]]: quality (2-31) quantizer quality (-500-0) quality correction in %
vrc_init_cplx=<0-1000> initial complexity (pass 1)
vrc_init_occupancy=<0.0-1.0> initial buffer occupancy, as a fraction of vrc_buf_size (default: 0.9)
vqsquish=<0|1> Specify how to keep the quantizer between qmin and qmax. 0    Use clipping. 1    Use a nice differentiable function (default).
vlelim=<-1000-1000> Sets single coefficient elimination threshold for luminance. Negative values will also consider the DC coefficient (should be at least -4 or lower for encoding at quant=1): 0    disabled (default) -4   JVT recommendation
vcelim=<-1000-1000> Sets single coefficient elimination threshold for chrominance. Negative values will also consider the DC coefficient (should be at least -4 or lower for encoding at quant=1): 0    disabled (default) 7    JVT recommendation
vstrict=<-2|-1|0|1> strict standard compliance 0    disabled 1    Only recommended if you want to feed the output into the MPEG-4 reference decoder. -1   Allow libavcodec specific extensions (default). -2   Enables experimental codecs and features which may not be playable with future MPlayer versions (snow).
vdpart Data partitioning.  Adds 2 Bytes per video packet, improves error- resistance when transferring over unreliable channels (e.g. streaming over the internet).  Each video packet will be encoded in 3 separate partitions: 1. MVs movement 2. DC coefficients low res picture 3. AC coefficients details MV & DC are most important, losing them looks far worse than losing the AC and the 1. & 2. partition.  (MV & DC) are far smaller than the 3. partition (AC) meaning that errors will hit the AC partition much more often than the MV & DC partitions. Thus, the picture will look better with partitioning than without, as without partitioning an error will trash AC/DC/MV equally.
vpsize=<0-10000> (also see vdpart) Video packet size, improves error-resistance. 0 disabled (default) 100-1000 good choice
ss slice structured mode for H.263+
gray grayscale only encoding (faster)
vfdct=<0-10> DCT algorithm 0    Automatically select a good one (default). 1    fast integer 2    accurate integer 3    MMX 4    mlib 5    AltiVec 6    floating point AAN
idct=<0-99> IDCT algorithm NOTE: To the best of our knowledge all these IDCTs do pass the IEEE1180 tests. 0    Automatically select a good one (default). 1    JPEG reference integer 2    simple 3    simplemmx 4    libmpeg2mmx (inaccurate, do not use for encoding with keyint >100) 5    ps2 6    mlib 7    arm 8    AltiVec 9    sh4 10   simplearm 11   H.264 12   VP3 13   IPP 14   xvidmmx 15   CAVS 16   simplearmv5te 17   simplearmv6
lumi_mask=<0.0-1.0> Luminance masking is a 'psychosensory' setting that is supposed to make use of the fact that the human eye tends to notice fewer details in very bright parts of the picture.  Luminance masking compresses bright areas stronger than medium ones, so it will save bits that can be spent again on other frames, raising overall subjective quality, while possibly reducing PSNR. WARNING: Be careful, overly large values can cause disastrous things. WARNING: Large values might look good on some monitors but may look horrible on other monitors. 0.0 disabled (default) 0.0-0.3 sane range
dark_mask=<0.0-1.0> Darkness masking is a 'psychosensory' setting that is supposed to make use of the fact that the human eye tends to notice fewer details in very dark parts of the picture.  Darkness masking compresses dark areas stronger than medium ones, so it will save bits that can be spent again on other frames, raising overall subjective quality, while possibly reducing PSNR. WARNING: Be careful, overly large values can cause disastrous things. WARNING: Large values might look good on some monitors but may look horrible on other monitors / TV / TFT. 0.0 disabled (default) 0.0-0.3 sane range
tcplx_mask=<0.0-1.0> Temporal complexity masking (default: 0.0 (disabled)).  Imagine a scene with a bird flying across the whole scene; tcplx_mask will raise the quantizers of the bird's macroblocks (thus decreasing their quality), as the human eye usually does not have time to see all the bird's details.  Be warned that if the masked object stops (e.g. the bird lands) it is likely to look horrible for a short period of time, until the encoder figures out that the object is not moving and needs refined blocks.  The saved bits will be spent on other parts of the video, which may increase subjective quality, provided that tcplx_mask is carefully chosen.
scplx_mask=<0.0-1.0> Spatial complexity masking.  Larger values help against blockiness, if no deblocking filter is used for decoding, which is maybe not a good idea. Imagine a scene with grass (which usually has great spatial complexity), a blue sky and a house; scplx_mask will raise the quantizers of the grass' macroblocks, thus decreasing its quality, in order to spend more bits on the sky and the house. HINT: Crop any black borders completely as they will reduce the quality of the macroblocks (also applies without scplx_mask). 0.0 disabled (default) 0.0-0.5 sane range
NOTE: This setting does not have the same effect as using a custom matrix that would compress high frequencies harder, as scplx_mask will reduce the quality of P blocks even if only DC is changing. The result of scplx_mask will probably not look as good.
p_mask=<0.0-1.0> (also see vi_qfactor) Reduces the quality of inter blocks.  This is equivalent to increasing the quality of intra blocks, because the same average bitrate will be distributed by the rate controller to the whole video sequence (default: 0.0 (disabled)).  p_mask=1.0 doubles the bits allocated to each intra block.
border_mask=<0.0-1.0> border-processing for MPEG-style encoders.  Border processing increases the quantizer for macroblocks which are less than 1/5th of the frame width/height away from the frame border, since they are often visually less important.
naq Normalize adaptive quantization (experimental).  When using adaptive quantization (*_mask), the average per-MB quantizer may no longer match the requested frame-level quantizer.  Naq will attempt to adjust the per-MB quantizers to maintain the proper average.
ildct Use interlaced DCT.
ilme Use interlaced motion estimation (mutually exclusive with qpel).
alt Use alternative scantable.
top=<-1-1> -1   automatic 0    bottom field first 1    top field first
format=<value> YV12 default 444P for ffv1 422P for HuffYUV, lossless JPEG, dv and ffv1 411P for lossless JPEG, dv and ffv1 YVU9 for lossless JPEG, ffv1 and svq1 BGR32 for lossless JPEG and ffv1
pred (for HuffYUV) 0    left prediction 1    plane/gradient prediction 2    median prediction
pred (for lossless JPEG) 0    left prediction 1    top prediction 2    topleft prediction 3    plane/gradient prediction 6    mean prediction
coder (for ffv1) 0    vlc coding (Golomb-Rice) 1    arithmetic coding (CABAC)
context (for ffv1) 0    small context model 1    large context model
(for ffvhuff) 0    predetermined Huffman tables (builtin or two pass) 1    adaptive Huffman tables
qpel Use quarter pel motion compensation (mutually exclusive with ilme). HINT: This seems only useful for high bitrate encodings.
mbcmp=<0-2000> Sets the comparison function for the macroblock decision, has only an effect if mbd=0.  This is also used for some motion search functions, in which case it has an effect regardless of mbd setting. 0 (SAD) sum of absolute differences, fast (default) 1 (SSE) sum of squared errors 2 (SATD) sum of absolute Hadamard transformed differences 3 (DCT) sum of absolute DCT transformed differences 4 (PSNR) sum of squared quantization errors (avoid, low quality) 5 (BIT) number of bits needed for the block 6 (RD) rate distortion optimal, slow 7 (ZERO) 0 8 (VSAD) sum of absolute vertical differences 9 (VSSE) sum of squared vertical differences 10 (NSSE) noise preserving sum of squared differences 11 (W53) 5/3 wavelet, only used in snow 12 (W97) 9/7 wavelet, only used in snow +256 Also use chroma, currently does not work (correctly) with B-frames.
ildctcmp=<0-2000> Sets the comparison function for interlaced DCT decision (see mbcmp for available comparison functions).
precmp=<0-2000> Sets the comparison function for motion estimation pre pass (see mbcmp for available comparison functions) (default: 0).
cmp=<0-2000> Sets the comparison function for full pel motion estimation (see mbcmp for available comparison functions) (default: 0).
subcmp=<0-2000> Sets the comparison function for sub pel motion estimation (see mbcmp for available comparison functions) (default: 0).
skipcmp=<0-2000> FIXME: Document this.
nssew=<0-1000000> This setting controls NSSE weight, where larger weights will result in more noise.  0 NSSE is identical to SSE You may find this useful if you prefer to keep some noise in your encoded video rather than filtering it away before encoding (default: 8).
predia=<-99-6> diamond type and size for motion estimation pre-pass
dia=<-99-6> Diamond type & size for motion estimation.  Motion search is an iterative process.  Using a small diamond does not limit the search to finding only small motion vectors.  It is just somewhat more likely to stop before finding the very best motion vector, especially when noise is involved.  Bigger diamonds allow a wider search for the best motion vector, thus are slower but result in better quality. Big normal diamonds are better quality than shape-adaptive diamonds. Shape-adaptive diamonds are a good tradeoff between speed and quality. NOTE: The sizes of the normal diamonds and shape adaptive ones do not have the same meaning.
-3   shape adaptive (fast) diamond with size 3
-2   shape adaptive (fast) diamond with size 2
-1   uneven multi-hexagon search (slow)
1    normal size=1 diamond (default) =EPZS type diamond 0 000 0
2    normal size=2 diamond 0 000 00000 000 0
trell Trellis searched quantization.  This will find the optimal encoding for each 8x8 block.  Trellis searched quantization is quite simply an optimal quantization in the PSNR versus bitrate sense (Assuming that there would be no rounding errors introduced by the IDCT, which is obviously not the case.).  It simply finds a block for the minimum of error and lambda*bits. lambda quantization parameter (QP) dependent constant bits amount of bits needed to encode the block error sum of squared errors of the quantization
cbp Rate distorted optimal coded block pattern.  Will select the coded block pattern which minimizes distortion + lambda*rate.  This can only be used together with trellis quantization.
mv0 Try to encode each MB with MV=<0,0> and choose the better one. This has no effect if mbd=0.
mv0_threshold=<any non-negative integer> When surrounding motion vectors are <0,0> and the motion estimation score of the current block is less than mv0_threshold, <0,0> is used for the motion vector and further motion estimation is skipped (default: 256).  Lowering mv0_threshold to 0 can give a slight (0.01dB) PSNR increase and possibly make the encoded video look slightly better; raising mv0_threshold past 320 results in diminished PSNR and visual quality.  Higher values speed up encoding very slightly (usually less than 1%, depending on the other options used). NOTE: This option does not require mv0 to be enabled.
qprd (mbd=2 only) rate distorted optimal quantization parameter (QP) for the given lambda of each macroblock
last_pred=<0-99> amount of motion predictors from the previous frame 0    (default) a    Will use 2a+1 x 2a+1 macroblock square of motion vector predictors from the previous frame.
preme=<0-2> motion estimation pre-pass 0    disabled 1    only after I-frames (default) 2    always
subq=<1-8> subpel refinement quality (for qpel) (default: 8 (high quality)) NOTE: This has a significant effect on speed.
refs=<1-8> number of reference frames to consider for motion compensation (Snow only) (default: 1)
psnr print the PSNR (peak signal to noise ratio) for the whole video after encoding and store the per frame PSNR in a file with a name like 'psnr_hhmmss.log'.  Returned values are in dB (decibel), the higher the better.
mpeg_quant Use MPEG quantizers instead of H.263.
aic Enable AC prediction for MPEG-4 or advanced intra prediction for H.263+.  This will improve quality very slightly (around 0.02 dB PSNR) and slow down encoding very slightly (about 1%). NOTE: vqmin should be 8 or larger for H.263+ AIC.
aiv alternative inter vlc for H.263+
umv unlimited MVs (H.263+ only) Allows encoding of arbitrarily long MVs.
ibias=<-256-256> intra quantizer bias (256 equals 1.0, MPEG style quantizer default: 96, H.263 style quantizer default: 0) NOTE: The H.263 MMX quantizer cannot handle positive biases (set vfdct=1 or 2), the MPEG MMX quantizer cannot handle negative biases (set vfdct=1 or 2).
pbias=<-256-256> inter quantizer bias (256 equals 1.0, MPEG style quantizer default: 0, H.263 style quantizer default: -64) NOTE: The H.263 MMX quantizer cannot handle positive biases (set vfdct=1 or 2), the MPEG MMX quantizer cannot handle negative biases (set vfdct=1 or 2). HINT: A more positive bias (-32 - -16 instead of -64) seems to improve the PSNR.
nr=<0-100000> Noise reduction, 0 means disabled.  0-600 is a useful range for typical content, but you may want to turn it up a bit more for very noisy content (default: 0).  Given its small impact on speed, you might want to prefer to use this over filtering noise away with video filters like denoise3d or hqdn3d.
qns=<0-3> Quantizer noise shaping.  Rather than choosing quantization to most closely match the source video in the PSNR sense, it chooses quantization such that noise (usually ringing) will be masked by similar-frequency content in the image.  Larger values are slower but may not result in better quality.  This can and should be used together with trellis quantization, in which case the trellis quantization (optimal for constant weight) will be used as startpoint for the iterative search. 0    disabled (default) 1    Only lower the absolute value of coefficients. 2    Only change coefficients before the last non-zero coefficient + 1. 3    Try all.
inter_matrix=<comma separated matrix> Use custom inter matrix.  It needs a comma separated string of 64 integers.
intra_matrix=<comma separated matrix> Use custom intra matrix.  It needs a comma separated string of 64 integers.
vqmod_amp experimental quantizer modulation
vqmod_freq experimental quantizer modulation
dc intra DC precision in bits (default: 8).  If you specify vcodec=mpeg2video this value can be 8, 9, 10 or 11.
cgop (also see sc_threshold) Close all GOPs.  Currently it only works if scene change detection is disabled (sc_threshold=1000000000).
gmc Enable Global Motion Compensation.
(no)lowdelay Sets the low delay flag for MPEG-1/2 (disables B-frames).
vglobal=<0-3> Control writing global video headers. 0    Codec decides where to write global headers (default). 1    Write global headers only in extradata (needed for .mp4/MOV/NUT). 2    Write global headers only in front of keyframes. 3    Combine 1 and 2.
aglobal=<0-3> Same as vglobal for audio headers.
level=<value> Set CodecContext Level.  Use 31 or 41 to play video on a Playstation 3.
skip_exp=<0-1000000> FIXME: Document this.
skip_factor=<0-1000000> FIXME: Document this.
skip_threshold=<0-1000000> FIXME: Document this.
nuv (-nuvopts) Nuppel video is based on RTJPEG and LZO.  By default frames are first encoded with RTJPEG and then compressed with LZO, but it is possible to disable either or both of the two passes.  As a result, you can in fact output raw i420, LZO compressed i420, RTJPEG, or the default LZO compressed RTJPEG. NOTE: The nuvrec documentation contains some advice and examples about the settings to use for the most common TV encodings.
c=<0-20> chrominance threshold (default: 1)
l=<0-20> luminance threshold (default: 1)
lzo Enable LZO compression (default).
nolzo Disable LZO compression.
q=<3-255> quality level (default: 255)
raw Disable RTJPEG encoding.
rtjpeg Enable RTJPEG encoding (default).
xvidenc (-xvidencopts) There are three modes available: constant bitrate (CBR), fixed quantizer and two pass.
pass=<1|2> Specify the pass in two pass mode.
turbo (two pass only) Dramatically speeds up pass one using faster algorithms and disabling CPU-intensive options.  This will probably reduce global PSNR a little bit and change individual frame type and PSNR a little bit more.
bitrate=<value> (CBR or two pass mode) Sets the bitrate to be used in kbits/second if <16000 or in bits/ second if >16000.  If <value> is negative, Xvid will use its absolute value as the target size (in kBytes) of the video and compute the associated bitrate automagically (default: 687 kbits/s).
fixed_quant=<1-31> Switch to fixed quantizer mode and specify the quantizer to be used.
zones=<zone0>[/<zone1>[/...]] (CBR or two pass mode) User specified quality for specific parts (ending, credits, ...). Each zone is <start-frame>,<mode>,<value> where <mode> may be q    Constant quantizer override, where value=<2.0-31.0> represents the quantizer value. w    Ratecontrol weight override, where value=<0.01-2.00> represents the quality correction in %.
EXAMPLE: zones=90000,q,20 Encodes all frames starting with frame 90000 at constant quantizer 20. zones=0,w,0.1/10001,w,1.0/90000,q,20 Encode frames 0-10000 at 10% bitrate, encode frames 90000 up to the end at constant quantizer 20.  Note that the second zone is needed to delimit the first zone, as without it everything up until frame 89999 would be encoded at 10% bitrate.
me_quality=<0-6> This option controls the motion estimation subsystem.  The higher the value, the more precise the estimation should be (default: 6). The more precise the motion estimation is, the more bits can be saved.  Precision is gained at the expense of CPU time so decrease this setting if you need realtime encoding.
(no)qpel MPEG-4 uses a half pixel precision for its motion search by default.  The standard proposes a mode where encoders are allowed to use quarter pixel precision.  This option usually results in a sharper image.  Unfortunately it has a great impact on bitrate and sometimes the higher bitrate use will prevent it from giving a better image quality at a fixed bitrate.  It is better to test with and without this option and see whether it is worth activating.
(no)gmc Enable Global Motion Compensation, which makes Xvid generate special frames (GMC-frames) which are well suited for Pan/Zoom/ Rotating images.  Whether or not the use of this option will save bits is highly dependent on the source material.
(no)trellis Trellis Quantization is a kind of adaptive quantization method that saves bits by modifying quantized coefficients to make them more compressible by the entropy encoder.  Its impact on quality is good, and if VHQ uses too much CPU for you, this setting can be a good alternative to save a few bits (and gain quality at fixed bitrate) at a lesser cost than with VHQ (default: on).
(no)cartoon Activate this if your encoded sequence is an anime/cartoon.  It modifies some Xvid internal thresholds so Xvid takes better decisions on frame types and motion vectors for flat looking cartoons.
(no)chroma_me The usual motion estimation algorithm uses only the luminance information to find the best motion vector.  However for some video material, using the chroma planes can help find better vectors.  This setting toggles the use of chroma planes for motion estimation (default: on).
(no)chroma_opt Enable a chroma optimizer prefilter.  It will do some extra magic on color information to minimize the stepped-stairs effect on edges.  It will improve quality at the cost of encoding speed.  It reduces PSNR by nature, as the mathematical deviation to the original picture will get bigger, but the subjective image quality will raise.  Since it works with color information, you might want to turn it off when encoding in grayscale.
(no)hq_ac Activates high-quality prediction of AC coefficients for intra frames from neighbor blocks (default: on).
vhq=<0-4> The motion search algorithm is based on a search in the usual color domain and tries to find a motion vector that minimizes the difference between the reference frame and the encoded frame. With this setting activated, Xvid will also use the frequency domain (DCT) to search for a motion vector that minimizes not only the spatial difference but also the encoding length of the block. Fastest to slowest: 0    off 1    mode decision (inter/intra MB) (default) 2    limited search 3    medium search 4    wide search
(no)lumi_mask Adaptive quantization allows the macroblock quantizers to vary inside each frame.  This is a 'psychosensory' setting that is supposed to make use of the fact that the human eye tends to notice fewer details in very bright and very dark parts of the picture.  It compresses those areas more strongly than medium ones, which will save bits that can be spent again on other frames, raising overall subjective quality and possibly reducing PSNR.
(no)grayscale Make Xvid discard chroma planes so the encoded video is grayscale only.  Note that this does not speed up encoding, it just prevents chroma data from being written in the last stage of encoding.
(no)interlacing Encode the fields of interlaced video material.  Turn this option on for interlaced content. NOTE: Should you rescale the video, you would need an interlace- aware resizer, which you can activate with -vf scale=<width>:<height>:1.
min_iquant=<0-31> minimum I-frame quantizer (default: 2)
max_iquant=<0-31> maximum I-frame quantizer (default: 31)
min_pquant=<0-31> minimum P-frame quantizer (default: 2)
max_pquant=<0-31> maximum P-frame quantizer (default: 31)
min_bquant=<0-31> minimum B-frame quantizer (default: 2)
max_bquant=<0-31> maximum B-frame quantizer (default: 31)
min_key_interval=<value> (two pass only) minimum interval between keyframes (default: 0)
max_key_interval=<value> maximum interval between keyframes (default: 10*fps)
quant_type=<h263|mpeg> Sets the type of quantizer to use.  For high bitrates, you will find that MPEG quantization preserves more detail.  For low bitrates, the smoothing of H.263 will give you less block noise. When using custom matrices, MPEG quantization must be used.
quant_intra_matrix=<filename> Load a custom intra matrix file.  You can build such a file with xvid4conf's matrix editor.
quant_inter_matrix=<filename> Load a custom inter matrix file.  You can build such a file with xvid4conf's matrix editor.
keyframe_boost=<0-1000> (two pass mode only) Shift some bits from the pool for other frame types to intra frames, thus improving keyframe quality.  This amount is an extra percentage, so a value of 10 will give your keyframes 10% more bits than normal (default: 0).
kfthreshold=<value> (two pass mode only) Works together with kfreduction.  Determines the minimum distance below which you consider that two frames are considered consecutive and treated differently according to kfreduction (default: 10).
kfreduction=<0-100> (two pass mode only) The above two settings can be used to adjust the size of keyframes that you consider too close to the first (in a row).  kfthreshold sets the range in which keyframes are reduced, and kfreduction determines the bitrate reduction they get.  The last I-frame will get treated normally (default: 30).
max_bframes=<0-4> Maximum number of B-frames to put between I/P-frames (default: 2).
bquant_ratio=<0-1000> quantizer ratio between B- and non-B-frames, 150=1.50 (default: 150)
bquant_offset=<-1000-1000> quantizer offset between B- and non-B-frames, 100=1.00 (default: 100)
bf_threshold=<-255-255> This setting allows you to specify what priority to place on the use of B-frames.  The higher the value, the higher the probability of B-frames being used (default: 0).  Do not forget that B-frames usually have a higher quantizer, and therefore aggressive production of B-frames may cause worse visual quality.
(no)closed_gop This option tells Xvid to close every GOP (Group Of Pictures bounded by two I-frames), which makes GOPs independent from each other.  This just implies that the last frame of the GOP is either a P-frame or a N-frame but not a B-frame.  It is usually a good idea to turn this option on (default: on).
(no)packed This option is meant to solve frame-order issues when encoding to container formats like AVI that cannot cope with out-of-order frames.  In practice, most decoders (both software and hardware) are able to deal with frame-order themselves, and may get confused when this option is turned on, so you can safely leave if off, unless you really know what you are doing. WARNING: This will generate an illegal bitstream, and will not be decodable by ISO-MPEG-4 decoders except DivX/libavcodec/Xvid. WARNING: This will also store a fake DivX version in the file so the bug autodetection of some decoders might be confused.
frame_drop_ratio=<0-100> (max_bframes=0 only) This setting allows the creation of variable framerate video streams.  The value of the setting specifies a threshold under which, if the difference of the following frame to the previous frame is below or equal to this threshold, a frame gets not coded (a so called n-vop is placed in the stream).  On playback, when reaching an n-vop the previous frame will be displayed. WARNING: Playing with this setting may result in a jerky video, so use it at your own risks!
rc_reaction_delay_factor=<value> This parameter controls the number of frames the CBR rate controller will wait before reacting to bitrate changes and compensating for them to obtain a constant bitrate over an averaging range of frames.
rc_averaging_period=<value> Real CBR is hard to achieve.  Depending on the video material, bitrate can be variable, and hard to predict.  Therefore Xvid uses an averaging period for which it guarantees a given amount of bits (minus a small variation).  This settings expresses the "number of frames" for which Xvid averages bitrate and tries to achieve CBR.
rc_buffer=<value> size of the rate control buffer
curve_compression_high=<0-100> This setting allows Xvid to take a certain percentage of bits away from high bitrate scenes and give them back to the bit reservoir. You could also use this if you have a clip with so many bits allocated to high-bitrate scenes that the low(er)-bitrate scenes start to look bad (default: 0).
curve_compression_low=<0-100> This setting allows Xvid to give a certain percentage of extra bits to the low bitrate scenes, taking a few bits from the entire clip.  This might come in handy if you have a few low-bitrate scenes that are still blocky (default: 0).
overflow_control_strength=<0-100> During pass one of two pass encoding, a scaled bitrate curve is computed.  The difference between that expected curve and the result obtained during encoding is called overflow.  Obviously, the two pass rate controller tries to compensate for that overflow, distributing it over the next frames.  This setting controls how much of the overflow is distributed every time there is a new frame.  Low values allow lazy overflow control, big rate bursts are compensated for more slowly (could lead to lack of precision for small clips).  Higher values will make changes in bit redistribution more abrupt, possibly too abrupt if you set it too high, creating artifacts (default: 5). NOTE: This setting impacts quality a lot, play with it carefully!
max_overflow_improvement=<0-100> During the frame bit allocation, overflow control may increase the frame size.  This parameter specifies the maximum percentage by which the overflow control is allowed to increase the frame size, compared to the ideal curve allocation (default: 5).
max_overflow_degradation=<0-100> During the frame bit allocation, overflow control may decrease the frame size.  This parameter specifies the maximum percentage by which the overflow control is allowed to decrease the frame size, compared to the ideal curve allocation (default: 5).
container_frame_overhead=<0...> Specifies a frame average overhead per frame, in bytes.  Most of the time users express their target bitrate for video w/o taking care of the video container overhead.  This small but (mostly) constant overhead can cause the target file size to be exceeded. Xvid allows users to set the amount of overhead per frame the container generates (give only an average per frame).  0 has a special meaning, it lets Xvid use its own default values (default: 24 - AVI average overhead).
profile=<profile_name> Restricts options and VBV (peak bitrate over a short period) according to the Simple, Advanced Simple and DivX profiles.  The resulting videos should be playable on standalone players adhering to these profile specifications. unrestricted no restrictions (default) sp0 simple profile at level 0 sp1 simple profile at level 1 sp2 simple profile at level 2 sp3 simple profile at level 3 sp4a simple profile at level 4a sp5 simple profile at level 5 sp6 simple profile at level 6 asp0 advanced simple profile at level 0 asp1 advanced simple profile at level 1 asp2 advanced simple profile at level 2 asp3 advanced simple profile at level 3 asp4 advanced simple profile at level 4 asp5 advanced simple profile at level 5 dxnhandheld DXN handheld profile dxnportntsc DXN portable NTSC profile dxnportpal DXN portable PAL profile dxnhtntsc DXN home theater NTSC profile dxnhtpal DXN home theater PAL profile dxnhdtv DXN HDTV profile NOTE: These profiles should be used in conjunction with an appropriate -ffourcc.  Generally DX50 is applicable, as some players do not recognize Xvid but most recognize DivX.
par=<mode> Specifies the Pixel Aspect Ratio mode (not to be confused with DAR, the Display Aspect Ratio).  PAR is the ratio of the width and height of a single pixel.  So both are related like this: DAR = PAR * (width/height). MPEG-4 defines 5 pixel aspect ratios and one extended one, giving the opportunity to specify a specific pixel aspect ratio.  5 standard modes can be specified: vga11 It is the usual PAR for PC content.  Pixels are a square unit. pal43 PAL standard 4:3 PAR.  Pixels are rectangles. pal169 same as above ntsc43 same as above ntsc169 same as above (Do not forget to give the exact ratio.) ext Allows you to specify your own pixel aspect ratio with par_width and par_height. NOTE: In general, setting aspect and autoaspect options is enough.
par_width=<1-255> (par=ext only) Specifies the width of the custom pixel aspect ratio.
par_height=<1-255> (par=ext only) Specifies the height of the custom pixel aspect ratio.
aspect=<x/y | f (float value)> Store movie aspect internally, just like MPEG files.  Much nicer solution than rescaling, because quality is not decreased. MPlayer and a few others players will play these files correctly, others will display them with the wrong aspect.  The aspect parameter can be given as a ratio or a floating point number.
(no)autoaspect Same as the aspect option, but automatically computes aspect, taking into account all the adjustments (crop/expand/scale/etc.) made in the filter chain.
psnr Print the PSNR (peak signal to noise ratio) for the whole video after encoding and store the per frame PSNR in a file with a name like 'psnr_hhmmss.log' in the current directory.  Returned values are in dB (decibel), the higher the better.
debug Save per-frame statistics in ./xvid.dbg. (This is not the two pass control file.)
The following options are only available in Xvid 1.1.x and later.
bvhq=<0|1> This setting allows vector candidates for B-frames to be used for the encoding chosen using a rate distortion optimized operator, which is what is done for P-frames by the vhq option.  This produces nicer-looking B-frames while incurring almost no performance penalty (default: 1).
vbv_bufsize=<0...> (two pass mode only) Specify the video buffering verifier (VBV) buffer size in bits (default: 0 - VBV check disabled).  VBV allows restricting peak bitrate to make the video play properly on hardware players.  For example, the Home profile uses vbv_bufsize=3145728.  If you set vbv_bufsize you should set also vbv_maxrate.  Note that there is no vbv_peakrate because Xvid does not actually use it for bitrate controlling; the other VBV options are enough to restrict the peak bitrate.
vbv_initial=<0...vbv_bufsize> (two pass mode only) Specify the initial fill of the VBV buffer in bits (default: 75% of vbv_bufsize).  The default is probably what you want.
vbv_maxrate=<0...> (two pass mode only) Specify the maximum processing rate in bits/s (default: 0).  For example, the Home profile uses vbv_maxrate=4854000.
The following option is only available in Xvid 1.2.x and later.
threads=<0-n> Create n threads to run the motion estimation (default: 0).  The maximum number of threads that can be used is the picture height divided by 16.
x264enc (-x264encopts) bitrate=<value> Sets the average bitrate to be used in kbits/second (default: off).  Since local bitrate may vary, this average may be inaccurate for very short videos (see ratetol).  Constant bitrate can be achieved by combining this with vbv_maxrate, at significant reduction in quality.
qp=<0-51> This selects the quantizer to use for P-frames.  I- and B-frames are offset from this value by ip_factor and pb_factor, respectively.  20-40 is a useful range.  Lower values result in better fidelity, but higher bitrates.  0 is lossless.  Note that quantization in H.264 works differently from MPEG-1/2/4: H.264's quantization parameter (QP) is on a logarithmic scale.  The mapping is approximately H264QP = 12 + 6*log2(MPEGQP).  For example, MPEG at QP=2 is equivalent to H.264 at QP=18.  Generally, this option should be avoided and crf should be used instead as crf will yield better visual results for the same size.
crf=<1.0-50.0> Enables constant quality mode, and selects the quality.  The scale is similar to QP.  Like the bitrate-based modes, this allows each frame to use a different QP based on the frame's complexity.  This option should generally be used instead of qp.
crf_max=<float> With CRF and VBV, limit RF to this value (may cause VBV underflows!).
pass=<1-3> Enable 2 or 3-pass mode.  It is recommended to always encode in 2 or 3-pass mode as it leads to a better bit distribution and improves overall quality. 1    first pass 2    second pass (of two pass encoding) 3    Nth pass (second and third passes of three pass encoding) Here is how it works, and how to use it: The first pass (pass=1) collects statistics on the video and writes them to a file.  You might want to deactivate some CPU- hungry options, apart from the ones that are on by default. In two pass mode, the second pass (pass=2) reads the statistics file and bases ratecontrol decisions on it. In three pass mode, the second pass (pass=3, that is not a typo) does both: It first reads the statistics, then overwrites them. You can use all encoding options, except very CPU-hungry options. The third pass (pass=3) is the same as the second pass, except that it has the second pass' statistics to work from.  You can use all encoding options, including CPU-hungry ones. The first pass may use either average bitrate or constant quantizer.  ABR is recommended, since it does not require guessing a quantizer.  Subsequent passes are ABR, and must specify bitrate.
profile=<name> Constrain options to be compatible with an H.264 profile. baseline no8x8dct bframes=0 nocabac cqm=flat weightp=0 nointerlaced qp>0 main no8x8dct cqm=flat qp>0 high qp>0 (default)
preset=<name> Use a preset to select encoding settings. ultrafast no8x8dct aq_mode=0 b_adapt=0 bframes=0 nodeblock nombtree me=dia nomixed_refs partitions=none ref=1 scenecut=0 subq=0 trellis=0 noweight_b weightp=0 superfast nombtree me=dia nomixed_refs partitions=i8x8,i4x4 ref=1 subq=1 trellis=0 weightp=0 veryfast nombtree nomixed_refs ref=1 subq=2 trellis=0 weightp=0 faster nomixed_refs rc_lookahead=20 ref=5 subq=4 weightp=1 fast rc_lookahead=30 ref=2 subq=6 medium Default settings apply. slow b_adapt=2 direct=auto me=umh rc_lookahead=50 ref=5 subq=8 slower b_adapt=2 direct=auto me=umh partitions=all rc_lookahead=60 ref=8 subq=9 trellis=2 veryslow b_adapt=2 b_frames=8 direct=auto me=umh me_range=24 partitions=all ref=16 subq=10 trellis=2 rc_lookahead=60 placebo bframes=16 b_adapt=2 direct=auto nofast_pskip me=tesa me_range=24 partitions=all rc_lookahead=60 ref=16 subq=10 trellis=2
tune=<name,[name,...]> Tune the settings for a particular type of source or situation. All tuned settings are overridden by explicit user-settings. Multiple tunings are separated by commas, but only one psy tuning can be used at a time. film (psy tuning) deblock=-1,-1 psy-rd=<unset>,0.15 animation (psy tuning) b_frames={+2} deblock=1,1 psy-rd=0.4:<unset> aq_strength=0.6 ref={double if >1 else 1} grain (psy tuning) aq_strength=0.5 nodct_decimate deadzone_inter=6 deadzone_intra=6 deblock=-2,-2 ipratio=1.1 pbratio=1.1 psy-rd=<unset>,0.25 qcomp=0.8 stillimage (psy tuning) aq_strength=1.2 deblock=-3,-3 psy-rd=2.0,0.7 psnr (psy tuning) aq_mode=0 nopsy ssim (psy tuning) aq_mode=2 nopsy fastdecode nocabac nodeblock noweight_b weightp=0 zerolatency bframes=0 force_cfr rc_lookahead=0 sync_lookahead=0 sliced_threads
slow_firstpass Disables the following faster options with pass=1: no_8x8dct me=dia partitions=none ref=1 subq={2 if >2 else unchanged} trellis=0 fast_pskip.  These settings significantly improve encoding speed while having little or no impact on the quality of the final pass. This option is implied with preset=placebo.
keyint=<value> Sets maximum interval between IDR-frames (default: 250).  Larger values save bits, thus improve quality, at the cost of seeking precision.  Unlike MPEG-1/2/4, H.264 does not suffer from DCT drift with large values of keyint.
keyint_min=<1-keyint/2> Sets minimum interval between IDR-frames (default: auto).  If scenecuts appear within this interval, they are still encoded as I-frames, but do not start a new GOP.  In H.264, I-frames do not necessarily bound a closed GOP because it is allowable for a P- frame to be predicted from more frames than just the one frame before it (also see frameref).  Therefore, I-frames are not necessarily seekable.  IDR-frames restrict subsequent P-frames from referring to any frame prior to the IDR-frame.
scenecut=<-1-100> Controls how aggressively to insert extra I-frames (default: 40). With small values of scenecut, the codec often has to force an I- frame when it would exceed keyint.  Good values of scenecut may find a better location for the I-frame.  Large values use more I- frames than necessary, thus wasting bits.  -1 disables scene-cut detection, so I-frames are inserted only once every other keyint frames, even if a scene-cut occurs earlier.  This is not recommended and wastes bitrate as scenecuts encoded as P-frames are just as big as I-frames, but do not reset the "keyint counter".
(no)intra_refresh Periodic intra block refresh instead of keyframes (default: disabled).  This option disables IDR-frames, and, instead, uses a moving vertical bar of intra-coded blocks. This reduces compression efficiency but benefits low-latency streaming and resilience to packet loss.
frameref=<1-16> Number of previous frames used as predictors in B- and P-frames (default: 3).  This is effective in anime, but in live-action material the improvements usually drop off very rapidly above 6 or so reference frames.  This has no effect on decoding speed, but does increase the memory needed for decoding.  Some decoders can only handle a maximum of 15 reference frames.
bframes=<0-16> maximum number of consecutive B-frames between I- and P-frames (default: 3)
(no)b_adapt Automatically decides when to use B-frames and how many, up to the maximum specified above (default: on).  If this option is disabled, then the maximum number of B-frames is used.
b_bias=<-100-100> Controls the decision performed by b_adapt.  A higher b_bias produces more B-frames (default: 0).
b_pyramid=<normal|strict|none> Allows B-frames to be used as references for predicting other frames.  For example, consider 3 consecutive B-frames: I0 B1 B2 B3 P4.  Without this option, B-frames follow the same pattern as MPEG-[124].  So they are coded in the order I0 P4 B1 B2 B3, and all the B-frames are predicted from I0 and P4.  With this option, they are coded as I0 P4 B2 B1 B3.  B2 is the same as above, but B1 is predicted from I0 and B2, and B3 is predicted from B2 and P4. This usually results in slightly improved compression, at almost no speed cost.  However, this is an experimental option: it is not fully tuned and may not always help.  Requires bframes >= 2. Disadvantage: increases decoding delay to 2 frames. normal Allow B-frames as references as described above (not Blu- ray compatible). strict Disallow P-frames referencing B-frames. Gives worse compression, but is required for Blu-ray compatibility. none Disable using B-frames as references.
(no)open_gop Use recovery points to close GOPs; only available with bframes.
(no)bluray_compat Enable compatibility hacks for Blu-Ray support.
(no)fake_interlaced Flag stream as interlaced but encode progressive. Makes it posssible to encode 25p and 30p Blu-Ray streams. Ignored in interlaced mode.
frame_packing=<0-5> Define frame arrangement for stereoscopic videos. 0    Checkerboard - pixels are alternately from L and R. 1    Column alternation - L and R are interlaced by column. 2    Row alternation - L and R are interlaced by row. 3    Side by side - L is on the left, R is on the right. 4    Top-bottom - L is on top, R is on the bottom. 5    Frame alternation - one view per frame.
(no)deblock Use deblocking filter (default: on).  As it takes very little time compared to its quality gain, it is not recommended to disable it.
deblock=<-6-6>,<-6-6> The first parameter is AlphaC0 (default: 0).  This adjusts thresholds for the H.264 in-loop deblocking filter.  First, this parameter adjusts the maximum amount of change that the filter is allowed to cause on any one pixel.  Secondly, this parameter affects the threshold for difference across the edge being filtered.  A positive value reduces blocking artifacts more, but will also smear details. The second parameter is Beta (default: 0).  This affects the detail threshold.  Very detailed blocks are not filtered, since the smoothing caused by the filter would be more noticeable than the original blocking. The default behavior of the filter almost always achieves optimal quality, so it is best to either leave it alone, or make only small adjustments.  However, if your source material already has some blocking or noise which you would like to remove, it may be a good idea to turn it up a little bit.
(no)cabac Use CABAC (Context-Adaptive Binary Arithmetic Coding) (default: on).  Slightly slows down encoding and decoding, but should save 10-15% bitrate.  Unless you are looking for decoding speed, you should not disable it.
qp_min=<1-51> (ABR or two pass) Minimum quantizer, 10-30 seems to be a useful range (default: 10).
qp_max=<1-51> (ABR or two pass) maximum quantizer (default: 51)
qp_step=<1-50> (ABR or two pass) maximum value by which the quantizer may be incremented/decremented between frames (default: 4)
(no)mbtree Enable macroblock tree ratecontrol (default: enabled).  Use a large lookahead to track temporal propagation of data and weight quality accordingly.  In multi-pass mode, this writes to a separate stats file named <passlogfile>.mbtree.
rc_lookahead=<0-250> Adjust the mbtree lookahead distance (default: 40).  Larger values will be slower and cause x264 to consume more memory, but can yield higher quality.
ratetol=<0.1-100.0> (ABR or two pass) allowed variance in average bitrate (no particular units) (default: 1.0)
vbv_maxrate=<value> (ABR or two pass) maximum local bitrate, in kbits/second (default: disabled)
vbv_bufsize=<value> (ABR or two pass) averaging period for vbv_maxrate, in kbits (default: none, must be specified if vbv_maxrate is enabled)
vbv_init=<0.0-1.0> (ABR or two pass) initial buffer occupancy, as a fraction of vbv_bufsize (default: 0.9)
ip_factor=<value> quantizer factor between I- and P-frames (default: 1.4)
pb_factor=<value> quantizer factor between P- and B-frames (default: 1.3)
qcomp=<0-1> (ABR or two pass) quantizer compression (default: 0.6).  A lower value makes the bitrate more constant, while a higher value makes the quantization parameter more constant.
cplx_blur=<0-999> (two pass only) Temporal blur of the estimated frame complexity, before curve compression (default: 20).  Lower values allow the quantizer value to jump around more, higher values force it to vary more smoothly. cplx_blur ensures that each I-frame has quality comparable to the following P-frames, and ensures that alternating high and low complexity frames (e.g. low fps animation) do not waste bits on fluctuating quantizer.
qblur=<0-99> (two pass only) Temporal blur of the quantization parameter, after curve compression (default: 0.5).  Lower values allow the quantizer value to jump around more, higher values force it to vary more smoothly.
zones=<zone0>[/<zone1>[/...]] User specified quality for specific parts (ending, credits, ...). Each zone is <start-frame>,<end-frame>,<option> where option may be q=<0-51> quantizer b=<0.01-100.0> bitrate multiplier NOTE: The quantizer option is not strictly enforced.  It affects only the planning stage of ratecontrol, and is still subject to overflow compensation and qp_min/qp_max.
direct_pred=<name> Determines the type of motion prediction used for direct macroblocks in B-frames. none Direct macroblocks are not used. spatial Motion vectors are extrapolated from neighboring blocks. (default) temporal Motion vectors are extrapolated from the following P- frame. auto The codec selects between spatial and temporal for each frame. Spatial and temporal are approximately the same speed and PSNR, the choice between them depends on the video content.  Auto is slightly better, but slower.  Auto is most effective when combined with multipass.  direct_pred=none is both slower and lower quality.
weightp Weighted P-frame prediction mode (default: 2). 0    disabled (fastest) 1    weighted refs (better quality) 2    weighted refs + duplicates (best)
(no)weight_b Use weighted prediction in B-frames.  Without this option, bidirectionally predicted macroblocks give equal weight to each reference frame.  With this option, the weights are determined by the temporal position of the B-frame relative to the references. Requires bframes > 1.
partitions=<list> Enable some optional macroblock types (default: p8x8,b8x8,i8x8,i4x4). p8x8 Enable types p16x8, p8x16, p8x8. p4x4 Enable types p8x4, p4x8, p4x4.  p4x4 is recommended only with subq >= 5, and only at low resolutions. b8x8 Enable types b16x8, b8x16, b8x8. i8x8 Enable type i8x8.  i8x8 has no effect unless 8x8dct is enabled. i4x4 Enable type i4x4. all  Enable all of the above types. none Disable all of the above types. Regardless of this option, macroblock types p16x16, b16x16, and i16x16 are always enabled. The idea is to find the type and size that best describe a certain area of the picture.  For example, a global pan is better represented by 16x16 blocks, while small moving objects are better represented by smaller blocks.