Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
#1 | Link |
|
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,267
|
possible Overlay() optimisation?
hi all.
i'm using this script to make scrolling credits: Code:
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)) """)
}
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?
__________________
interlace... right or wrong, just deal with it. Last edited by Mug Funky; 27th September 2006 at 10:48. Reason: forgot to finish typing |
|
|
|
|
|
#3 | Link |
|
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,267
|
aah. i could probably do that. that'll give more subpel accuracy as well (provided i use latest avisynth).
looks like it's back to the old drawing board ![]() however, is it possible for the cropresize stuff to go entirely off the screen (ie. not just repeat the edge pixels)? that can be desirable sometimes.
__________________
interlace... right or wrong, just deal with it. |
|
|
|
|
|
#4 | Link |
|
AviSynth Developer
![]() Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,468
|
Well - overlay converts the image to yv24 before it applies clipping, but it will only convert the mask, if any part of the image is visible.
Convert your images to YV12. The YV12 -> YV24 is much faster - especially for the mask. If you need to maintain chroma, use v2.6, as you can use YV24 natively. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|