Floatingshed
3rd June 2014, 20:08
I use the following script (stolen from here years ago!)to very effectively remove film dirt and it has served me well. However, I have several clips consisting of hybrid 50i video and 25p film and I'd like to apply the filter on just the film sections.
I need help to either make the script work with multiple calls or somehow ignore the 50i sections, but this worries me as often you find the film sections are out of phase and "look" interlaced as the film frame changes between fields.
Any help much appreciated. Thanks.
function Dirt(clip clap,int "limit")
{
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools v1.11.4.5\mvtools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Mask tools v2.0.36.0\mt_masktools-26.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Mask tools v1.5.1.0\MaskTools.dll")
_grey=false
limit = default(limit,60)
bvec = clap.MVAnalyse(isb=false, blksize=8, delta=1, pel=2, truemotion=true, idx=4)
fvec = clap.MVAnalyse(isb=true, blksize=8, delta=1, pel=2, truemotion=true, idx=4)
backw = clap.MVFlow(bvec)
forw = clap.MVFlow(fvec)
clt = interleave(backw,clap,forw)
clt = clt.RemoveDirt(limit)
return clt.SelectEvery(3,1)
}
function RemoveDirt(clip input, int limit)
{
clensed=input.Clense(grey=false, cache=4)
alt=input.RemoveGrain(2)
return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=false)
}
I need help to either make the script work with multiple calls or somehow ignore the 50i sections, but this worries me as often you find the film sections are out of phase and "look" interlaced as the film frame changes between fields.
Any help much appreciated. Thanks.
function Dirt(clip clap,int "limit")
{
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools v1.11.4.5\mvtools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Mask tools v2.0.36.0\mt_masktools-26.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Mask tools v1.5.1.0\MaskTools.dll")
_grey=false
limit = default(limit,60)
bvec = clap.MVAnalyse(isb=false, blksize=8, delta=1, pel=2, truemotion=true, idx=4)
fvec = clap.MVAnalyse(isb=true, blksize=8, delta=1, pel=2, truemotion=true, idx=4)
backw = clap.MVFlow(bvec)
forw = clap.MVFlow(fvec)
clt = interleave(backw,clap,forw)
clt = clt.RemoveDirt(limit)
return clt.SelectEvery(3,1)
}
function RemoveDirt(clip input, int limit)
{
clensed=input.Clense(grey=false, cache=4)
alt=input.RemoveGrain(2)
return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=false)
}