PDA

View Full Version : Copying AviSynth error text....


jeffy
7th December 2007, 22:08
Is there a way how you can copy the error text in AviSynth (I use AvsP for editing)?

Note: this question was posted as a part of another post here: http://forum.doom9.org/showthread.php?p=1073678#post1073678
Is this considered a cross-post? :o
If yes, please advise what to do.

Fizick
7th December 2007, 22:19
(may be Messagebox should be replaced with some other dialog in Throwerror code....)

IanB
7th December 2007, 22:32
I assume you mean "catch" error code. :p

Fizick
7th December 2007, 23:08
probably i do not understand how it works...
seems we must patch all video applictions like vdudmod. But we can do it for vdubmod :)

Or we must patch a Windows?

Fizick
8th December 2007, 10:01
Idea for next version: implement putting error text to win clipboard

BTW, i often get this question from russian users. it is hard for them to re-type english text correctly.
Window screen copy is not very convinient for forums.

IanB
8th December 2007, 13:26
Not really an Avisynth issue. We are a library, it is the responsibility of the host application to discharge the error processsing.

Randomly trashing the clipboard contents would not be a very nice thing to do, especially as a side effect of getting and AVS script error.

Perhaps a helper application to independantly catch AVS script errors, not sure how to implement the IPC, maybe a small shared memory segment or something.

Fizick
8th December 2007, 16:02
may be provide small "Troubleshooting Player" with Avisynth ? ;)

jeffy
8th December 2007, 17:50
Well, I found out there is a way in a standard VirtualDub (tested version: 1.7.6.28292). Open the AVS file, click the OK button to confirm error window, click F8 for the log window, right click in the log window, select Copy to clipboard and here is the sample:
AVI: Opening file
"E:\new.avs"

[E] Error: Avisynth open failure:
Script error: there is no function named "mrestoren"
(E:\new.avs, line 17)

Leak
8th December 2007, 18:09
Perhaps a helper application to independantly catch AVS script errors, not sure how to implement the IPC, maybe a small shared memory segment or something.
How about debug-printing the AviSynth error when throwing it so you can simply grab it with DbgView?

np: Donnacha Costello - Mustard B CD Edit (Colorseries)

IanB
8th December 2007, 21:18
Yes, that's lateral thinking, and it would be quite simple to do.

buzzqw
8th December 2007, 22:42
How about debug-printing the AviSynth error when throwing it so you can simply grab it with DbgView?

yea.. more simply then copy paste error pop-up :rolleyes:

"and now launch the debugger.. don't be afraid.. i need only the row saing avisynth..."

better to generate a log file where the source input is...

BHH

IanB
9th December 2007, 04:00
As I said this is not an Avisynth issue, Avisynth is a library! As a library we can make no assumptions about there even being an external environment, everything must be inwards looking only.

Would it be okay for the C library to pop a dialogue box every time errno got set or maybe we could just randomly overwrite the clipboard contents, I think not!

It is the host applications job to provide the human interface to any error message text. Applications are allowed to quietly mask and correct certain error conditions, interfereing with this ability would be totally unacceptable.

Consider 1:- You are running an overnight batch of VirtualDub jobs. In the 2nd job you make a minor typo in the Avisynth script for that job, AviSynth independantly pops an Error Dialogue and waits for an OK click. Oh gee none of the other 30 odd jobs scheduled to run happen. Impressed yet!

Consider 2:- Again a batch of jobs running in the background while you happilly type up your Resume for a new job prospect, you are cutting and pasteing away merrily when in the background one of your jobs has a script error and dutifully overwrite the ClipBoard with the error message text. You paste the text and do not notice. Your resume makes an outstanding impression, NOT!

I hope we are starting to see the issue here. Anything done at the Avisynth Library level to allevaite the problem has to be very stealthy, like PrintDebugString or special helper apps with magic IPC methodology.

Fizick
9th December 2007, 11:04
Of course, not Avisynth must make the dialog. (It was my wrong first-look assumption about it. I rarely use anything besides VirtualDubMod)

Resume:
1. VitrualDub "log" solution by jeffy is rather good.
2. I will try understand why "show log" F8 does not work in VirtualdubMod :(
3. we should ask qwerpoi to implement text error message to AvsP. :)

BTW, dialog may be modal (? do not remember right word) and do not wait the user input ;)

IanB
9th December 2007, 21:52
BTW, dialog may be not modal ... and do not wait the user inputConsider 3:- You leave some batch process running, that can "repair" errors and retry the failed job. Next morning your task bar is solid black and windows is very sick with out of resource messages. Remember those pop up porn add web sites before pop-up blockers.


Also seems under XP using gungy old MessageBox() you can swipe the message text and copy it.

check
9th December 2007, 23:09
better to generate a log file where the source input is...
I like this idea, why not add a registry key that, if set, will log script.avs errors to script.txt?

IanB
10th December 2007, 05:23
@check,

More lateral thinking here :D And it is mostly inwards looking.

Only catch is we don't always know what script.avs is.

But the registry key could spec a global log file, i.e. C:\Avisynth_Error.Log that always gets error texts appended.

Ebobtron
10th December 2007, 06:51
Also seems under XP using gungy old MessageBox() you can swipe the message text and copy it.@IanB
Not the gungy old MBox() I am using. "What you talkin' about, Willis?"

stickboy
11th December 2007, 11:23
@IanB
Not the gungy old MBox() I am using. "What you talkin' about, Willis?"If you hit Ctrl+C for a standard Windows MessageBox, it'll copy its text to the clipboard.

check
11th December 2007, 12:46
For me, it would be best if you could always write to the directory where the input is. If the input location is not known, then use a standard log location, or don't write anything at all.

Writing to a standard location always would be more consistent, but it would be less usable -- people will be far more likely to have their script's directory open than e.g. the avisynth one.

Ebobtron
11th December 2007, 13:01
@stickboy Well, I'll be a "#?@!*&%!", Ctrl+c works.


:thanks:

Fizick
11th December 2007, 17:37
stickboy, thanks!
Seems, it is since win2000....
http://weblogs.asp.net/chuckop/archive/2004/04/08/110153.aspx

jeffy
12th December 2007, 00:08
stickboy, thanks!
This works even with VirtualDubMod!

stickboy
12th December 2007, 11:23
Getting back on topic:
But the registry key could spec a global log file, i.e. C:\Avisynth_Error.Log that always gets error texts appended.Why bother with a registry key? Why not let scripts call some AviSynth function that specifies how AviSynth should deal with errors and that specifies a log file location?

Like you said: it's a library, so the library consumers should be the things that control the behavior.

And if people want to globally set error-behavior for all their scripts without having to modify each one individually, they could just add a call to an .avsi file and stick it in their plug-in directory.

Or maybe I'm misunderstanding what types of errors we're talking about?

IanB
12th December 2007, 12:20
We are talking about scripts that have errors here.

How to understand what the user wants when the script is borked, bit of a problem.

I have contemplated magic things like#!/bin/shfrom the unix world. i.e. a magic 1st line comment. But the user can still bork it up.

At this point I can hope people keep spraying ideas, because sooner or later one of those ideas will give birth.