Log in

View Full Version : How to combine these 2 scripts?


lpn1160
2nd August 2003, 18:38
Each one of these scripts work independently, however when I try to put the 2 together I get an error message "Invalid argument to function animate"
Here is script 1 (works Fine)
blankclip(610,704,480,"yuy2",23.976,color=$1E90FF)
Animate(0,150,"subtitle","CAPTURED BY...LARRY",150,510,0,150,"Arial", 40,$FFFFFF,"CAPTURED BY...LARRY",150,10,0,150,"Arial",40,$FFFFFF)
Animate(151,300,"subtitle","EDITED BY...LARRY",170,510,151,300,"Arial", 40,$FFFFFF,"EDITED BY...LARRY",170,10,151,300,"Arial",40,$FFFFFF)
Animate(301,450,"subtitle","ACTUALLY I DID EVERYTHING",83,510,301,450,"Arial", 40,$FFFFFF,"ACTUALLY I DID EVERYTHING",83,10,301,450,"Arial",40,$FFFFFF)
Animate(451,600,"subtitle","ENJOY THE FILM !!",175,510,451,600,"Arial", 40,$FFFFFF,"ENJOY THE FILM !!",175,10,451,600,"Arial",40,$FFFFFF)
#script 2 (working)
AVISource("E:\captures\godzilla.avi")
Telecide(order=0,post=2)#guide=1
Decimate(MODE=3)
TWEAK(SAT=0)
Trim(120,15499)+Trim(19376,29529)+Trim(34829,48310)+Trim(52164,69074)+Trim(72933,93175)+Trim
(98464,111880)+Trim(117166,128776)
dnr2()
simpleresize(704,480)
#I tried combining them like so (throws an exception as stated above)
v1=blankclip(610,704,480,"yuy2",23.976,color=$1E90FF)
Animate(0,150,"subtitle","CAPTURED BY...LARRY",150,510,0,150,"Arial", 40,$FFFFFF,"CAPTURED BY...LARRY",150,10,0,150,"Arial",40,$FFFFFF)
Animate(151,300,"subtitle","EDITED BY...LARRY",170,510,151,300,"Arial", 40,$FFFFFF,"EDITED BY...LARRY",170,10,151,300,"Arial",40,$FFFFFF)
Animate(301,450,"subtitle","ACTUALLY I DID EVERYTHING",83,510,301,450,"Arial", 40,$FFFFFF,"ACTUALLY I DID EVERYTHING",83,10,301,450,"Arial",40,$FFFFFF)
Animate(451,600,"subtitle","ENJOY THE FILM !!",175,510,451,600,"Arial", 40,$FFFFFF,"ENJOY THE FILM !!",175,10,451,600,"Arial",40,$FFFFFF)
v2=AVISource("E:\captures\godzilla.avi")
Telecide(order=0,post=2)#guide=1
Decimate(MODE=3)
TWEAK(SAT=0)
Trim(120,15499)+Trim(19376,29529)+Trim(34829,48310)+Trim(52164,69074)+Trim(72933,93175)+Trim(98464,111880)+Trim(117166,128776)
dnr2()
simpleresize(704,480)
unalignedsplice(v1,v2)

I'm sure I must be missing some thing very simple.
Any insight is very much appreciated

fccHandler
2nd August 2003, 18:54
Something similar happened to me recently and it drove me nuts until I figured out my goof. In the combined scripts, you've set the output from blankclip() to a variable called "v1." You need to specify "v1" as the input to the Animate filters, as in "v1.Animate(...)" Same with "v2" later. Hope that helps.

Wilbert
2nd August 2003, 18:55
At least two mistakes:

First one is that you must change the second line and the line after AviSource:


v1=blankclip(610,704,480,"yuy2",23.976,color=$1E90FF)
v1.Animate(0,150,"subtitle","CAPTURED BY...LARRY",150,510,0,150,"Arial", 40,$FFFFFF,"CAPTURED BY...LARRY",150,10,0,150,"Arial",40,$FFFFFF)
Animate(151,300,"subtitle","EDITED BY...LARRY",170,510,151,300,"Arial", 40,$FFFFFF,"EDITED BY...LARRY",170,10,151,300,"Arial",40,$FFFFFF)
Animate(301,450,"subtitle","ACTUALLY I DID EVERYTHING",83,510,301,450,"Arial", 40,$FFFFFF,"ACTUALLY I DID EVERYTHING",83,10,301,450,"Arial",40,$FFFFFF)
Animate(451,600,"subtitle","ENJOY THE FILM !!",175,510,451,600,"Arial", 40,$FFFFFF,"ENJOY THE FILM !!",175,10,451,600,"Arial",40,$FFFFFF)
v2=AVISource("E:\captures\godzilla.avi")
v2.Telecide(order=0,post=2)#guide=1
Decimate(MODE=3)
TWEAK(SAT=0)
Trim(120,15499)+Trim(19376,29529)+Trim(34829,48310)+Trim(52164,69074)+Trim(72933,93175)+Trim(98464,111880)+Trim(117166,128776)
dnr2()
simpleresize(704,480)
unalignedsplice(v1,v2)

Mistake two is that the script returns v1+v2 instead of the filtered clips. So try something like:

v1=blankclip(610,704,480,"yuy2",23.976,color=$1E90FF)
v1.Animate(0,150,"subtitle","CAPTURED BY...LARRY",150,510,0,150,"Arial", 40,$FFFFFF,"CAPTURED BY...LARRY",150,10,0,150,"Arial",40,$FFFFFF)
Animate(151,300,"subtitle","EDITED BY...LARRY",170,510,151,300,"Arial", 40,$FFFFFF,"EDITED BY...LARRY",170,10,151,300,"Arial",40,$FFFFFF)
Animate(301,450,"subtitle","ACTUALLY I DID EVERYTHING",83,510,301,450,"Arial", 40,$FFFFFF,"ACTUALLY I DID EVERYTHING",83,10,301,450,"Arial",40,$FFFFFF)
final1 = last.Animate(451,600,"subtitle","ENJOY THE FILM !!",175,510,451,600,"Arial", 40,$FFFFFF,"ENJOY THE FILM !!",175,10,451,600,"Arial",40,$FFFFFF)

v2=AVISource("E:\captures\godzilla.avi")
v2.Telecide(order=0,post=2)#guide=1
Decimate(MODE=3)
Tweak(SAT=0)
Trim(120,15499)+Trim(19376,29529)+Trim(34829,48310)+Trim(52164,69074)+Trim(72933,93175)+Trim(98464,111880)+Trim(117166,128776)
dnr2()
final2 = last.simpleresize(704,480)

final1 + final2

lpn1160
2nd August 2003, 20:29
Wilbert, first and foremost thanks to answering my post, 2nd your script worked fine, except for another "dumb" mistake by me, (1 clip has audio the other (blank) doesn't. So I fixed it by inserting a blank .wav file the same length as the blank clip (25.442 sec)
so the final script reads as follows:


v1=audiodub(blankclip(610,704,480,"yuy2",23.976,color=$1E90FF), wavsource("E:\captures\Untitled.wav"))
v1.Animate(0,150,"subtitle","CAPTURED BY...LARRY",150,510,0,150,"Arial", 40,$FFFFFF,"CAPTURED BY...LARRY",150,10,0,150,"Arial",40,$FFFFFF)
Animate(151,300,"subtitle","EDITED BY...LARRY",170,510,151,300,"Arial", 40,$FFFFFF,"EDITED BY...LARRY",170,10,151,300,"Arial",40,$FFFFFF)
Animate(301,450,"subtitle","ACTUALLY I DID EVERYTHING",83,510,301,450,"Arial", 40,$FFFFFF,"ACTUALLY I DID EVERYTHING",83,10,301,450,"Arial",40,$FFFFFF)
final1 = last.Animate(451,600,"subtitle","ENJOY THE FILM !!",175,510,451,600,"Arial", 40,$FFFFFF,"ENJOY THE FILM !!",175,10,451,600,"Arial",40,$FFFFFF)

v2=AVISource("E:\captures\godzilla.avi")
v2.Telecide(order=0,post=2)#guide=1
Decimate(MODE=3)
Tweak(SAT=0)
Trim(120,15499)+Trim(19376,29529)+Trim(34829,48310)+Trim(52164,69074)+Trim(72933,93175)+Trim(98464,111880)+Trim(117166,128776)
dnr2()
final2 = last.simpleresize(704,480)

final1 + final2



All I can say is THANK YOU #LOOP() (LOL)