Bernardd
16th February 2014, 15:51
Hello,
I have problem with variable use and ScriptClip.
For example, this script is ok
AVISource("C:\something.avi")
ScriptClip("ColorYuv(gain_y=myvar)", show=false, after_frame=false)
ConditionalReader("Try file.txt", "myvar", false)
with Try file.txt like this
Type int
Default 12
R 45 300 45
2 0
72 13
But this script is no good. I get "Script Error : invalid arguments to function "RemoveDirtMC" ([ScriptClip], line 1)"
AVISource("C:\something.avi")
ScriptClip("RemoveDirtMc(limit=myvar)", show=false, after_frame=false)
ConditionalReader("Essai file.txt", "myvar", false)
with the same Try file.txt and John Meyer's RemoveDirtMC function, copied below
#REMOVE DIRT FUNCTION
#......................................................................................................................................................................
function RemoveDirt(clip input, int limit, bool _grey)
{
clensed=input.Clense(grey=_grey, cache=4)
alt=input.RemoveGrain(2)
return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,dmode=2,debug=false,noise=limit,noisy=4, grey=_grey)
# Alternative settings
# return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=true)
# return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=false)
}
function RemoveDirtMC(clip,int limit, bool "_grey")
{
_grey=default(_grey, false)
limit = default(limit,6)
i=MSuper(clip,pel=2)
bvec = MAnalyse(i,isb=false, blksize=8, delta=1, truemotion=true,dct=0)
fvec = MAnalyse(i,isb=true, blksize=8, delta=1, truemotion=true,dct=0)
backw = MFlow(clip,i,bvec)
forw = MFlow(clip,i,fvec)
clp=interleave(backw,clip,forw)
clp=clp.RemoveDirt(limit,_grey)
clp=clp.SelectEvery(3,1)
return clp
}
I do not understand the error. I have tried without success to write global before limit defintion in RemoveDirtMC function.
Thanks for help.
I have problem with variable use and ScriptClip.
For example, this script is ok
AVISource("C:\something.avi")
ScriptClip("ColorYuv(gain_y=myvar)", show=false, after_frame=false)
ConditionalReader("Try file.txt", "myvar", false)
with Try file.txt like this
Type int
Default 12
R 45 300 45
2 0
72 13
But this script is no good. I get "Script Error : invalid arguments to function "RemoveDirtMC" ([ScriptClip], line 1)"
AVISource("C:\something.avi")
ScriptClip("RemoveDirtMc(limit=myvar)", show=false, after_frame=false)
ConditionalReader("Essai file.txt", "myvar", false)
with the same Try file.txt and John Meyer's RemoveDirtMC function, copied below
#REMOVE DIRT FUNCTION
#......................................................................................................................................................................
function RemoveDirt(clip input, int limit, bool _grey)
{
clensed=input.Clense(grey=_grey, cache=4)
alt=input.RemoveGrain(2)
return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,dmode=2,debug=false,noise=limit,noisy=4, grey=_grey)
# Alternative settings
# return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=true)
# return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=false)
}
function RemoveDirtMC(clip,int limit, bool "_grey")
{
_grey=default(_grey, false)
limit = default(limit,6)
i=MSuper(clip,pel=2)
bvec = MAnalyse(i,isb=false, blksize=8, delta=1, truemotion=true,dct=0)
fvec = MAnalyse(i,isb=true, blksize=8, delta=1, truemotion=true,dct=0)
backw = MFlow(clip,i,bvec)
forw = MFlow(clip,i,fvec)
clp=interleave(backw,clip,forw)
clp=clp.RemoveDirt(limit,_grey)
clp=clp.SelectEvery(3,1)
return clp
}
I do not understand the error. I have tried without success to write global before limit defintion in RemoveDirtMC function.
Thanks for help.