PDA

View Full Version : Avisynth ACCESS VIOLATION


rajkosto
6th August 2006, 02:41
Video=DirectShowSource("videoz.avi")
logo=imagesource("C:\logo_rgb.bmp")
logoalpha=imagesource("C:\logo_alpha.bmp")
bands=((((Video.Width/4)*3)-Video.Height)/2)
Video=AddBorders(Video,0,int(bands),0,int(bands)).BilinearResize(768,576).Overlay(logo,mask=logoalpha,x=582,y=48)

WhiteBar=blankclip(Video, 200, 768,576, color = $FFFFFF)

Video=ScriptClip(Video,"WhiteBarFunc(Video,WhiteBar,whitewidth)").ConditionalReader("C:\whitebarz.txt","whitewidth",false)

Return Video


Function WhiteBarFunc (clip c, clip bar, int width)
{
Return (width>0) ? c.Overlay(bar.crop(0,0,width, 34),x=58,y=84) : c
}

Type int
Default 0

1 37
2 74
3 74
4 64
5 26
6 0
7 80
8 196
9 194
10 116
11 64
12 118
13 192
14 96
15 223
16 315
17 222
18 95
19 133
20 407
R 21 181 612
182 536
183 236
184 50
185 121
186 159
187 158
188 152
189 79
190 32
191 83
192 152
193 152
194 84
195 31
196 58
197 95
198 92
199 39
200 0


First thing is script,second is animation thingy that i feed into ScriptClip.

As you see i commented most things,and left it bare with blank sources...it will still generate the exception...i have cleared the functions...just make them return C...still exception...however if i use subtitle(string(whitewidth)) instead WhiteBarFunc...it will work and give me the number from the script file.
I noticed that all my previous commands required Video= infront of them,but the script one doesnt accept that...either using Video=WhiteBarFunc(Video,WhiteBar,whitewidth) or Video=Video.WhiteBarFunc(WhiteBar,whitewidth) will result in same error,avisynth saying : I dont know what Video means.

I renamed the var and it will still say the same..

So please fix this access violation bug...as i have been trying to do this for a week now,with different progs...

IanB
7th August 2006, 05:36
Both links give "404 Not Found "

rajkosto
7th August 2006, 13:23
I've put them in code brackets in the actual post now,also...the access violation is given when i use AviSynth 2.57 alpha...When i use AviSynth 2.56 it just closes the player as soon as the file is opened.
What im trying to do with this script is
1.Put a transparent logo on the video (already works)
2.Make a animating bar,whose left,top offset and height are static,but the width animates according to the script (so it grows and shrinks,you know what i mean)
3.Add fade in text above the bar,make it stay there for a while,then let it fade out ( iahevn't done this yet because the bar is giving me trouble)

rajkosto
7th August 2006, 19:36
nvm i fixed all these thigns with hacks since avisynth sucks !

Wilbert
8th August 2006, 20:01
nvm i fixed all these thigns with hacks since avisynth sucks !
I can look at it coming saturday, but your positive words don't encourage me very much.

I guess you the problem is that you need to define some variables and clips as global.