View Single Post
Old 15th April 2011, 23:31   #5  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
CNR handles chroma problems in VHS, but this clip has other issues too.

I have a script I use as a starting point for clips like this. You will have to adapt it to your use. I used it, without modification, and created this:

Better Clip

Not exactly a work of art, but better than the original.

The following script can be made about 4x faster (on an 8-core CPU) using SetMTMode statements before/after the AVISource statement.

Code:
#Denoiser script for interlaced video using MDegrain2 (will work on progressive as well)

SetMemoryMax(768)

Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\CNR\Cnr2.dll")

#Modify this line to point to your video file
source=AVISource("E:\frameserver.avi").killaudio()

#VHS chroma settings can sometimes cause smear. Skip CNR2 if not needed.
chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
#chroma=source.Cnr2("oxx",8,14,191,75,255,20,255,false) #Laserdisc 

#Use 4 instead of 8 in line below for better quality in shadows
output=MDegrain2i2(chroma,8,0,0)
#stackhorizontal(source,output)
return output


#-------------------------------

function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct")
{
Vshift=0 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc
Hshift=0 # determine experimentally 
overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
dct=default(dct,0) # use dct=1 for clip with light flicker -- works really well

fields=source.SeparateFields() # separate by fields

super = fields.MSuper(pel=2, sharp=1)
backward_vec2 = super.MAnalyse(isb = true, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
backward_vec4 = super.MAnalyse(isb = true, delta = 4, blksize=blksize, overlap=overlap, dct=dct)
forward_vec4 = super.MAnalyse(isb = false, delta = 4, blksize=blksize, overlap=overlap, dct=dct)

MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400) 

unsharpmask(60,3,0) #not sure whether to put this before or after the weave. Remove if sharpening degrades video
Weave()
}
johnmeyer is offline   Reply With Quote