View Full Version : ml3dexGPU Avisynth script in Megui
flebber
24th July 2008, 16:58
HI
I was hoping someone could tell me what my error was with this script. I was following the docs as closely as I could to try and see how ml3dexGPU fairs for noise removal.
the script
# Set DAR in encoder to 31 : 17. The following line is for automatic signalling
global MeGUI_darx = 31
global MeGUI_dary = 17
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ML3DexGPU.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\medianblur.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MVTools.dll")
AVISource("C:\Documents and Settings\home\My Documents\Project\Capture\Ramoness.avi", audio=false)
ml3dexGPU(false,3,2,2,false,4,1,1200,300,130,true,true)
#deinterlace
#crop
Lanczos4Resize(352,288) # Lanczos4 (Sharp)
#denoise
the error
Invalid arguments to function ml3dexGPU
line 8
Seems to follow the docs and most values used here are the default as this would be the first time using it.
Docs
syntax:
ml3dexGPU(clip,bool mc, int Y, int U, int V,bool markscenechange, int blksize, int pel, int lambda, int thSCD1, int thSCD2,bool spfull,bool bsfull)
Raere
24th July 2008, 19:44
Try putting in the variable names, not just commas
i.e.
ml3dexGPU(mc=false,Y=3,U=2...etc
Hi flebber!
You need make frame for ml3dex if want using MVTools.Ml3dex work with old version MVTools. Simple script for progressive source:
source=AVISource("file.avi")
sourcef=source.Removegran(1).RemoveGrain(11)# prefiltering for finding more precise values motion vectors
bv1 = sourcef.MVAnalyse(blksize=8, isb = true, truemotion=true, search=2, delta = 1, idx = 1, overlap=4)
fv1 = sourcef.MVAnalyse(blksize=8, isb = false, truemotion=true, search=2, delta = 1, idx = 1, overlap=4)
bc1 =source.MVCompensate(bv1, idx=2, mode=1, thSAD=16000)
fc1 =source.MVCompensate(fv1, idx=2, mode=1, thSAD=16000)
Interleave(fc1,source,bc1)
ml3dex(mc=false)#Y=3, U=2,V=2 is default
SelectEvery(3,1)
yup.
flebber
29th July 2008, 07:08
Hi flebber!
You need make frame for ml3dex if want using MVTools.Ml3dex work with old version MVTools. Simple script for progressive source:
source=AVISource("file.avi")
sourcef=source.Removegran(1).RemoveGrain(11)# prefiltering for finding more precise values motion vectors
bv1 = sourcef.MVAnalyse(blksize=8, isb = true, truemotion=true, search=2, delta = 1, idx = 1, overlap=4)
fv1 = sourcef.MVAnalyse(blksize=8, isb = false, truemotion=true, search=2, delta = 1, idx = 1, overlap=4)
bc1 =source.MVCompensate(bv1, idx=2, mode=1, thSAD=16000)
fc1 =source.MVCompensate(fv1, idx=2, mode=1, thSAD=16000)
Interleave(fc1,source,bc1)
ml3dex(mc=false)#Y=3, U=2,V=2 is default
SelectEvery(3,1)
yup.
It errors when I try and use your script this is what I am using: # Set DAR in encoder to 31 : 17. The following line is for automatic signalling
global MeGUI_darx = 31
global MeGUI_dary = 17
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ML3DexGPU.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\medianblur.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MVTools.dll")
source=AVISource("DGDecode_mpeg2source("C:\Documents and Settings\home\My Documents\Project\D2v\Beastie Boys.d2v",cpu=4,info=3)
ColorMatrix(hints=true,interlaced=true)")
sourcef=source.Removegran(1).RemoveGrain(11)# prefiltering for finding more precise values motion vectors
bv1 = sourcef.MVAnalyse(blksize=8, isb = true, truemotion=true, search=2, delta = 1, idx = 1, overlap=4)
fv1 = sourcef.MVAnalyse(blksize=8, isb = false, truemotion=true, search=2, delta = 1, idx = 1, overlap=4)
bc1 =source.MVCompensate(bv1, idx=2, mode=1, thSAD=16000)
fc1 =source.MVCompensate(fv1, idx=2, mode=1, thSAD=16000)
Interleave(fc1,source,bc1)
ml3dex(mc=false)#Y=3, U=2,V=2 is default
SelectEvery(3,1)
#Not doing anything because the source is progressive
#crop
Lanczos4Resize(352,288) # Lanczos4 (Sharp)
#denoise
The error I am getting is Script error: expected a, or )
C:\Documents\xxx\Beastie.avs line 7,column 41
I assume its this line source=AVISource(DGDecode_mpeg2source("C:\Documents and Settings\home\My Documents\Project\D2v\Beastie Boys.d2v",info=3). I have line 7 fixed for the script source=DGDecode_mpeg2source("C:\Documents and Settings\home\My Documents\Project\D2v\Beastie Boys.d2v",cpu=4,info=3) However it is now erroring on line for colormatrix ColorMatrix(hints=true,interlaced=true)")
flebber
29th July 2008, 07:51
Some success. Script works like this without colormatrix.
# Set DAR in encoder to 31 : 17. The following line is for automatic signalling
global MeGUI_darx = 31
global MeGUI_dary = 17
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrain.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ML3DexGPU.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\medianblur.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MVTools.dll")
source=DGDecode_mpeg2source("C:\Documents and Settings\home\My Documents\Project\D2v\Beastie Boys.d2v")
sourcef=source.Removegrain(1).RemoveGrain(11)# prefiltering for finding more precise values motion vectors
bv1 = sourcef.MVAnalyse(blksize=8, isb = true, truemotion=true, search=2, delta = 1, idx = 1, overlap=4)
fv1 = sourcef.MVAnalyse(blksize=8, isb = false, truemotion=true, search=2, delta = 1, idx = 1, overlap=4)
bc1 =source.MVCompensate(bv1, idx=2, mode=1, thSAD=16000)
fc1 =source.MVCompensate(fv1, idx=2, mode=1, thSAD=16000)
Interleave(fc1,source,bc1)
ml3dex(mc=false)#Y=3, U=2,V=2 is default
SelectEvery(3,1)
#Not doing anything because the source is progressive
#crop
Lanczos4Resize(352,288) # Lanczos4 (Sharp)
#denoise
__film = last
__t0 = __film.trim(221, 4701)
__t0
flebber!
Why You want use ml3dex? ml3dex use ordinary for very noisy source and noise could pulse noise (dot noise). If Your source not this type try DegrainMedian plugin.
yup.
flebber
29th July 2008, 09:34
flebber!
Why You want use ml3dex? ml3dex use ordinary for very noisy source and noise could pulse noise (dot noise). If Your source not this type try DegrainMedian plugin.
yup.
I will try DegrainMedian as well just experimenting at the minute to try and ascertain what works best with what. My Avisynth scripting ability is a bit subpar at the minute is the only drawback for me.
flebber
29th July 2008, 09:59
Your script has given me the best result so far. Will try degrain and see if that can do better. Can't get degrain to work with values from http://avisynth.org.ru/degrain/degrainmedian.html
So changed values to DeGrainMedian(2,3,1)
DeGrainMedian(2,3,1) It errors saying invalid arguments to DeGrainMedian
Try use evident value parameter:
DeGrainMedian(limitY=5,limitUV=5,mode=3)
Also speak me You do not see blending artifact before and after scene changes?
yup.
flebber
29th July 2008, 15:06
This is currently the script I am encoding with for this try, includes degrain removed peachsmoother.
AVISource("C:\Documents and Settings\home\My Documents\Project\Capture\Ramoness.avi", audio=false)
Cnr2()
DeGrainMedian(limitY=5,limitUV=5,mode=3)
Deen("a2d",1,5,8)
Levels(0,1.2,255,0,255)
Convolution3D (0, 6, 10, 6, 8, 2.8, 0)
mergechroma(blur(1.3)) # Little Noise
#deinterlace
#crop
Lanczos4Resize(352,288) # Lanczos4 (Sharp)
Will check on blending artifacts when code finished.
flebber
29th July 2008, 15:45
There was no blending artifacts with the above script, but there was a little too much noise. Changed script to be AVISource("C:\Documents and Settings\home\My Documents\Project\Capture\Ramoness-test.avi", audio=false)
Dnr2()
Removegrain (mode=17)
DeGrainMedian(limitY=5,limitUV=7,mode=0)
Deen("a3d",4,10,12)
Levels(0,1.2,255,0,255)
Convolution3D (0, 6, 10, 6, 8, 2.8, 0) Very good noise removal but its a little not blurry but cartoon feeling ( clip not anime).
This is the script that gave me the best result so far. I will just slightly tinker with it for VHS captures just the tinniest bit less blury(very tinniest bit) and enhance colour slightly. Is there anyway to see colour effect before updating it ? And is Levels the best tool ?
Current best script
Dnr2()
DeGrainMedian(limitY=5,limitUV=6,mode=2)
Deen("a3d",3,10,12)
fft3dfilter(sigma=2, bt=4, sharpen=0.3)
Levels(0,1.2,255,0,255)
Convolution3D (0, 6, 10, 6, 8, 2.8, 0)
Adub
29th July 2008, 17:55
Of course it loaded without ColorMatrix. You messed up it's line:
ColorMatrix(hints=true,interlaced=true)")
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.