Log in

View Full Version : In trouble with a script


Mounir
14th October 2010, 16:08
I'm using a script for my tapes and i can't seem to figure how i can deinterlace my video right after this script

script:

source=AVISource("E:\MyVideo.avi").killaudio()
#SetMTMode(2,0) #For multi-threading
chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false)
#chroma=source.Cnr2("oxx",8,14,191,75,255,20,255,false)
output=MDegrain2i2(chroma,0,0)
#stackhorizontal(source,output)
return output

function MDegrain2i2(clip source, int "overlap", int "dct")
{
overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
dct=default(dct,0) # use dct=1 for clip with light flicker
fields=source.SeparateFields() # separate by fields
super = fields.MSuper()
backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=overlap, dct=dct)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=overlap, dct=dct)
backward_vec4 = super.MAnalyse(isb = true, delta = 4, overlap=overlap, dct=dct)
forward_vec4 = super.MAnalyse(isb = false, delta = 4, overlap=overlap, dct=dct)
fields.MDegrain2(super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
Weave()
}


Right after that i'd need yadif or Tomsmocomp to deinterlace the vid.If i put Yadif(order=1, mode=0) it has no effect

Gavino
14th October 2010, 18:14
Are you putting Yadif after the 'return' statement? In that case, it will be ignored as 'return' effectively ends the script.

You could make it work by replacing the last line with
return output.Yadif(order=1, mode=0)