PDA

View Full Version : Countdown Leader


tin3tin
10th December 2007, 14:58
Here's an countdown leader for anyone who might need it :)

# countdown(width, height, fps, font size)
#By Tin2tin

countdown(720,576,25,400)#example

function countdown(int c_width, int c_height,float c_fps, int c_size)
{
a=blankclip(int(c_fps*10), c_width, c_height, fps=c_fps, stereo=true, audio_rate=48000)
b=blankclip(1, c_width, c_height, fps=c_fps, stereo=true, audio_rate=48000,color=$FFFFFF)
a=a.subtitle("AVISYNTH", align=5, first_frame=0, last_frame=0,size=int(c_size/4), font="Arial", text_color=$FFFFFF)
a=a.subtitle("10", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=1, last_frame=1,size=c_size, font="Arial", text_color=$FFFFFF)
a=a.subtitle(" 9", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=int(c_fps+1), last_frame=int(c_fps+1),size=c_size, font="Arial", text_color=$FFFFFF)
a=a.subtitle(" 8", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=int(c_fps*2+1), last_frame=int(c_fps*2+1),size=c_size, font="Arial", text_color=$FFFFFF)
a=a.subtitle(" 7", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=int(c_fps*3+1), last_frame=int(c_fps*3+1),size=c_size, font="Arial", text_color=$FFFFFF)
a=a.subtitle(" 6", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=int(c_fps*4+1), last_frame=int(c_fps*4+1),size=c_size, font="Arial", text_color=$FFFFFF)
a=a.subtitle(" 5", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=int(c_fps*5+1), last_frame=int(c_fps*5+1),size=c_size, font="Arial", text_color=$FFFFFF)
a=a.subtitle(" 4", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=int(c_fps*6+1), last_frame=int(c_fps*6+1),size=c_size, font="Arial", text_color=$FFFFFF)
a=a.subtitle(" 3", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=int(c_fps*7+1), last_frame=int(c_fps*7+1),size=c_size, font="Arial", text_color=$FFFFFF)
b=b.subtitle(" 2", int(c_width/2)-int(c_size/2), int(C_height/2)-int(c_size/2), first_frame=0, last_frame=0,size=c_size, font="Arial", text_color=$000000)
a=a.trim(0,int(c_fps*8+1))+b.trim(1,1).audiodub(tone(0.05, samplerate=48000))+a.trim(int(c_fps*8+2),int(c_fps*10))
return a
}

jeffy
10th December 2007, 20:14
Thank you, this is nice :)

Spuds
10th December 2007, 20:14
Thats kind of fun, got me to playing :D

Here is a version that takes the video that you are working with and transitions it from greyscale to color while transparent countdown numbers do a fade from white to black.

Load your video file as always and call it as:
countdown(last,25,400)


FUNCTION countdown(clip input,float c_fps, int c_size)
{
c_width=input.width()
c_height=input.height()
x_coord = int(c_width/2)-int(c_size/4)
y_coord = int(C_height/2)-int(c_size/2)
intro=input.trim(1,int(c_fps*10)).animate(1,int(c_fps*10),"tweak" ,0,0.0,0,1,0,1.0,0,1)
black_clip=blankclip(input, length=int(c_fps),color=$000000)

number=black_clip.subtitle("10", x_coord-c_size/4, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=mask_create(black_clip,number,intro,0,c_fps)
number=black_clip.subtitle("9", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,1,c_fps)
number=black_clip.subtitle("8", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,2,c_fps)
number=black_clip.subtitle("7", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,3,c_fps)
number=black_clip.subtitle("6", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,4,c_fps)
number=black_clip.subtitle("5", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,5,c_fps)
number=black_clip.subtitle("4", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,6,c_fps)
number=black_clip.subtitle("3", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,7,c_fps)
number=black_clip.subtitle("2", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,8,c_fps)
number=black_clip.subtitle("1", x_coord, y_coord, first_frame=1,last_frame=c_fps, size=c_size, font="Arial", text_color=$FFFFFF)
final=final+mask_create(black_clip,number,intro,9,c_fps)
RETURN final++input.trim(int(c_fps*10),0)

}
FUNCTION mask_create (clip black, clip number, clip input, int start, int step)
{
start=start*step+1
end=start+step-1
input=trim(input,start,end)
mask=mt_lutxy(black,number,"x y - 315 +").mt_invert.mt_expand
number=number.Animate(1, step,"Levels", 0,1,255,0,255, 0,1,255,255,0)
RETURN mt_merge(input,number,mask)
}