diff options
-rw-r--r-- | DOCS/en/mplayer.1 | 193 | ||||
-rw-r--r-- | DOCS/tech/TODO | 2 | ||||
-rw-r--r-- | DOCS/tech/libavc-options.txt | 432 |
3 files changed, 130 insertions, 497 deletions
diff --git a/DOCS/en/mplayer.1 b/DOCS/en/mplayer.1 index 0406fcce93..bcb7c3c29a 100644 --- a/DOCS/en/mplayer.1 +++ b/DOCS/en/mplayer.1 @@ -1772,7 +1772,7 @@ It's autodetected on MPEG files, but can't be autodetected on most AVI files. Flip image upside\-down. .TP .B \-lavdopts <option1:option2:...> (DEBUG CODE) -If decoding with a codec from libavcodec, you can specify its parameters here. +If decoding with libavcodec, you can specify its parameters here. .I EXAMPLE: .PD 0 @@ -1826,14 +1826,24 @@ manually work around encoder bugs: .br 8 (mpeg4): UMP4 (autodetected if fourcc==UMP4) .br -16 (mpeg4): padding bug +16 (mpeg4): padding bug (autodetected) .br 32 (mpeg4): illegal vlc bug (autodetected per fourcc) .br -64 (mpeg4): XVID and DIVX qpel bug (autodetected) +64 (mpeg4): XVID and DIVX qpel bug (autodetected per fourcc/ver) +.br +128 (mpeg4): old standard qpel (autodetected per fourcc/ver) +.br +256 (mpeg4): another qpel bug (autodetected per fourcc/ver) +.br +512 (mpeg4): direct-qpel-blocksize bug (autodetected per fourcc/ver) +.br +1024 (mpeg4): edge padding bug (autodetected per fourcc/ver) .REss .IPs idct=<0\-99> (see lavcopts) +For best decoding quality use the same idct algorithm for decoding and encoding. +This may come at a price in accuracy, though. .IPs gray grayscale only decoding (a bit faster than with color) .RE @@ -2203,7 +2213,7 @@ s: swap fields (exchange even & odd lines) .REss .IPs "field[=n]" Extracts a single field from interlaced image using stride arithmetic -to avoid wasting cpu time. The optional argument n specifies whether +to avoid wasting CPU time. The optional argument n specifies whether to extract the even or the odd field (depending on whether n is even or odd). .IPs "detc[=var1=value2:var2=value2:...]" @@ -2216,7 +2226,7 @@ dr: Set the frame dropping mode. 0 (default) means don't drop frames to maintain fixed output framerate. 1 means always drop a frame when there have been no drops or telecine merges in the past 5 frames. 2 means always maintain exact 5:4 input to output frame ratio. (Note: -use mode 1 with mencoder!) +use mode 1 with MEncoder!) .br am: Analysis mode. Available values are 0 (fixed pattern with initial frame number specified by fr=#) and 1 (agressive search for telecine @@ -2232,8 +2242,8 @@ tr0, tr1, tr2, tr3: Threshold values to be used in certain modes. .REss .IPs "telecine[=start]" Apply 3:2 "telecine" process to increase framerate by 20%. This most -likely will not work correctly with mplayer, but it can be used with -"mencoder -fps 29.97 -ofps 29.97 -vop telecine". Both fps options are +likely will not work correctly with mplayer, but it can be used +with 'mencoder -fps 29.97 -ofps 29.97 -vop telecine'. Both fps options are essential! (A/V sync will break if they are wrong.) The optional start parameter tells the filter where in the telecine pattern to start (0-3). @@ -2550,7 +2560,7 @@ variable bitrate method .br 1: mt .br -2: rh(default) +2: rh (default) .br 3: abr .br @@ -2628,7 +2638,7 @@ print additional options and informations on presets settings. . .TP .B \-lavcopts <option1:option2:...> -If encoding with a codec from libavcodec, you can specify its parameters +If encoding with libavcodec, you can specify its parameters here. .I EXAMPLE: @@ -2661,11 +2671,25 @@ rv10: an old RealVideo codec mpeg1video: MPEG1 video :) .REss .IPs vqmin=<1\-31> -minimum quantizer (pass\ 1/\:2) (default: 2) +minimum quantizer (pass\ 1/\:2) +.RSss +1: Not recommended (much larger file, little quality difference and weird side +effects: msmpeg4, h263 will be very low quality, ratecontrol will be confused +resulting in lower quality and some decoders will not be able to decode it). +.br +2: Recommended for normal mpeg4/mpeg1video encoding (default). +.br +3: Recommended for h263(p)/msmpeg4. The reason for preferring 3 over 2 is that +2 could lead to overflows (this will be fixed for h263(p) by changing the +quantizer per MB in the future, msmpeg4 cannot be fixed as it does not support +that) +.REss .IPs vqscale=<1\-31> -constant quantizer (selects fixed quantizer mode) (default: 0 (disabled)) +Constant quantizer /\: constant quality encoding (selects fixed quantizer mode). +A lower value means better quality but larger files (default: 0 (disabled)). +1 is not recommended (see \-vqmin for details). .IPs vqmax=<1\-31> -maximum quantizer (pass\ 1/\:2) (default: 31) +maximum quantizer (pass\ 1/\:2) 10\-31 should be a sane range (default: 31) .IPs mbqmin=<1\-31> minimum macroblock quantizer (pass\ 1/\:2) (default: 2) .IPs mbqmax=<1\-31> @@ -2677,50 +2701,64 @@ maximum number of B frames between non B frames: .RSss 0: no B frames (default) .br -0\-2: sane range +0\-2: sane range for MPEG4 .REss .IPs vme=<0\-5> motion estimation method: .RSss -0: none (very lq) +0: none (very low quality) .br 1: full (slow) .br -2: log (lq) +2: log (low quality) .br -3: phods (lq) +3: phods (low quality) .br 4: EPZS (default) .br 5: X1 (experimental) +Note: 0\-3 currently ignores the amount of Bits spent, so quality may be low. .REss .IPs vhq\ \ -high quality mode, encode each macro block in all modes an choose the smallest -(slow). -(default: HQ disabled) +high quality mode, encode each macro block in all modes and choose the best. +This is slow but results in better quality and file size. +(default: disabled) .IPs v4mv -4 motion vectors per macroblock (slightly better quality). +Allow 4 motion vectors per macroblock (slightly better quality). (default: disabled) .IPs keyint=<0\-300> -interval between keyframes in frames. -Larger numbers mean slightly smaller files, but less precise seeking, 0 means -no key frames and values >300 aren't recommended. -For a strict mpeg1/\:2/\:4 compliance this would have to be <=132. +maximum interval between keyframes in frames. +Keyframes are needed for seeking as seeking is only possible to a keyframe but +keyframes need more space than other frames so larger numbers here mean +slightly smaller files, but less precise seeking, 0 means no key frames. +Values >300 are not recommended as the quality might be bad depending upon +decoder, encoder and luck. +For a strict MPEG1/\:2/\:4 compliance this would have to be <=132. (default: 250 or one key frame every ten seconds in a 25fps movie) .IPs vb_strategy=<0\-1> strategy to choose between I/\:P/\:B frames (pass\ 2): .RSss 0: always use the maximum number of B frames (default) .br -1: avoid B frames in high motion scenes (bitrate mispredictions) +1: avoid B frames in high motion scenes (will cause bitrate misprediction) .REss .IPs vpass=<1\-2> -Activates internal 2pass mode (default: disabled): +Activates internal two pass mode, only specify if you wish to use two pass +encoding (default: disabled). .RSss 1: first pass .br 2: second pass .REss +.IPs +Tip: Try to use constant quantizer mode for pass one (vqscale=<quantizer>). +.br +huffyuv: +.RSss +pass 1 saves statistics +.br +pass 2 encodes with an optimal Huffman table based upon pass 1 statistics. +.REss .IPs aspect=<x/y> Store movie aspect internally, just like MPEG files. Much nicer solution than rescaling, because quality isn't decreased. @@ -2743,7 +2781,7 @@ Bit <16001\-24000000> (default: 800) .REss .IPs vratetol=<value> -approximated filesize tolerance in kbit. +approximated filesize tolerance in kBit. 1000\-100000 is a sane range. (warning: 1kBit = 1000 Bits) (default: 8000) .IPs vrc_maxrate=<value> @@ -2769,21 +2807,25 @@ I/\:B-Frame quantizer = P-Frame quantizer * v{b|i}_qfactor + v{b|i}_qoffset .br else .br -do normal ratecontrol (dont lock to next P frame quantizer) and set -q= -q * v{b|i}_qfactor + v{b|i}_qoffset +do normal ratecontrol (dont lock to next P frame quantizer) and +set q= -q * v{b|i}_qfactor + v{b|i}_qoffset +.IPs +Tip: To do constant quantizer encoding with different quantizers for +I/P and B frames you can use: +vqmin=<ip_quant>:vqmax=<ip_quant>:vb_qfactor=<b_quant/ip_quant> .IPs vqblur=<0.0\-1.0> -quantizer blur (pass1): +quantizer blur (pass1) Larger values will average the quantizer more over +time (slower change). .RSss 0.0: qblur disabled .br 0.5 (default) .br -1.0: average the quantizer over all previous frames, larger values will - average the quantizer more over time (slower change) +1.0: average the quantizer over all previous frames .REss .IPs vqblur=<0.0\-99.0> -quantizer gaussian blur, larger values will average the quantizer more over -time (slower change) (pass2) (default: 0.5) +quantizer gaussian blur (pass2) Larger values will average the quantizer more +over time (slower change) (default: 0.5) .IPs vqcomp=<value> quantizer compression, depends upon vrc_eq (pass\ 1/\:2) (default: 0.5) .IPs vrc_eq=<equation> @@ -2808,19 +2850,19 @@ iTex,pTex: intra, non intra texture complexity .br avgTex: average texture complexity .br -avgIITexaverage: intra texture complexity in I frames +avgIITex: average intra texture complexity in I frames .br -avgPITexaverage: intra texture complexity in P frames +avgPITex: average intra texture complexity in P frames .br -avgPPTexaverage: non intra texture complexity in P frames +avgPPTex: average non intra texture complexity in P frames .br -avgBPTexaverage: non intra texture complexity in B frames +avgBPTex: average non intra texture complexity in B frames .br -mv: bits used for MVs +mv: Bits used for motion vectors .br -fCode: maximum length of MV in log2 scale +fCode: maximum length of motion vector in log2 scale .br -iCount: number of intra MBs / number of MBs +iCount: number of intra macro blocks / number of macro blocks .br var: spatial complexity .br @@ -2845,28 +2887,27 @@ eq(a,b): is 1 if a==b, 0 otherwise sin, cos, tan, sinh, cosh, tanh, exp, log, abs . .IPs vrc_override=<options> -User specified quality for specific parts (pass\ 1/\:2). -The options are <start-frame, end-frame, quality[/\:start-frame, end-frame, -quality[/...]]>: +User specified quality for specific parts (ending, credits, ..) (pass\ 1/\:2). +The options are <start-frame>, <end-frame>, <quality>[/\:<start-frame>, +<end-frame>, <quality>[/...]]: .RSss quality 2\-31: quantizer .br -quality \-500\-0: quality correcture in % +quality \-500\-0: quality correction in % .REss .IPs vrc_init_cplx=<0\-1000> initial complexity (pass\ 1) -.IPs vqsquish=<0\-1> +.IPs vqsquish=<0,1> specify how to keep the quantizer between qmin and qmax (pass\ 1/\:2): .RSss -0: use cliping +0: use clipping .br 1: use a nice differentiable function (default) .REss .IPs vlelim=<-1000\-1000> 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): +or lower for encoding at quant=1): .RSss 0: disabled (default) .br @@ -2881,8 +2922,8 @@ or lower for encoding at quant=1): .br 7 (JVT recommendation) .REss -.IPs vstrict=<-1\-1> -(strict) standard compliance. +.IPs vstrict=<-1,0,1> +strict standard compliance .RSss 0: disabled (default) .br @@ -2890,12 +2931,26 @@ or lower for encoding at quant=1): reference decoder .br -1: allows non-standard YV12 huffyuv encoding (20% smaller files, but -can't be played back by the official huffyuv codec) +cannot be played by the official huffyuv codec) .REss .IPs vdpart data partitioning. -Adds 2 byte per video packet, improves error-resistance when transfering over +Adds 2 Bytes per video packet, improves error-resistance when transferring over unreliable channels (eg.\& streaming over the internet) +Each video packet will be encoded in 3 separate partitions: +.RSss +1. MVs (=movement) +.br +2. DC coefficients (=low res picture) +.br +3. AC coefficients (=details) +.REss +.IPs +MV & DC are most important, loosing them looks far worse than loosing 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. .IPs vpsize=<0\-10000> video packet size, improves error-resistance (see \-vdpart option too): .RSss @@ -2920,7 +2975,8 @@ dct algorithm: .REss .IPs idct=<0\-99> idct algorithm. -Note: all these IDCTs do pass the IEEE1180 tests afaik: +Note: To the best of our knowledge all these IDCTs do pass the IEEE1180 +tests. .RSss 0: automatically select a good one (default) .br @@ -2930,7 +2986,7 @@ Note: all these IDCTs do pass the IEEE1180 tests afaik: .br 3: simplemmx .br -4: libmpeg2mmx (inaccurate, DONT USE for encoding with keyint >100) +4: libmpeg2mmx (inaccurate, DON'T USE for encoding with keyint >100) .br 5: ps2 .br @@ -2940,8 +2996,8 @@ Note: all these IDCTs do pass the IEEE1180 tests afaik: .REss .IPs lumi_mask=<0.0\-1.0> luminance masking. -Warning: be careful, too large values can cause disasterous things. -Warning2: large values might look good on some monitors but may look horrible +Warning: Be careful, too large values can cause disastrous things. +Warning2: Large values might look good on some monitors but may look horrible on other monitors: .RSss 0.0: disabled (default) @@ -2964,7 +3020,8 @@ temporal complexity masking (default: 0.0 (disabled)) spatial complexity masking. Larger values help against blockiness, if no deblocking filter is used for decoding. -Crop any black borders to get better quality: +Tip: Crop any black borders completely as they will reduce the quality +of the macro blocks (also applies without scplx_mask). .RSss 0.0: disabled (default) .br @@ -2995,6 +3052,7 @@ YV12: default .REss .IPs qpel use quarter pel motion compensation +Tip: This seems only useful for high bitrate encodings. .IPs precmp=<0\-2000> comparison function for motion estimation pre pass .IPs cmp=<0\-2000> @@ -3010,15 +3068,15 @@ comparison function for sub pel motion estimation .br 3 (DCT): sum of absolute dct transformed differences .br -4 (PSNR): sum of the squared quantization errors +4 (PSNR): sum of the squared quantization errors (don't use, low quality) .br 5 (BIT): number of bits needed for the block .br -6 (RD): rate distoration optimal, slow +6 (RD): rate distortion optimal, slow .br 7 (ZERO): 0 .br -+256: use chroma too, doesnt work with b frames currently ++256: use chroma too, doesn't work (correctly) with B frames currently .REss .IPs predia=<\-99\-6> Diamond type and size for motion estimation pre pass @@ -3069,7 +3127,8 @@ Amount of motion predictors from the previous frame .RSss 0: (default) .br -a: will use 2a+1 x 2a+1 MB square of MV predictors from the previous frame +a: will use 2a+1 x 2a+1 macro block square of motion vector predictors from +the previous frame .REss .IPs preme=<0\-2> motion estimation pre-pass @@ -3082,14 +3141,20 @@ motion estimation pre-pass .REss .IPs subq=<1\-8> subpel refinement quality (for qpel) (default: 8). -Note: this has a significant effect on the speed +Note: This has a significant effect on the speed. .IPs 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 name like 'psnr_012345.log'. +and store the per frame psnr in a file with a name like 'psnr_012345.log'. Return values are in dB (decibel), the higher the better. .IPs mpeg_quant use MPEG quantizers instead of H.263. (default: disabled) (i.e.\& use H.263 quantizers) +.IPs aic +advanced intra prediction (H.263+ only) +Note: vqmin should be 8 or larger. +.IPs umv +unlimited MVs (H.263+ only) +Allow encoding of abritarily long MVs. .RE . .TP diff --git a/DOCS/tech/TODO b/DOCS/tech/TODO index 8d91678c2a..b2da491ab4 100644 --- a/DOCS/tech/TODO +++ b/DOCS/tech/TODO @@ -104,7 +104,7 @@ FOR THE v0.90 RELEASE: ~~~~~~~~~~~~~~~~~~~~~~ - update the man page with all current options -- merge tech/vop.txt and tech/libavc-options.txt into the man page +- merge tech/vop.txt into the man page - merge tech/encoding-tips.txt into encoding.html - finish reviewing all of the docs - mplayer.1 diff --git a/DOCS/tech/libavc-options.txt b/DOCS/tech/libavc-options.txt deleted file mode 100644 index fcd3d84616..0000000000 --- a/DOCS/tech/libavc-options.txt +++ /dev/null @@ -1,432 +0,0 @@ -Description of what all those libavcodec options do ... -WARNING: I am no encoding expert so the recommendations might be bad ... -if you find any errors, missing stuff, ... send a patch or cvs commit if you -have an cvs account :) - -lavcopts: (encoder options) ---------------------------- - -vqmin 1-31 (minimum quantizer) for pass1/2 - 1 is not recommended (much larger file, little quality difference (if u are lucky) - and other weird things (if u are less lucky)) - weird things: msmpeg4, h263 will be very low quality - ratecontrol will be confused -> lower quality - some decoders will not be able to decode it - 2 is recommended for normal mpeg4/mpeg1video encoding (default) - 3 is recommended for h263(p)/msmpeg4 - the reason for 3 instead of 2 is that 2 could lead to overflows - (this will be fixed for h263(p) by changing the quanizer per MB in - the future, but msmpeg4 doesnt support that so it cant be fixed for - that) - -vqscale 1-31 quantizer for constant quantizer / constant quality encoding - 1 is not recommended (much larger file, little quality difference and - possible other weird things) - lower means better quality but larger files - see vqmin - -vqmax 1-31 (maximum quantizer) for pass1/2 - 31 default - 10-31 should be a sane range - -mbqmin 1-31 (minimum macroblock quantizer) for pass1/2 - 2 default - -mbqmax 1-31 (maximum macroblock quantizer) for pass1/2 - 31 default - -vqdiff 1-31 (maximum quantizer difference between I or P frames) for pass1/2 - 3 default - -vmax_b_frames 0-4 (maximum number of B frames between non B frames) - 0 no b frames (default) - 0-2 is a sane range for mpeg4 - -vme 0-5 (motion estimation) - 0 none (not recommanded, very lq) - 1 full (not recommanded, too slow) - 2 log (not recommanded, lq) - 3 phods (not recommanded, lq) - 4 EPZS (default) - 5 X1 (experimantal, might change from time to time or be just broken) - Note: 0-3 ignores the amount of bits spend currently, so dont complain - about low quality - -vhq (high quality mode) - encode each MB as in all modes and choose the best (this is slow but - better filesize/quality) - disabled by default - -v4mv - allow 4 MV per MB (little difference in filesize/quality) - disabled by default - -keyint 0-300 (maximum interval between keyframes) - keyframes are needed for seeking as seeking is only possible to a - keyframe but they need more space than non-keyframes so larger numbers here - mean slightly smaller files, but less precise seeking - 0 no keyframes - >300 is not recommended as the quality might be bad (depends upon - decoder, encoder and luck) - for strict mpeg1/2/4 compliance this would have to be <=132 - -vb_strategy 0-1 for pass 2 - 0 allways use the max number of B frames (default) - 1 avoid B frames in high motion scenes (this will cause bitrate - misprediction) - -vpass - 1 first pass - 2 second pass - (only need to specify if two-pass encoding is used) - Tip: u can try to use constant quantizer mode for pass1 (vqscale=<quantizer>) - for huffyuv: - pass 1 saves statistics - pass 2 encodes with a optimal huffman table based upon the pass 1 stats - -vbitrate (kbits per second) for pass1/2 - 800 is default - (if value is bigger then 16000 it is interpreted as bit not kbit!) - -vratetol (filesize tolerance in kbit) for pass1/2 - this is just an approximation, the real difference can be much smaller - or larger - 1000-100000 is a sane range - 8000 is default - -vrc_maxrate (maximum bitrate in kbit/sec) for pass1/2 -vrc_minrate (minimum bitrate in kbit/sec) for pass1/2 -vrc_buf_size (buffer size in kbit) for pass1/2 - this is for stuff like VCD - VCD: FIXME - SVCD: ... - DVD: ... - Note: vratetol should not be too large during the 2.pass or there might - be problems if vrc_(min|max)rate is used - -vb_qfactor (-31.0-31.0) for pass1/2 - 1.25 is default -vi_qfactor (-31.0-31.0) for pass1/2 - 0.8 is default -vb_qoffset (-31.0-31.0) for pass1/2 - 1.25 is default -vi_qoffset (-31.0-31.0) for pass1/2 - 0.0 is default - if v{b|i}_qfactor > 0 - I/B-Frame quantizer = P-Frame quantizer * v{b|i}_qfactor + v{b|i}_qoffset - else - do normal ratecontrol (dont lock to next P frame quantizer) and - set q= -q * v{b|i}_qfactor + v{b|i}_qoffset - tip: to do constant quantizer encoding with different quantizers for - I/P and B frames you can use: - vqmin=<ip_quant>:vqmax=<ip_quant>:vb_qfactor=<b_quant/ip_quant> - -vqblur (0.0-1.0) quantizer blur (pass1) - 0.0 qblur disabled - 0.5 is the default - 1.0 average the quantizer over all previous frames - larger values will average the quantizer more over time so that it will - be changed slower -vqblur (0.0-99.0) quantizer blur (pass2) - gaussian blur (gaussian blur cant be done during pass 1 as the future quantizers arent known) - 0.5 is the default - larger values will average the quantizer more over time so that it will - be changed slower - -vqcomp quantizer compression (for pass1/2) - depends upon vrc_eq - -vrc_eq the main ratecontrol equation (for pass1/2) - 1 constant bitrate - tex constant quality - 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: +,-,*,/,^ - variables: - 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 MVs - fCode maximum length of MV in log2 scale - iCount number of intra MBs / number of MBs - 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 ur 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 user specified quality for specific parts (ending credits ...) (for pass1/2) - <start-frame>,<end-frame>,<quality>[/<start-frame>,<end-frame>,<quality>[/...]] - quality 2..31 -> quantizer - quality -500..0 -> quality correcture in % - -vrc_init_cplx (0-1000) initial complexity for pass1 - -vqsquish (0 or 1) for pass1/2 how to keep the quantizer between qmin & qmax - 0 use cliping - 1 use a nice differentiable function (default) - -vlelim (-1000-1000) single coefficient elimination threshold for luminance - 0 disabled (default) - -4 (JVT recommendation) - negative values will allso consider the dc coefficient - should be at least -4 or lower for encoding at quant=1 - -vcelim (-1000-1000) single coefficient elimination threshold for chrominance - 0 disabled (default) - 7 (JVT recommendation) - negative values will allso consider the dc coefficient - should be at least -4 or lower for encoding at quant=1 - -vstrict (-1,0,1) strict standard compliance - 0 (default) - 1 only recommended if you want to feed the output into the mpeg4 reference - decoder - -1 allows nonstandard YV12 huffyuv encoding (20% smaller files, but - cant be played back by the official huffyuv codec) - -vdpart data partitioning - adds 2 byte per video packet - each videopacket will be encoded in 3 seperate partitions: - 1. MVs (=movement) - 2. DC coefficients (=low res picture) - 3. AC coefficients (=details) - the MV & DC are most important, loosing them looks far worse than - loosing the AC and the 1. & 2. partition (MV&DC) are far smaller than - the 3. partition (AC) -> errors will hit the AC partition much more - often than the MV&DC -> the picture will look better with partitioning - than without, as without partitining an error will trash AC/DC/MV - equally - improves error-resistance when transfering over unreliable channels (eg. - streaming over the internet) - -vpsize (0-10000) video packet size - 0 disabled (default) - 100-1000 good choice - improves error-resistance (see vdpart for more info) - -gray grayscale only encoding (a bit faster than with color ...) - -vfdct (0-99) dct algorithm - 0 automatically select a good one (default) - 1 fast integer - 2 accurate integer - 3 mmx - 4 mlib - -idct (0-99) idct algorithm - 0 automatically select a good one (default) - 1 jpeg reference integer - 2 simple - 3 simplemmx - 4 libmpeg2mmx (inaccurate, DONT USE for encoding with keyint >100) - 5 ps2 - 6 mlib - 7 arm - note: all these IDCTs do pass the IEEE1180 tests AFAIK - -lumi_mask (0.0-1.0) luminance masking - 0.0 disabled (default) - 0.0-0.3 should be a sane range - warning: be carefull, too large values can cause disasterous things - warning2: large values might look good on some monitors but may look horrible - on other monitors - -dark_mask (0.0-1.0) darkness masking - 0.0 disabled (default) - 0.0-0.3 should be a sane range - warning: be carefull, too large values can cause disasterous things - warning2: large values might look good on some monitors but may look horrible - on other monitors / TV / TFT - -tcplx_mask (0.0-1.0) temporal complexity masking - 0.0 disabled (default) - -scplx_mask (0.0-1.0) spatial complexity masking - 0.0 disabled (default) - 0.0-0.5 should be a sane range - larger values help against blockiness, if no deblocking filter is used - for decoding - Tip: crop any black borders completly away as they will reduce the quality - of the MBs there, this is true if scplx_mask isnt used at all too - -naq normalize adaptive quantization (experimental) - when using adaptive quantization (*_mask), the average per-MB quantizer - may no longer match the requested frame-level quantizer. using naq will - attempt to adjust the per-MB quantizers to maintain the proper average. - -ildct use interlaced dct - -format - YV12 (default) - 422P (for huffyuv) - -pred (for huffyuv) - 0 left prediction - 1 plane/gradient prediction - 2 median prediction - -qpel use quarter pel motion compensation - Tip: this seems only usefull for high bitrate encodings - -precmp comparission function for motion estimation pre pass -cmp comparission function for full pel motion estimation -subcmp comparission function for sub pel motion estimation -mbcmp comparission function for macroblock decission - 0 SAD (sum of absolute differences) (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 the squared quantization errors) (dont use, low quality) - 5 BIT (number of bits needed for the block) - 6 RD (rate distoration optimal, slow) - 7 ZERO (0) - +256 (use chroma too, doesnt work (correctly) with b frames currently) - Tip: SAD is fast, SATD is good, SSE is something in between - Tip2: when using SATD/DCT/BIT/RD for full pel search then a - larger diamond something like dia=2 or dia=4 might improve - quality, but only for some videos - Note: mbcmp is only used if hq mode is disabled - -predia (-99 - 6) diamond type & size for motion estimation pre pass -dia (-99 - 6) diamond type & size for motion estimation - ... - -3 shape adaptive diamond with size 3 - -2 shape adaptive diamond with size 2 - -1 experimental - 1 normal size=1 diamond (default) =EPZS type diamond - 0 - 000 - 0 - 2 normal size=2 diamond - 0 - 000 - 00000 - 000 - 0 - ... - Tip: the shape adaptive stuff seems to be faster at the same quality - Note: the sizes of the normal diamonds and shape adaptive ones dont - have the same meaning - -trell trellis quantization - this will find the optimal encoding for each 8x8 block - trellis quantization is quite simple a optimal quantization in the - PSNR vs 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 + lambda*bits - lambda is a qp dependant constant - bits is the amount of bits needed to encode the block - error is simple the sum of squared errors of the quantization - -last_pred (0-99) amount of motion predictors from the previous frame - 0 (default) - a -> will use 2a+1 x 2a+1 MB square of MV predictors from the previous frame - -preme (0-2) Motion estimation pre-pass - 0 disabled - 1 only after I frames (default) - 2 allways - -subq (1-8) subpel refinement quality (for qpel) - 8 (default) - Note: this has a significant effect on the speed - -psnr will print the psnr for the whole video after encoding and store the per frame psnr - in a file with name like "psnr_012345.log" - -aic advanced intra prediction (H.263+ only) - Note: vqmin should be 8 or larger - -umv unlimited MVs (H.263+ only) - allow encoding of abritary long MVs - - -lavdopts: (decoder options) ---------------------------- - -ec error concealment - 1 use strong deblock filter for damaged MBs - 2 iterative MV search (slow) - 3 all (default) - Note: just add the ones u want to enable - -er error resilience - 0 disabled - 1 carefull (should work with broken encoders) - 2 normal (default) (works with compliant encoders) - 3 agressive (more checks but might cause problems even for valid bitstreams) - 4 very agressive - -bug manual workaround encoder bugs (autodetection isnt foolproof for these) - 0 nothing - 1 autodetect bugs (default) - 2 for msmpeg4v3 some old lavc generated msmpeg4v3 files (no autodetect) - 4 for mpeg4 xvid interlacing bug (autodetected if fourcc==XVIX) - 8 for mpeg4 UMP4 (autodetected if fourcc==UMP4) - 16for mpeg4 padding bug (autodetected) - 32for mpeg4 illegal vlc bug (autodetected per fourcc) - 64for mpeg4 XVID&DIVX qpel bug (autodetected per fourcc/ver) - 128 mpeg4 old standard qpel (autodetected per fourcc/ver) - 256 mpeg4 another qpel bug (autodetected per fourcc/ver) - 512 mpeg4 direct-qpel-blocksize bug(autodetected per fourcc/ver) - 1024 mpeg4 edge padding bug (autodetected per fourcc/ver) - Note: just add the ones u want to enable - -gray grayscale only decoding (a bit faster than with color ...) - -idct see lavcopts - note: the decoding quality is highest if the same idct algorithm is used - for decoding as for encoding, this is often not the most accurate though - - -Notes: 1. lavc will strictly follow the quantizer limits vqmin, vqmax, vqdiff - even if it violates the bitrate / bitrate tolerance - 2. changing some options between pass1 & 2 can reduce the quality - -FAQ: Q: Why is the filesize much too small? - A: Try to increase vqmin=2 or 1 (be carefull with 1, it could cause - strange things to happen). - Q: What provides better error recovery while keeping the filesize low? - Should I use data partitioning or increase the number of video packets? - A: Data partitioning is better in this case. - -Glossary: -MB Macroblock (16x16 luminance and 8x8 chrominance samples) -MV Motion vector -ME Motion estimation -MC Motion compensation -RC Rate control -DCT Discrete Cosine Transform -IDCT Inverse Discrete Cosine Transform -DC The coefficient of the constant term in the DCT (avg value of block) -JVT Joint Video Team Standard -- http://www.itu.int/ITU-T/news/jvtpro.html -PSNR peak signal to noise ratio - -Examples: -mencoder foobar.avi -lavcopts vcodec=mpeg4:vhq:keyint=300:vqscale=2 -o new-foobar.avi -mplayer foobar.avi -lavdopts bug=1 - -Links: -short intro to mpeg coding: -http://www.eecs.umich.edu/~amarathe/mpeg.html -longer intro to jpeg/mpeg coding: -http://www.cs.sfu.ca/undergrad/CourseMaterials/CMPT479/material/notes/Chap4/Chap4.2/Chap4.2.html -ftp://ftp.tek.com/mbd/manuals/video_audio/25W_11418_4.pdf - --- -Written 2002 by Michael Niedermayer and reviewed by Felix Buenemann. -Check the MPlayer documentation for contact-addresses. - |