rkr1958
15th August 2005, 00:34
Got this working ... My Final Script ... I'm quite pleased with myself
#
# DVD Wallet Collection Slideshow
#
figure_path = "G:\DVD_Wallets_DVD\Images\"
clip = dvd_wallet_slideshow(29.97,4,figure_path+"Walt_Disney_Wallet\",".jpg",22,2,"Walt Disney","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"Children_1\",".jpg",20,0,"Children #1","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"Children_2\",".jpg",25,0,"Children #2","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"Children_3\",".jpg",10,14,"Children #3","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"Christmas_Holiday\",".jpg",13,13,"Christmas & Holiday","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"US_Girls_1\",".jpg",22,0,"US & Girls #1","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"US_Girls_2\",".jpg",22,0,"US & Girls #2","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"US_Girls_3\",".jpg",10,13,"US & Girls #3","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"Guys_1\",".jpg",17,0,"Guy Movies #1","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"Guys_2\",".jpg",20,0,"Guy Movies #2","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"Guys_3\",".jpg",4,15,"Guy Movies #3","DVD Collection")
clip = clip + dvd_wallet_slideshow(29.97,4,figure_path+"Sci_Fi_Fantsy_1\",".jpg",11,4,"Sci Fi & Fantasy #1","DVD Collection")
return clip
#
# function dvd_wallet_slideshow(frame_rate,time,figure_path,figure_ext,number_of_clips,number_of_slots,text_top,text_bottom)
#
function dvd_wallet_slideshow(frame_rate,time,figure_path,figure_ext,number_of_clips,number_of_slots,text_top,text_bottom)
{
clip = make_blank_clip(frame_rate,1,text_top,text_bottom)
clip = make_slideshow(clip,figure_path,figure_ext,1,number_of_clips,frame_rate,time,text_top,text_bottom)
clip = make_empty_slot_clip(clip, 1, number_of_slots, frame_rate, 1., text_top, text_bottom)
return clip
}
#
#
# function make_empty_slot_clip
#
function make_empty_slot_clip(clip, slot_number, number_of_slots, frame_rate, time, text_top, text_bottom)
{
return (slot_number > number_of_slots) ? clip : \
make_empty_slot_clip(clip + make_dvd_slot(frame_rate,ceil(frame_rate*time),text_top ,text_bottom,slot_number), \
slot_number + 1, number_of_slots, frame_rate, time, text_top, text_bottom)
}
#
# function make_dvd_slot
#
function make_dvd_slot(frame_rate,frames,text_top,text_bottom,slot_number)
{
clip = blankclip(length=frames, width=720, height=480, fps=frame_rate, color=$000000, audio_rate=0).converttoYUY2()
clip = subtitle(clip, "Available DVD", text_color=$ffff00, x=-1, y=200, size=76)
clip = subtitle(clip, "Slot # "+string(slot_number), text_color=$ffff00, x=-1, y=300, size=76)
clip = subtitle(clip, text_top, text_color=$ffffff, align=7, x=4, y=16, size=18)
clip = subtitle(clip, text_bottom, text_color=$ffffff, align=7, x=4, y=32, size=18)
return clip
}
#
# function make_blank_clip
#
function make_blank_clip(frame_rate,frames,text_top,text_bottom)
{
clip = blankclip(length=frames, width=720, height=480, fps=frame_rate, color=$000000, audio_rate=0).converttoYUY2()
clip = subtitle(clip, text_top, text_color=color_limegreen, x=-1, y=200, size=76)
clip = subtitle(clip, text_bottom, text_color=color_limegreen, x=-1, y=300, size=76)
return clip
}
#
# function make_slideshow
#
function make_slideshow(clip,figure_path,figure_ext,clip_number,number_of_clips,frame_rate,time,text_top,text_bottom)
{
return (clip_number > number_of_clips) ? clip : \
make_slideshow(clip + make_image_clip(figure_path+string(clip_number)+figure_ext,frame_rate,time,text_top,text_bottom), \
figure_path,figure_ext,clip_number+1,number_of_clips,frame_rate,time,text_top,text_bottom)
}
#
# function make_image_clip
#
function make_image_clip(image_name,frame_rate,time,text_top,text_bottom)
{
# This function reads in an image == image_name and makes it a clip of length == time & frame rate == frame_rate
frames = ceil(frame_rate * time)
clip = imagesource(image_name).trim(0,-1).loop(frames).assumefps(frame_rate)
w = width(clip)
h = height(clip)
scale_factor = 448. / h
w = round(w * scale_factor)
h = round(h * scale_factor)
clip = clip.bilinearresize(w,h)
w1 = int((720-w)/2)
w2 = 720 - w - w1
h1 = int((480-h)/2)
h2 = 480 - h - h1
clip = addBorders(clip,w1,h1,w2,h2).converttoYUY2()
clip = subtitle(clip, text_top, text_color=$ffffff, align=7, x=4, y=16, size=18)
clip = subtitle(clip, text_bottom, text_color=$ffffff, align=7, x=4, y=32, size=18)
return clip
}
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.