Log in

View Full Version : AVS script troubleshooting / error logs


rangi500
14th November 2008, 12:28
Hello,

I'm writing lots of different AVS scripts and some of them intermittently fail, with an error message in red text in the output video.

However, the video is so "zoomed in" on the red text that only a small part of it is visible (most of it it off the sides of the video).

Is it possible in AviSynth to specify for all errors to go into a log file? I've looked through the manual and searched this forum but can't find this info.

Any help much appreciated!
Rangi

IanB
14th November 2008, 12:48
try {
...
statements
...
}
catch(err_msg) {
BlankClip()
WriteFileStart ("filename", err_msg, True)
}

rangi500
14th November 2008, 12:59
That's great, thanks very much, will give that a go

Gavino
14th November 2008, 18:59
WriteFileStart ("filename", err_msg, True)

Since the argument to the WriteFile (http://avisynth.org/mediawiki/WriteFile)set of functions is an expression that gets evaluated and its result written out, this needs to be
WriteFileStart ("filename", "err_msg", True)
In the case of WriteFile itself, this makes sense because the expression is evaluated on each frame, but for WriteFileStart/End, I think it would have made more sense for the arguments to be values that were written directly.