Log in

View Full Version : Scrolling credits using Animate


Floatingshed
18th October 2011, 15:06
I have been attempting to create some classic tv scrolling credits.
The below script works well but it is too fast. I cannot get my head around altering the scrolling speed and keeping the spacing of the subtitles as they are. Most of this code has been copied from elsewhere, Animate always gives me a headache. Please help!

BlankClip(length=1000, width=720, height=576,
\pixel_type="YV12", fps=25, fps_denominator=1, audio_rate=48000,
\stereo=True, sixteen_bit=True, color=$000000)

st=40
fn=200

V= last

function credits (clip video, int sf, int ef, string words)
{
Animate(video, sf, ef, "subtitle",
\words, -1, 780, sf, ef, "Times New Roman", 40, $FFFFFF,
\words, -1, -450, sf, ef, "Times New Roman", 40, $FFFFFF)
}

V1=credits(V, st, fn, "Det Chief Insp Wexford")
V2=credits(V1, st+5, fn+5, "GEORGE BAKER")

V3=credits(V2, st+20, fn+20, "Det Insp Burden")
V4=credits(V3, st+25, fn+25, "CHRISTOPHER RAVENSCROFT")

V5=credits(V4, st+40, fn+40, "Zeno")
V6=credits(V5, st+45, fn+45, "PETER CAPALDI")

V7=credits(V6, st+60, fn+60, "Louis Mbowele")
V8=credits(V7, st+65, fn+65, "KWABENO MANSO")

V9=credits(V8, st+80, fn+80, "Dora Wexford")
V10=credits(V9, st+85, fn+85, "LOUIE RAMSAY")

V11=credits(V10, st+100, fn+100, "Det Sgt Martin")
V12=credits(V11, st+105, fn+105, "KEN KITSON")

V12

Gavino
18th October 2011, 16:22
The scrolling speed is determined by the difference between st and fn, while the spacing depends on the frame increments between each credit line.

To slow it down, increase fn. Then, to maintain the spacing, increase the step between each credit by the same ratio.
For example, to halve the speed, set fn=360 (fn-st is now 320 instead of 160), while doubling the increments between lines:

V1=credits(V, st, fn, "Det Chief Insp Wexford")
V2=credits(V1, st+10, fn+10, "GEORGE BAKER")

V3=credits(V2, st+40, fn+40, "Det Insp Burden")
V4=credits(V3, st+50, fn+50, "CHRISTOPHER RAVENSCROFT")
etc.

Floatingshed
18th October 2011, 16:40
I see, yes thanks.
This would mean lots of changes to tweak the speed for each new use of the script. Do you think it would be practicable to have a speed variable that would alter all the necessary parameters at once?

Gavino
18th October 2011, 17:33
You could do something like this:
inc = (fn-st)/8
inc2 = (fn-st)/32

V1=credits(V, st, fn, "Det Chief Insp Wexford")
V2=credits(V1, st+inc2, fn+inc2, "GEORGE BAKER")

V3=credits(V2, st+inc, fn+inc, "Det Insp Burden")
V4=credits(V3, st+inc+inc2, fn+inc+inc2, "CHRISTOPHER RAVENSCROFT")

V5=credits(V4, st+2*inc, fn+2*inc, "Zeno")
V6=credits(V5, st+2*inc+inc2, fn+2*inc+inc2, "PETER CAPALDI")
...
V11=credits(V10, st+5*inc, fn+5*inc, "Det Sgt Martin")
V12=credits(V11, st+5*inc+inc2, fn+5*inc+inc2, "KEN KITSON")
Then you can change the speed just by altering fn, and the spacing will be automatically maintained.

Floatingshed
18th October 2011, 18:12
I'll have a play. Thanks for the use of your brain!