Mug Funky
27th September 2006, 09:46
hi all.
i'm using this script to make scrolling credits:
function credits (clip c, string image, int inframe, int outframe)
{
global cr_c = c
global cr_image40 = imagesource(image,end=0).converttorgb32()
global cr_image31 = cr_image40.generalconvolution(matrix="0 0 0 0 3 0 0 1 0")
global cr_image22 = cr_image40.generalconvolution(matrix="0 0 0 0 2 0 0 2 0")
global cr_image13 = cr_image40.generalconvolution(matrix="0 0 0 0 1 0 0 3 0")
global cr_flat = cr_image40.blankclip(color=$ffffff)
global cr_in = inframe
global cr_out = outframe
cr_evaluate1 = c.scriptclip(""" overlay(cr_c,cr_flat,mask=cr_image,y=int(off_y) ) """)
cr_evaluate2 = frameevaluate(cr_evaluate1,""" global cr_image = 4-(4*(off_y-int(off_y)))+.5 < 1 ? cr_image40 :
\ 4-(4*(off_y-int(off_y)))+.5 < 2 ? cr_image31 :
\ 4-(4*(off_y-int(off_y)))+.5 < 3 ? cr_image22 : cr_image13""")
frameevaluate(cr_evaluate2,""" off_y = (576 + cr_in*(cr_image40.height/float(cr_out - cr_in)))
\ - current_frame*(cr_image40.height/float(cr_out - cr_in)) """)
}
and it's kinda slow.
i'm loading a very large .png file, and this script is scrolling it up according to the in and out points.
the only problem is it's very slow. i'm guessing that overlay is rendering all 13858 lines of my png every frame.
is it possible for overlay to be modified so it only works with what's inside the frame size of the input clip?
i'm using this script to make scrolling credits:
function credits (clip c, string image, int inframe, int outframe)
{
global cr_c = c
global cr_image40 = imagesource(image,end=0).converttorgb32()
global cr_image31 = cr_image40.generalconvolution(matrix="0 0 0 0 3 0 0 1 0")
global cr_image22 = cr_image40.generalconvolution(matrix="0 0 0 0 2 0 0 2 0")
global cr_image13 = cr_image40.generalconvolution(matrix="0 0 0 0 1 0 0 3 0")
global cr_flat = cr_image40.blankclip(color=$ffffff)
global cr_in = inframe
global cr_out = outframe
cr_evaluate1 = c.scriptclip(""" overlay(cr_c,cr_flat,mask=cr_image,y=int(off_y) ) """)
cr_evaluate2 = frameevaluate(cr_evaluate1,""" global cr_image = 4-(4*(off_y-int(off_y)))+.5 < 1 ? cr_image40 :
\ 4-(4*(off_y-int(off_y)))+.5 < 2 ? cr_image31 :
\ 4-(4*(off_y-int(off_y)))+.5 < 3 ? cr_image22 : cr_image13""")
frameevaluate(cr_evaluate2,""" off_y = (576 + cr_in*(cr_image40.height/float(cr_out - cr_in)))
\ - current_frame*(cr_image40.height/float(cr_out - cr_in)) """)
}
and it's kinda slow.
i'm loading a very large .png file, and this script is scrolling it up according to the in and out points.
the only problem is it's very slow. i'm guessing that overlay is rendering all 13858 lines of my png every frame.
is it possible for overlay to be modified so it only works with what's inside the frame size of the input clip?