Log in

View Full Version : How do I start vsedit's 'engine'?


markfilipak
22nd September 2021, 00:27
In vsedit, Script > Check script
-------------------------------------
import vapoursynth as vs
core = vs.get_core()
-------------------------------------
Log
-------------------------------------
Failed to get the script output node.
-------------------------------------

I can't even succeed with what vsedit loads as default.

What am I doing wrong?

The 1st thing I want to do is 'core.svp1.list_functions()' but don't even know how to 'start the engine'.

Extensive searches have not brought Joy, so I'm here for help.

Thank You!
Mark.

Yomiko
22nd September 2021, 01:32
http://www.vapoursynth.com/doc/gettingstarted.html#example-script

vsedit is for previewing a video clip, for your case you may run in a python interpreter

markfilipak
22nd September 2021, 01:50
http://www.vapoursynth.com/doc/gettingstarted.html#example-script

vsedit is for previewing a video clip, for your case you may run in a python interpreter
Thanks, Yomiko,
I ran 'python.exe' and submitted
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
>>> import vapoursynth as vs
>>> core = vs.get_core()
<stdin>:1: DeprecationWarning: get_core() is deprecated. Use "vapoursynth.core" instead.
>>> import vapoursynth as vs
>>> core = vs.core()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'vapoursynth._CoreProxy' object is not callable
>>>

I apologize for being ignorant. Is there a starter guide for this?

markfilipak
22nd September 2021, 01:56
Actually, I guess you did help me make some progress. Look:
>>> core.svp1.list_functions()
'Analyse(clip:clip; sdata:int; src:clip; opt:data)\nSuper(clip:clip; opt:data)\n'
>>> core.svp2.list_functions()
'SmoothFps(clip:clip; super:clip; sdata:int; vectors:clip; vdata:int; opt:data; src:clip:opt; fps:float:opt)\n'
>>>

Is there a python environment browser (like a web browser) so I can hack the trees of the various built-in objects and methods?

Yomiko
22nd September 2021, 02:03
One of the following is sufficient
core = vs.core
from vapoursynth import core

> Is there a python environment browser
I'm interested in it too. Usually I end up moving to filter release pages.

markfilipak
22nd September 2021, 04:20
... > Is there a python environment browser
I'm interested in it too ...
You are! Do you know python?

When javascript and the DOM (document object model) were new, I managed to write such an object and property browser. The breakthrough came when I stumbled upon the global constructors, and that only because built-in objects have a '.__constructor' property that returned the constructor of that particular object's class. I don't know python except that it's object oriented. Does it have constructors? Can users write their own constructors? I would think so. Perhaps the snake lovers will help with the answer, eh?

Julek
22nd September 2021, 06:33
Failed to get the script output node.
Isn't that the message that pops up when you open the old vsedit in an API4 installation?

markfilipak
22nd September 2021, 16:20
Isn't that the message that pops up when you open the old vsedit in an API4 installation?
I don't know, Julek. I'm running the latest version. Confession: I don't know what 'API4' means.

"Failed to get the script output node" appears in the 'Log' panel and it prevents vsedit use.

Overall, I've done some pretty outrageous processing with VapourSynth but vsedit seems a dead loss. ...Pitty.

Thanks to Yomiko's push, I can do what I want directly in the python interpreter except that I can't work with vsedit. Perhaps in the future vsedit will perform a mind meld with the python interpreter and become a complete 'person'. ;)

DJATOM
22nd September 2021, 17:09
No one mentioned this, so try https://github.com/YomikoR/VapourSynth-Editor/releases/tag/r19-mod-2. It supports APIv4 builds (Vapoursynth R55).

> I don't know what 'API4' means.
APIv3 is a general use API that Vapoursynth used from Nov 11, 2012 to Sep 20, 2021. APIv4 is the current, up-to-date API with audio support and various internal improvements. Note that some APIv3 stuff got removed from APIv4, so there are few breaking changes, mostly all of them got a workaround nowadays.

Yomiko
23rd September 2021, 01:26
Isn't that the message that pops up when you open the old vsedit in an API4 installation?

Nah, it's because there's no set_output in the script. For old vsedit with new api the message is usually about invoking core.resize to compat format.

markfilipak
23rd September 2021, 04:27
... > Is there a python environment browser
I'm interested in it too.
Yomiko,

Try these to see some things.

>>> from vapoursynth import core
>>> core.list_functions
>>> core.list_functions()
>>> core.acrop.list_functions()
>>> core.__getattr__

A day ago or so I wrote about when I wrote a DOM browser shortly after the DOM was invented. I wrote that I stumbled across a built-in object's '.__constructor' property. I was wrong -- that was over 20 years ago. The property -- properties are called "attributes" in python -- was actually '.__prototype' -- the discovery that every DOM object has a '.__prototype' property was like finding the key to a lock on a door that needed to be opened. ...But the rest of my story was correct.

Methods like 'core.__getattr__' (and others to be discovered) are the keys to making an interactive python run-time system browser. I currently have too many balls in the air to devote time to it. But if you want to try, and will keep me updated, I'll try to help if you get stuck. Basically, it means guessing the names of fundamental run-time objects, object attributes, object methods, and functions. PM me if you like. If you're successful, it will benefit you, me, and others I'm sure.

Regards,
Mark.

markfilipak
23rd September 2021, 04:41
Isn't that the message that pops up when you open the old vsedit in an API4 installation?
Nah, it's because there's no set_output in the script. For old vsedit with new api the message is usually about invoking core.resize to compat format.
I tried several variations on 'set_output' but none worked, probably because I don't know python run-time architecture. But if you take the time to hack (or find) a python run-time browser, that will change. Otherwise, the run-time system remains a mystery.

Yomiko
23rd September 2021, 06:17
I tried several variations on 'set_output' but none worked, probably because I don't know python run-time architecture. But if you take the time to hack (or find) a python run-time browser, that will change. Otherwise, the run-time system remains a mystery.

I doubt you've made things unnecessarily complicated. If you have a video clip to preview, put clip.set_output() in the end of your script and use vsedit / vspreview, because in python we won't create a playback window in a few lines. Otherwise work in the interpreter because you want the texts in stdout / stderr.