AlanHK
11th May 2008, 18:41
I use a logo filter on TV rips, but as the logo fades in and out several times, I divide it into several sections, and apply the filter to alternate ones.
It works, but is not elegant. In particular, I'd like to be able to just specify the filter parameters once (since usually they are the same throughout all the logo sections).
So currently I do something like this:
AVISource("209.avi")
t0 =972
t1 =3412
t2 =6707
t3 =19745
t4 =20491
Trim(0 ,t0) ++\
Trim(t0 +1,t1).xlogo("logo209_x_40_y_282_2.bmp", X=40, Y=282, alpha=0) ++\
Trim(t1 +1,t2) ++\
Trim(t2 +1,t3).xlogo("logo209_x_40_y_282_2.bmp", X=40, Y=282, alpha=0) ++\
Trim(t3 +1,t4) ++\
Trim(t4 +1,0).xlogo("logo209_x_40_y_282_2.bmp", X=40, Y=282, alpha=0)
The "t" parameters let me change the ranges fairly easily.
I looked at Stickboy's functions, but they either apply to sequences of on/off of constant length, or continuous ranges.
Or failing that, I tried to write a function so the parameters of the logo did not have to be repeated. But this DID NOT work:
(It fails with "incorrect parameters to xlogo".)
AVISource("209.avi")
function xl()
{
return xlogo("logo209_x_40_y_282_2.bmp", X=40, Y=282, alpha=0)
}
t0 =972
t1 =3412
t2 =6707
t3 =19745
t4 =20491
Trim(0 ,t0) ++\
Trim(t0 +1,t1).xl() ++\
Trim(t1 +1,t2) ++\
Trim(t2 +1,t3).xl() ++\
Trim(t3 +1,t4) ++\
Trim(t4 +1,0).xl()
I hope the intent is clear, so what have I done wrong?
It works, but is not elegant. In particular, I'd like to be able to just specify the filter parameters once (since usually they are the same throughout all the logo sections).
So currently I do something like this:
AVISource("209.avi")
t0 =972
t1 =3412
t2 =6707
t3 =19745
t4 =20491
Trim(0 ,t0) ++\
Trim(t0 +1,t1).xlogo("logo209_x_40_y_282_2.bmp", X=40, Y=282, alpha=0) ++\
Trim(t1 +1,t2) ++\
Trim(t2 +1,t3).xlogo("logo209_x_40_y_282_2.bmp", X=40, Y=282, alpha=0) ++\
Trim(t3 +1,t4) ++\
Trim(t4 +1,0).xlogo("logo209_x_40_y_282_2.bmp", X=40, Y=282, alpha=0)
The "t" parameters let me change the ranges fairly easily.
I looked at Stickboy's functions, but they either apply to sequences of on/off of constant length, or continuous ranges.
Or failing that, I tried to write a function so the parameters of the logo did not have to be repeated. But this DID NOT work:
(It fails with "incorrect parameters to xlogo".)
AVISource("209.avi")
function xl()
{
return xlogo("logo209_x_40_y_282_2.bmp", X=40, Y=282, alpha=0)
}
t0 =972
t1 =3412
t2 =6707
t3 =19745
t4 =20491
Trim(0 ,t0) ++\
Trim(t0 +1,t1).xl() ++\
Trim(t1 +1,t2) ++\
Trim(t2 +1,t3).xl() ++\
Trim(t3 +1,t4) ++\
Trim(t4 +1,0).xl()
I hope the intent is clear, so what have I done wrong?