Log in

View Full Version : Disable CAVIStreamSynth: System exception - Access Violation ....


mforbes6186
12th October 2010, 21:34
Hi guys

I'm having a problem with an external plugin that is resulting in the "CAVIStreamSynth: System exception - Access Violation at 0x0, reading from 0x0" error however the output video is fine to use, other than the red error text in the final few frames. Unfortunately the developer of the plugin is no longer contactable and there is no source code available to resolve this. So i'm wondering if there is any way to simply 'disable' this error message? I know what i'm asking may sound stupid as an error is there for a reason but in my case it is the error message that is causing the problem!

Thanks in advance!
Mark

EDIT

By the way, i've tried the SetMemoryMax(512) option to check for memory leaks but i'm 99.9% sure the error is in the plugin, not avisynth

IanB
13th October 2010, 01:56
If the error always occurs at the same frame number, you can Trim() or FreezeFrame() the final output so it does not access the fatal frame(s)....
Trim(0, 1234) # Frame 1235 and beyond cause a crash.

...
FreezeFrame(1235, 1235, 1234) # Frame 1235 cause a crash.

mforbes6186
13th October 2010, 08:08
thanks for the reply, I should have mentioned that the error happens at between 97-99.9% completion depending on the video clip. I think the problem with the source filter is that it's looking for the next frames after the end of the video file and so causes as crash as they don't exist. So by trimming the end of the video I will loose good frames off of some videos. What I meant was is there a way to actually disable the error message and just let the crash happen? as I said, the output video is fine except for the red error text hardcoded at the top

many thanks
mark

IanB
13th October 2010, 09:14
Access Violations are pretty catastrophic, they really should not happen.

The Avisynth language contains a Try/Catch construct but it only processes script compile time exceptions.

The runtime environment, i.e. ScriptClip() and friends, implement per frame script compilation. With some appropriate deviousness it may be possible to achieve close to what you want.

Try something like this at the end of your script as a starting point :-...
global result = last
Try {
ScriptClip("return result") # Might need something more active here, like return result.Trim(0, 0)
}
Catch(tmpmsg) {
return BlankClip(Last)
}

Gavino
13th October 2010, 10:47
Since, as you say, Try/Catch only processes compile time exceptions, wouldn't you need at least to put the Try inside the ScriptClip call? Eg (also removing unnecessary global variable ;))
ScriptClip("
Try {
return last # Might need something more active here, like return Trim(0, 0)
}
Catch(tmpmsg) {
return BlankClip(Last)
}
")
But even here the try won't catch an error in GetFrame of the source clip, since this happens after the run-time script is compiled (per frame). The 'something more active' needs to be something that calls GetFrame at compile-time. Can you think of anything suitable?

Edit: A run-time function should do the trick:
ScriptClip("
Try {
dummy = AverageLuma() # force GetFrame
return last
}
Catch(tmpmsg) {
return BlankClip(Last)
}
")

IanB
13th October 2010, 21:26
@Gavino,

Yep, that should do the trick ;)

Also ...AverageLuma(Crop(0,0, 16,1)) to reduce performance impact.