Log in

View Full Version : Plugin for HTTP requests?


vampiredom
5th January 2014, 21:17
I seem to recall seeing a plugin that allows sending HTTP requests from AviSynth but I cannot for the life of me remember what it was called... or maybe I am imagining things and such a plugin does not exist.

I've been searching like a maniac but the terms (http, get, post, submit...) are so common that I cannot get any meaningful search results.

Can anyone enlighten me?

Guest
5th January 2014, 21:27
I never heard of such a thing but let's see who else chimes in...

vampiredom
5th January 2014, 21:36
Thanks for the reply. Maybe I dreamed it :) It is entirely possible. The context in which I remember it was just something simple; like, to send a completion notice to a URL. Obviously, I would like to do more than that (timeouts, GET/POST methods, retrieving variables, etc.) ... not sure if the plugin I "remember" does any of that or not. But you have to admit, such a thing could be handy.

Guest
5th January 2014, 23:29
But you have to admit, such a thing could be handy. OK, I'll bite. What are the interesting use cases?

vampiredom
6th January 2014, 00:08
OK, I'll bite. What are the interesting use cases?

Well, you could potentially log completion of different sources. Beyond that, you could log statistics on each source like input dimensions, framerate, perf stats, etc. You could also use it to sync different processes, wait for output from another process... It would open up a whole bunch of possibilities.

Basically, it would be useful for managing queues and such. Right now, I do this kind of stuff by writing static text files and reading them back in, which is messy and limited to local access.

Compelling enough? :)

Guest
6th January 2014, 00:11
Compelling enough? Not enough to code a filter for it (for me to code it that is). :p But I concede that it may be useful.

TurboPascal7
6th January 2014, 05:09
Maybe you should consider writing some code in an actual programming language and using avisynth from there instead of trying to use avs for something it wasn't designed to do.

Guest
6th January 2014, 05:21
I'll second that idea! :goodpost:

vampiredom
6th January 2014, 05:32
Maybe you should consider writing some code in an actual programming language and using avisynth from there instead of trying to use avs for something it wasn't designed to do.

The very nature of plugins and such is to add features that AviSynth wasn't "designed to do", one could reasonably say.

Guest
6th January 2014, 06:00
The point is that you can invoke Avisynth and its plugins programatically. Don't dismiss TurboPascal7's suggestion so lightly. It seems to me to be just what you need.

TurboPascal7
6th January 2014, 06:01
The very nature of plugins and such is to add features that AviSynth wasn't "designed to do", one could reasonably say.
No, one couldn't. Dunno where you got that idea.

Avisynth was designed for video filtering, not automatization of this filtering in any way. What you want is an external e.g. python or .NET app that would generate avs scripts, get all required data from files, monitor execution and send your HTTP request to whatever server you want. It could do a lot more and even use tools other than avisynth. As mentioned it could avoid the scripting interface altogether and just use avs via its api directly.

Avisynth is not nearly the right tool for this task, that's why a plugin like this doesn't exist, even though it's very simple to write.

vampiredom
6th January 2014, 06:37
I do not dismiss the point at all (as I do use programming languages for script generation in other cases) and I appreciate the suggestion.

I am certainly not looking to battle about it but I do not think it is unreasonable to desire being able to get or set external variables from within an AviSynth script – while you are apparently philosophically opposed to such functionality. So, it would be useful to me but not to you. That is OK.

For example, the most excellent CallCmd() and RT_Call() functions [and the old Call25.dll before them] allow for launching system commands (and thus passing info) from within AviSynth. I think this is very much in-line with the intentions of AviSynth and also very useful. I do not consider a function that works similarly but to a URL to be terribly different than that. And, as a matter of convenience, being able to make that communication bidirectional would be handy – for me, at least.

Thank you for your time and input.

mariush
8th January 2014, 07:13
Alternatively, if you don't know how to write an avisynth plugin, use a plugin that logs something to a file, then write a script running in background which polls that file for changes and does http requests based on what shows up in the file.

Super easy to do something like this in php or python for example

vampiredom
8th January 2014, 07:21
Super easy to do something like this in php or python for example

Yes, and thank you for the reply. That is the kind of stuff I normally would do when I need things like this. Obviously, for more 'robust' functionality designed from the bottom up, I would do something more like what TurboPascal7 suggested. I was looking for something for the simpler cases (and band-aid usage in existing scripts) that cut out the need for intermediary and temp files.