mustardman
20th November 2004, 05:13
My script works fine as a start-to-end script, but it looked bad and was quite repeditive and long. So I decided to put the repeated bits into a function. But...I can't seem to get the ConditionalFilter to operate inside the function, yet it works fine outside!
The basis of my script is
Function SelectBest(clip IN, int X)
{
Selector = crop(IN,0,0,720,2).ConvertToYV12
Modified = Overlay(IN,In with some changes)
Best = ConditionalFilter(IN,IN,Modified, "AverageLuma(Selector)",">","50",true)
Return(Best)
}
But it keeps returning the error, "I dont know what Selector means" or somthing very similar.
I tried moving the lines around, after searching for help, I read that the function works from the bottom up. But this made it worse, it shifted the error to occur even sooner in ConditionalFilter.
My exact script is...
# Function examines top line to find jitter caused by bad Vsync. This leaves a black
# line, which can be detected with luma. Problem is, the jitter is random.
Function ShiftUp2 (clip FullFrame,int Threshold)
{
Trim = Crop(FullFrame,0,0,720,2).ConvertToYV12
ShiftFrame = Overlay(FullFrame,FullFrame,x=0,y=-2,mode="blend") # Image shifted up by 2 lines
Shifted = ConditionalFilter(FullFrame,FullFrame,ShiftFrame,"AverageLuma(Trim)",">","Threshold",true)
Return(Shifted)
}
c = AVISource("e:\recovery\rgb\s01-shoot.avi").AssumeFrameBased.AssumeBFF.SeparateFields
FF = BiLinearResize(c,720,576)
#lots of stuff deleted which does the bit inside the function several times linearly...
Return(ShiftUp2(FF,50))
Thanks,
MM
The basis of my script is
Function SelectBest(clip IN, int X)
{
Selector = crop(IN,0,0,720,2).ConvertToYV12
Modified = Overlay(IN,In with some changes)
Best = ConditionalFilter(IN,IN,Modified, "AverageLuma(Selector)",">","50",true)
Return(Best)
}
But it keeps returning the error, "I dont know what Selector means" or somthing very similar.
I tried moving the lines around, after searching for help, I read that the function works from the bottom up. But this made it worse, it shifted the error to occur even sooner in ConditionalFilter.
My exact script is...
# Function examines top line to find jitter caused by bad Vsync. This leaves a black
# line, which can be detected with luma. Problem is, the jitter is random.
Function ShiftUp2 (clip FullFrame,int Threshold)
{
Trim = Crop(FullFrame,0,0,720,2).ConvertToYV12
ShiftFrame = Overlay(FullFrame,FullFrame,x=0,y=-2,mode="blend") # Image shifted up by 2 lines
Shifted = ConditionalFilter(FullFrame,FullFrame,ShiftFrame,"AverageLuma(Trim)",">","Threshold",true)
Return(Shifted)
}
c = AVISource("e:\recovery\rgb\s01-shoot.avi").AssumeFrameBased.AssumeBFF.SeparateFields
FF = BiLinearResize(c,720,576)
#lots of stuff deleted which does the bit inside the function several times linearly...
Return(ShiftUp2(FF,50))
Thanks,
MM