PDA

View Full Version : I'm confused


zilog jones
18th May 2005, 23:48
Here's a script:

a = ImageSource("h:\video\tc576\1.tif", end = 300, fps=25)
b = ImageSource("h:\video\tc576\2.tif", end = 300, fps=25)
c = ImageSource("h:\video\tc576\3.tif", end = 300, fps=25)
d = ImageSource("h:\video\tc576\4.tif", end = 300, fps=25)
e = ImageSource("h:\video\tc576\5.tif", end = 300, fps=25)
f = ImageSource("h:\video\tc576\6.tif", end = 300, fps=25)
g = ImageSource("h:\video\tc576\7.tif", end = 300, fps=25)
h = ImageSource("h:\video\tc576\8.tif", end = 300, fps=25)
i = ImageSource("h:\video\tc576\9.tif", end = 300, fps=25)
j = ImageSource("h:\video\tc576\10.tif", end = 300, fps=25)


all = (a+b+c+d+e+f+g+h+i+j)

ConvertToYV12(all)

return(all)

Yeah, I know I could have done ImageSource("h:\video\tc576\%d.tif", 1, 10, 25), but when I did changeFPS afterwards it was doing funky things - each image was displayed twice as long as the previous one, or something screwy). But I don't think I'm doing the stuff afterwards right, because that ConvertToYV12 doesn't do anything - and if I try putting anything else there it doesn't do anything either. What am I doing wrong?

Schlumpf
19th May 2005, 00:35
Try this:

return(all.ConvertToYV12)

In C I'd say that you apply the Conversion to YV12 only temporarily one time in the middle of the script, but in the end all that matters is what is being returned and that is only set in the return-line, where you return the unaltered "all"

If you don't want to write everything in one line, seperated by dots, you could also write:

all = (a+b+c+d+e+f+g+h+i+j)
all = all.ConvertToYV12()
return all

Which would roughly equal the idea of i = i+1 from C-World.

And sorry that I talk so much about C, it's just that i'm not really familiar with the internals of the Avisynth-Parser, but it helps that he seems to behave similarly.

zilog jones
19th May 2005, 01:14
Ah, that makes sense. Thanks. And I know C, probably better than AviSynth though ^_^

neuron2
19th May 2005, 02:05
zilog,

With 189 posts you should be well aware of forum rule 9. Please observe it in the future. Thank you.

esby
19th May 2005, 02:14
ConvertToYV12(all)
return(all)


A direct answer would have been to say that this code does 'nothing' as the implicit last is not returned.
The reason is that you don't modify 'all' when calling ConvertToYv12(all), as this returns a clip type,
which is stored in the given example in the implicit last...
correct code would be:

all = ConvertToYV12(all)
return(all)

or

ConvertToYV12(all)
return(last) #in fact is it not needed as it would be added by the parser anyway


And of course you can still use the oo notation that Schlumpf already remembered.

esby

zilog jones
19th May 2005, 16:52
Originally posted by neuron2
With 189 posts you should be well aware of forum rule 9. Please observe it in the future. Thank you.

Sorry -_-
I was tired... and annoyed...

Thanks for the help guys anyway. Using multiple clips always really confused me so I usually just tried to avoid them.