Log in

View Full Version : RemoveDirt


thunderclap
16th September 2021, 19:35
I'm new to the world of AviSynth scripting and need some help. I've been trying to get Pinterf's RemoveDirt (http://avisynth.nl/index.php/RemoveDirt) working for about a week with no luck. I have the latest versions of AviSynth+ and AvsPmod installed as well as the x64 version of RemoveDirt. The script seems right since AvsPmod doesn't through up any errors, however when I export the clip it doesn't seem to have removed any dust or hair or anything. The script I'm using came from the RemoveDirt site:

function RemoveDirt(clip input, bool "_grey", int "repmode")
{
_grey=default(_grey, false)
repmode=default(repmode, 16)
clmode=17
clensed=Clense(input, grey=_grey, cache=4)
sbegin = ForwardClense(input, grey=_grey, cache=-1)
send = BackwardClense(input, grey=_grey, cache=-1)
alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode )
restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
return RemoveGrain(corrected, mode=clmode, modeU = _grey ? -1 : clmode )
}

Any idea what I'm doing wrong? Any suggestions?

Reel.Deel
16th September 2021, 20:15
Can you post the complete script you're using?

thunderclap
16th September 2021, 21:49
Can you post the complete script you're using?

This is the full script I have in AvsPmod.

FFVideoSource("E:\movie.mkv")
function RemoveDirt(clip input, bool "_grey", int "repmode")
{
_grey=default(_grey, false)
repmode=default(repmode, 16)
clmode=17
clensed=Clense(input, grey=_grey, cache=4)
sbegin = ForwardClense(input, grey=_grey, cache=-1)
send = BackwardClense(input, grey=_grey, cache=-1)
alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode )
restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
return RemoveGrainHD(corrected, mode=clmode, modeU = _grey ? -1 : clmode )
}

Reel.Deel
16th September 2021, 21:54
You need to actually call the function for it to do anything.

FFVideoSource("E:\movie.mkv")
RemoveDirt() # same as RemoveDirt(last, _grey=false, repmode=16)

thunderclap
16th September 2021, 23:54
You need to actually call the function for it to do anything.

FFVideoSource("E:\movie.mkv")
RemoveDirt() # same as RemoveDirt(last, _grey=false, repmode=16)

Okay, but now I'm getting "I don't know what 'input' means".

Reel.Deel
17th September 2021, 00:06
Okay, but now I'm getting "I don't know what 'input' means".

Can you post your script please? If you have something out of other it may cause that.

thunderclap
17th September 2021, 00:23
Can you post your script please? If you have something out of other it may cause that.

The full script is now:

FFVideoSource("E:\movie.mkv")
RemoveDirt() # same as RemoveDirt(last, _grey=false, repmode=16)
function RemoveDirt(clip input, bool "_grey", int "repmode")
{
_grey=default(_grey, false)
repmode=default(repmode, 16)
clmode=17
clensed=Clense(input, grey=_grey, cache=4)
sbegin = ForwardClense(input, grey=_grey, cache=-1)
send = BackwardClense(input, grey=_grey, cache=-1)
alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode )
restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
return RemoveGrainHD(corrected, mode=clmode, modeU = _grey ? -1 : clmode )
}

Should 'clip input' and all the other 'input' reference something? Unfortunately the documentation on this plugin isn't very helpful to a layman.