Log in

View Full Version : What's wrong with this script?


Thar
16th December 2006, 14:55
Seems to me that everything is fine, but I get error on this line:

Trim(Raw,0,32965)+Trim(Raw,32966,35124).Layer(Raw,Ed,op="add",level=255,use_chroma=true)+Trim(Raw,35125,0)

telling me that I used wrong arguments for Layer function. But when it looks like this:

Trim(Raw,0,32965)+Trim(Raw,32966,35124)
Layer(Raw,Ed,op="add",level=255,use_chroma=true)+Trim(Raw,35125,0)
Avisynth won't complain, but I need to use Layer only on frames 32966 to 35124.

scharfis_brain
16th December 2006, 15:02
remove raw, from the layer call

Thar
16th December 2006, 15:08
That worked, thanks.

Thar
17th December 2006, 14:52
Sorry for double post... But I have yet another question.

It's the same script... however, now Layer complaints about wrong colorspace, so I've put ConvertToRGB32(Raw) and (Ed) before it... but somehow it hasn't solved the problem.

unskinnyboy
17th December 2006, 17:02
What is your input colorspace? What is the exact new script? And what is the exact error message you are getting (post a screenshot)?

Thar
17th December 2006, 22:57
Input colorspace of 'Raw': YV12
Input colorspace of 'Ed': RGBA

Script looks alike:
Raw=DirectShowSource("Raw.avi",audio=false)
Ed=DirectShowSource("Ed.avi",audio=false)
ConvertToRGB32(Raw)
ConvertToRGB32(Ed)
Trim(Raw,0,32965)+Trim(Raw,32966,35124)
Layer(Raw,Ed,op="add",level=255,use_chroma=true)+Trim(Raw,35125,0)
ConvertToYV12
BlockBuster(method="blur",block_size=4)
UnDot()
Convolution3d(preset="animehq")
LimitedSharpenFaster(ss_x=1.25,ss_y=1.25,undershoot=1)
Tweak(sat=1,coring=false)
I've skipped LoadPlugin(), as unnecessary.

Right now I'm not on my own computer, so i cannot post a screenshot, but the error message have been telling that 'Layer only supports RGB32 and YUY2 colorspaces', then pointing to line with Layer in that script. I remember it pretty well ;)

scharfis_brain
17th December 2006, 23:35
You are lacking experience in how to assign varibales.

ConvertToRGB32(Raw)
ConvertToRGB32(Ed)

will assign the output of the first ConvertToRGB32 to the hidden variable Last. As well as the second ConvertToRGB32 will. (So the latter one overwrites the last variable).
Also in the later function calls you are using the variables Raw & Ed, which never have been altered yet.

To solve you problem you need to assign the output of ConvertToRGB32 to the variables again:

Raw=ConvertToRGB32(Raw)
Ed=ConvertToRGB32(Ed)

an alternative spelling is:

Raw=Raw.ConvertToRGB32()
Ed=Ed.ConvertToRGB32()

please make youself familiar with this. the avisynth dokumentation will help you.