📄 y4mdenoise.1
字号:
.TH "y4mdenoise" "1" "27 Apr 2004" "MJPEG Linux Square" "MJPEG tools manual".SH NAMEy4mdenoise \- Motion-compensating YUV4MPEG-frame denoiser.SH SYNOPSIS.B y4mdenoise.RB [ -v.IR verbosity ].RB [ -p.IR parallelism ].RB [ -r.IR motion-search_radius ].RB [ -R.IR color_motion-search_radius ].RB [ -t.IR error_tolerance ].RB [ -T.IR color_error_tolerance ].RB [ -z.IR zero_motion_error_tolerance ].RB [ -Z.IR color_zero_motion_error_tolerance ].RB [ -m.IR match-count_throttle ].RB [ -M.IR match-size_throttle ].RB [ -f.IR reference_frames ].RB [ -B ].RB [ -I.IR interlacing_type ].RI "< /dev/stdin > /dev/stdout".SH DESCRIPTION\fBy4mdenoise\fP can be used to remove noise from imagesin a YUV4MPEG2 stream. This is useful for cleaning old sources toincrease video quality, and to reduce the bitrate needed to encodeyour video (e.g. for VCD and SVCD creation)..SH HOW IT WORKSIt maintains a list of the last several frames, called referenceframes. Each reference frame is composed of reference pixels.Every time a pixel in one frame is proven to be a moved instanceof a pixel in another frame, the reference-pixel incorporates itsvalue, and produces an average value for all instances of the pixel.The oldest reference frame, therefore, gets a pretty good idea ofthe real value of every pixel, but of course output is delayed bythe number of reference frames.The search is not actually done one pixel at a time; it's done interms of pixel groups. An entire pixel-group has to match for anymatch to be found, but all possible pixel-groups are tested (i.e. allpossible overlapping combinations are checked). Using pixel-groupshelps to establish a minimum standard for what may be considered amatch, in order to avoid finding lots of really small (and reallyuseless) matches. Presently, intensity pixel-groups are 4x2(i.e. 4 across and 2 down), and color pixel-groups are 2x2.It compares every pixel-group in the current frame with allpixel-groups in the previous frame, within a given search-radius,and sorts them based on how close the match was, keeping the topcontenders. It then flood-fills each found pixel-group in turn,to determine the full size of the match. The first match found tobe big enough is applied to the image. The number of contendersto consider, and the minimum size of a match, can be specified onthe command line.At the end of the frame, any new-frame pixels not resolved yetare considered to be new information, and a new reference-pixel isgenerated for each one.A "zero-motion pass" happens each frame, before motion-detection, in anattempt to resolve most of the frame cheaply. Its error-tolerance canbe set separately..SH OPTIONS\fBy4mdenoise\fP accepts the following options:.TP 4.BI \-v " [0..2] verbosity"0 = none, 1 = normal (per-frame pixel-detection totals), 2=debug..TP 4.BI \-p " num"Controls the level of parallelism. Since intensity and color aredenoised separately by design, it's very easy to do each concurrentlyon a multiple-processor machine. A value of 1 reads andwrites video frames in separate threads. A value of 2 causes intensityand color to be denoised in separate threads. A value of 0 turns offall concurrency, i.e. the program reads a frame, denoises it, thenwrites a frame, and loops until there are no more frames. Due to a bug inend of stream handling (threading issue on some OSs) the default is 0. OS/Xseems to not have a problem with a value of 1 but on Linux systems theprocess will go to sleep at the end of stream condition and killing the processcauses the last batch of buffered frames to be lost (resulting in a shortor truncated output stream)..TP 4.BI \-r " [4..] search radius"The search radius, i.e. the maximum distance that a pixel can move andstill be found by motion-detection. The default is 16.There are no particular restrictions on the search radius, e.g. itdoesn't have to be an even multiple of 4..TP 4.BI \-R " [4..] color search radius"The search radius to use for color. Default is whatever the mainsearch-radius was set to. Note that this value ends up getting scaledby the relative size of intensity & color planes in your YUV4MPEG2stream..TP 4.BI \-t " [0..255] Error tolerance"The largest difference between two pixels that's accepted for the twopixels to be considered equal. The default is 3, which is good formedium-noise material like analog cable TV. (This value will haveto be changed to whatever is appropriate for your YUV4MPEG2 streamin order to avoid undesirable results. See the instructions below.).TP 4.BI \-T " [0..255] Error tolerance for color"The default is whatever the main error-tolerance was set to..TP 4.BI \-z " [0..255] Error tolerance for zero-motion pass"The error-tolerance used on pixels that haven't moved. Usually equalto the main error-tolerance or one less than that. Default is 2..TP 4.BI \-Z " [0..255] Error tolerance for color's zero-motion pass"The default is whatever the main zero-motion error-tolerance was set to..TP 4.BI \-m " [num] Match-count throttle"The maximum number of pixel-group matches (within the search radius)to consider. If more are found, only the closest matches are kept.Default is 10..TP 4.BI \-M " [num] Match-size throttle"The minimum size of the flood-filled region generated from a match.Matches smaller than this are thrown away. Specified in terms ofpixel-groups. Default is 3..TP 4.BI \-f " num"The number of reference frames to keep. Pixel values are averaged overthis many frames before they're written to standard output; this alsoimplies that output is delayed by this many frames. Default is 10..TP 4.BI \-BBlack-and-white mode. Denoise only the intensity plane, and set thecolor plane to all white..TP 4.BI \-I " num"Set interlacing type. Default is taken from the YUV4MPEG2 stream.0 means not interlaced, 1 means top-field interlaced, 2 meansbottom-field interlaced. This is useful when the signal is morenaturally of some other interlacing type than its current representation(e.g. if the original was shot on film and then later it was transferredto interlaced video, it will denoise better if treated as film, i.e.non-interlaced)..SH TYPICAL USAGE AND TIPSKeep in mind that all of this advice was gained through experience.(Just because one writes a tool doesn't mean one understands how itshould be used, for the same reason that car designers aren'tnecessarily professional drivers.)The error-threshold must be determined for every individual YUV4MPEG2stream. If the threshold is set too low, it'll leave noise inthe video, and the denoiser will run a lot slower than it has to.If it's set too high, the denoiser will start to remove detail:the video will get blurrier, you may see topographical-like bandsin the relatively flat areas of the video, and small parts of thevideo that should be moving will be stuck in place. It may alsorun a little slower. Additionally, just because the video came toyou from a clean source (digital cable TV, LaserDisc, etc.) doesn'tmean the video itself is clean; \fBy4mdenoise\fP is capable ofpicking up on noise in the original recording as well as sampling errorfrom the video-capture device. You will have to generate smallclips of representative parts of your video, denoise them withvarious error thresholds, and see what looks the best. As yougain experience with the tool, you may know what error thresholdgenerally works with various types of sources, but you'll stillwant to double-check your assumptions.Flat, shiny surfaces, like gloss-painted walls, or the polished woodfloor of an indoor gymnasium, seem to require a lower error thresholdthan other types of video.Here is the author's experience: -t 1 : Digital cable TV, most LaserDiscs, DV camcorder video -t 2 : VHS camcorder video, commercially-produced videotapes -t 3 : Analog cable TV, VHS videotape (at the 2-hour speed) -t 4 : VHS videotape (at the 6-hour speed)Interlaced video that was made from non-interlaced video (e.g. avideotape or LaserDisc of a film) must be denoised as non-interlaced.Otherwise the result tends to be grainy.\fBy4mdenoise\fP only removes temporal noise, i.e. noise that occursover time. And it tends to do such a good job of this, that thespatial noise (i.e. noise that occurs in nearby areas of the same frame)tends to become very distinct. Therefore, always pipe the output of\fBy4mdenoise\fP through a spatial filter such as \fBy4mspatialfilter\fPor \fByuvmedianfilter\fP.When producing very low bitrate video (e.g. VCD-compatible videoless than 900 kbps), denoise at the output frame size, e.g. don'tdenoise at DVD frame size then downscale to VCD size. That willdenoise as well as condition the video for the motion-detection part of\fBmpeg2enc\fP. Not doing this will produce video where the lesscomplex scenes will look really good, but high-motion scenes will blursignificantly.JPEG compression of your video frames, even 100% compression, seems tobe inaccurate enough to affect MPEG encoding. Therefore, if you'reusing motion-JPEG files as your intermediary video format, you maywant to use the denoiser in your MPEG-encoding pipeline, i.e. after\fBlav2yuv\fP and before \fBmpeg2enc\fP. If you're generating multipleresolutions of the same video, e.g. DVD and VCD, experience showsthat it's acceptable to run \fBy4mdenoise\fP before \fByuv2lav\fP, butyou should still use the spatial-filter (e.g. \fBy4mspatialfilter\fP,\fByuvmedianfilter\fP) in the MPEG-encoding pipeline, to try to smoothaway JPEG encoding artifacts..SH AUTHORThe bulk of the \fBy4mdenoise\fP code, and this manual page, waswritten by Steven Boswell <ulatec@users.sourceforge.net>..SH FURTHER INFOIf you have questions, remarks, problems or you just want to contactthe developers, the main mailing list for the MJPEG\-tools is:.BR \fImjpeg\-users@lists.sourceforge.net\fPFor more info, see our website at.BR \fIhttp://mjpeg.sourceforge.net/\fP.SH SEE ALSO.BR mjpegtools (1),.BR mpeg2enc (1),.BR yuvdenoise (1),.BR yuvmedianfilter (1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -