zorr
13th January 2019, 00:53
I hit a little snag using VSPipe to run the scripts in the optimizer. With Avisynth I'm using Groucho2004's avrs (https://forum.doom9.org/showthread.php?t=173259) tool which doesn't write the output video at all. Therefore it can output errors to stderr and normal output messages to stdout. AvisynthOptimizer interprets any messages to stderr as errors and stops running.
The situation with VSPipe is a bit more complex as it also outputs the video and especially when it's piped to other applications using stdout. For that reason (correct me if I'm wrong) it outputs all log messages to stderr.
I thought I can handle this however by detecting the most common stderr message which is "Output N frames in..." and not interpret that as an error. However I noticed plugins can also write all kinds of messages via the logMessage function. In this particular case rawsource always outputs "raws: check_args: src_format=..."-type message with log level mtDebug so it's just a debug message but it still comes out of stderr and the optimizer cannot know if that is a real error message or not.
So what I'd like to propose is a small behavior change to VSPipe when the outfile is a dot (.). In this case the video is not written to stdout so it could be used for normal log messages. The error messages would still go to stderr and the optimizer will then know that they're truly errors. What do you say Myrsloik, can it be done?
[EDIT] I had another idea: a new VSPipe option --loglevel which would filter out all log messages with lower level than the one specified. With that option as --loglevel mtCritical the optimizer would only receive real error messages. Probably easier to implement?
The situation with VSPipe is a bit more complex as it also outputs the video and especially when it's piped to other applications using stdout. For that reason (correct me if I'm wrong) it outputs all log messages to stderr.
I thought I can handle this however by detecting the most common stderr message which is "Output N frames in..." and not interpret that as an error. However I noticed plugins can also write all kinds of messages via the logMessage function. In this particular case rawsource always outputs "raws: check_args: src_format=..."-type message with log level mtDebug so it's just a debug message but it still comes out of stderr and the optimizer cannot know if that is a real error message or not.
So what I'd like to propose is a small behavior change to VSPipe when the outfile is a dot (.). In this case the video is not written to stdout so it could be used for normal log messages. The error messages would still go to stderr and the optimizer will then know that they're truly errors. What do you say Myrsloik, can it be done?
[EDIT] I had another idea: a new VSPipe option --loglevel which would filter out all log messages with lower level than the one specified. With that option as --loglevel mtCritical the optimizer would only receive real error messages. Probably easier to implement?