yuvdenoise(1)

NAME
yuvdenoise - Motion-Compensating-YUV4MPEG-frame-denoiser

SYNOPSIS
yuvdenoise [options] </dev/stdin >/dev/stdout

DESCRIPTION
yuvdenoise can be used to remove noise from movie images in an YUV4MPEG2 stream. This is useful to reduce the bitrate needed to encode your captured movies for VCD and SVCD creation.

OPTIONS
yuvdenoise accepts the following options:

-X Disable SIMD optimisations
    Disable the use of MMX/SSE enhancements if they would ordinarily be used. This is useful for testing to compare the C code against the SIMD code for timing and accuracy.

-t [0..255] Denoiser threshold
    Accept any image-error up to +/- threshold for a single pixel to be accepted as valid for the image. If the absolute error is greater than this, exchange the pixel with the corresponding pixel of the reference image. (default=5)

-l [1..255] frames for a time-lowpassed pixel
    Average 'n' frames for a time-lowpassed pixel. Values below 2 will lead to a good response to the reference frame, while larger values will cut out more noise (and as a drawback will lead to noticable artifacts on high motion scenes.) Values above 8 are allowed but rather useless. (default=3)

-r [8..24] search radius
    Limit the search radius to that value. Usually it will not make sense to go higher than 16, especially for VCD sizes. (default=8)

-b <x>,<y>,<w>,<h> Border Setting
    If you already know parts of the image are and remain black over the complete sequence of images you may use something like this: yuvdenoise -b 16,16,704,560 This will set all the pixels in the image outside that search window to pure black. The area outside the search window will not go into the motion compensation algorithm which may give a moderate speed gain in processing the movie. Sometimes it may be useful to have relative coordinates like this: yuvdenoise -b 16,16,-16,-16 Provided there is a PAL-frame with 720x576 pixels, both options will turn the same area into black.

-L [0..255] luminance contrast
    Set luminance (Y Contrast) in percent. (default=100) The default value of 100 skips performing luminance contrast adjustment entirely.

-C [0..255] chrominance contrast
    Set chrominance (Cr/Cb Contrast) in percent. AKA "Saturation" (default=100) The default value of 100 skips performing chrominance contract adjustment entirely.

-S [0..255] sharpness in percent
    Set sharpness in percent. WARNING: do not set too high as this will gain bit-noise. (default=0) A sharpness value of 0 will skip performing the sharpening pass (and speed up denoising about 20%).

-F deinterlacing
    Force deinterlacing. Default is to perform interlaced denoising.

-f fast mode
    Fast mode. Use only Pass II (bitnoise-reduction) for low to very low noise material. (default off)

-p [0..255] Pass II threshold
    Pass II threshold (same as -t). WARNING: If set to values greater than 8 you *will* see artifacts...(default=4)

-s num
    Number of beginning frames to skip. The first num frames are written to stdout unfiltered. This is useful for resuming an interrupted job without having to duplicate work.

HOW IT WORKS
Yuvdenoise works by temporal lowpass filtering. To avoid motion-blur it transforms the previous image with a motion-compensation as close as possible to the present frame. This motion-compensation is performed on 4x4 pixel blocks. The result is weighted and a block of the transformed previous frame is (depending on a matching coefficient) either taken in full, blended with the present image-block or discarded if the match is to bad. This procedure implies that the motion-compensation is very exact. If a video-encoder misses a transformed block it's not that bad, it only encodes a difference block there. If the denoiser fails to find a good matching block the only solution is to exchange the found block with the original frame block. Therefor a great amount of time is spent to find good matches. This is the main reason why the denoiser does not run at full framerate at CIF resolution as you might have wished.

TYPICAL USAGE AND TIPS
As it is self-adapting to the noise-situation found in the stream you normally just can go without any options set: lav2yuv my-video.avi | yuvdenoise | mpeg2enc -t 1 -o my-video.m1v However, to obtain the best possible result, you should take note of the following: 1. Grab at the maximum possible resolution (PAL 768x576 pixels). Do this even if you just want to create a 352x288 pixel movie as downscaling reduces noise (and at no cost to image-quality and/or sharpness in that case). 2. First denoise, then scale! There are some rare situations where the denoiser itself may introduce artifacts (blocks, etc...). The perceptibilty of these artifacts is reduced by this processing order. 3. If your movie contains black borders use the -b option to turn them into pure black. This helps the encoder use fewer bits to encode the data. 4. You can greatly improve the recorded quality if you use correct cables. Only use HF-in (the antenna-cable ...) if you really can't connect your VCR/Camcorder by other means (Composite, S-Video or SCART-RGB). 5. If your movie is B&W only, then try the -B switch. Having said all that, I normally use a command-line like this one: lav2yuv movie.avi | yuvdenoise -b 8,64,-8,-64 | yuvscaler -O SIZE_352x288 | mpeg2enc -f 1 -o movie.m1v Have a lot of fun! ;-)

AUTHOR
This man page was written by Stefan Fendt <stefan@lionfish.ping.de>.

FURTHER INFOS
If you have questions, remarks, problems or you just want to contact the developers, the main mailing list for the MJPEG-tools is: mjpeg-users@lists.sourceforge.net For more info, see our website at http://mjpeg.sourceforge.net/

SEE ALSO
mjpegtools(1), mpeg2enc(1) lavrec(1) lav2yuv(1)