View Full Version : Vapoursynth
lansing
10th August 2020, 16:46
Found another memory leak when calling the evaluateScript function:
https://forum.doom9.org/showthread.php?p=1920641#post1920641
Way to reproduced it, with vseditor 2, load a script, open the PF window, and spam switching between the YUV channels (it is calling evaluateScript internally). memory would kept going up and wouldn't come down even when the script was closed.
vcmohan
11th August 2020, 08:42
http://www.vapoursynth.com/doc/functions/frameeval.html
I tried using this construct. VsEditor checks it OK but when I run virtualdub hangs. My code is
base = core.vcmove.deBarrel(ret,a = 0.05, b= 0.05, c = 0.05,test = 1)
def animator(n,clip):
if n > 20:
return clip
else:
return core.vcmove.deBarrel(ret,a = n * 0.0025 + 0.0005, b= 0.05, c = 0.05, test = 1)
ret = core.std.FrameEval(base,functools.partial(animator,clip=base))
Whats wrong with my code?
ChaosKing
11th August 2020, 09:03
Shouldn't it be vcmove.DeBarrel ?
You have a type. it should be clip and not ret
return core.vcmove.deBarrel(ret,a = n * 0.0025 + 0.0005, b= 0.05, c = 0.05, test = 1)
Check only can not spot every error, use the preview function in vsedit, because it is triggert on frame request.
EDIT
ok check does spot this error too...
EDIT2
Oh and YUV444 (10-32bit) produces a green image, rgb & YUV444P8 looks both okay.
https://i.imgur.com/yG1FPzp.png
EDIT3
only RGB24 is ok higher precision is also broken for rgb.
Or is it just not supported?
vcmohan
11th August 2020, 12:14
Thanks to @ChaosKing. Now I am changing the name to deBarrel. It is in my computer. Not yet uploaded. I will address issues pointed out by you.
feisty2
15th August 2020, 20:08
fun stuff: https://github.com/IFeelBloated/VaporMagik/blob/master/VaporMagik.py
tired of the verbosity of filter calling syntax? cannot patch cython types like vs.VideoNode and list?
with VaporMagik, no more
clip = core.std.StackHorizontal([clip, core.std.Expr([clip, Adjust(clip, -0.4)], "x y + 2 /")])
instead, you can use the member function calling syntax, like in avisynth!
clip = [clip, [clip, clip.Adjust(-0.4)].Expr("x y + 2 /")].StackHorizontal() (https://github.com/IFeelBloated/VaporMagik/blob/master/Test.vpy#L17)
Myrsloik
15th August 2020, 21:40
fun stuff: https://github.com/IFeelBloated/VaporMagik/blob/master/VaporMagik.py
tired of the verbosity of filter calling syntax? cannot patch cython types like vs.VideoNode and list?
with VaporMagik, no more
clip = core.std.StackHorizontal([clip, core.std.Expr([clip, Adjust(clip, -0.4)], "x y + 2 /")])
instead, you can use the member function calling syntax, like in avisynth!
clip = [clip, [clip, clip.Adjust(-0.4)].Expr("x y + 2 /")].StackHorizontal() (https://github.com/IFeelBloated/VaporMagik/blob/master/Test.vpy#L17)
Interesting alternative. Btw, what happens if there are duplicate function names in different plugins?
DJATOM
16th August 2020, 07:52
https://github.com/Endilll/vapoursynth/commit/055b083ef7b5b11c8591f6d17bdafeca718fbc4d - yet another way to do that (it's just enough to call core.augment(locals) after imports).
feisty2
16th August 2020, 09:00
Interesting alternative. Btw, what happens if there are duplicate function names in different plugins?
C++ filters, user defined python functions and other attributes are currently manually registered thru the Injector object, I haven't decided a proper way to auto-register everything but for manual attribute registration, the user can specify unique names for attributes with conflicting symbols or define some customized logic to manually solve the conflicts
def Super(self, *args, **kw):
if self.format.bits_per_sample == 32:
return core.mvsf.Super(self, *args, **kw)
else:
return core.mv.Super(self, *args, **kw)
Injector.TargetType = VideoNode
Injector["Super"] = Super
clp1 = core.std.BlankClip(format = GRAYS)
clp2 = core.std.BlankClip(format = GRAY16)
clp1 = clp1.Super() # calls core.mvsf.Super
clp2 = clp2.Super() # calls core.mv.Super
the Injector object is also capable of dynamically attaching attributes to built-in types like list or str to enable magic syntax like these:
clp = [clp1, clp2].Expr("x y + 2 /")
clp = "x y + 2 /".Render([clp1, clp2])
ideas on how to solve name conflicts of different plugins or even conflicts between C++ filters and python functions for auto-registration are welcome!
Jukus
17th August 2020, 12:44
How do I use std.AssumeFPS but still keep the original duration?
LigH
17th August 2020, 13:30
If you change the duration of every frame, but keep the number of frames constant, the overall playtime must change as well. Rule of proportion.
Typical example: "PAL speedup" – changing the frame rate from 24 fps to 25 fps causes a 1/25 shorter playtime.
Myrsloik
20th August 2020, 19:04
R52-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R52-RC1)
Everyone should update from R51 due to some nasty bugs that were recently discovered. Expect a release soon if nothing serious is found.
r52:
updated visual studio 2019 runtime version
updated zimg
updated vsrepo with support for python wheel packages
vsgenstubs is now included with vsrepo
fixed deadlock in fmserial filters introduced in r51
fixed maximum for 16 bit input with diagonal filters and optimizations
fixed more averageframes bugs (sekrit-twc)
Cary Knoop
20th August 2020, 19:15
R52-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R52-RC1)
Everyone should update from R51 due to some nasty bugs that were recently discovered. Expect a release soon if nothing serious is found.
r52:
updated visual studio 2019 runtime version
updated zimg
updated vsrepo with support for python wheel packages
vsgenstubs is now included with vsrepo
fixed deadlock in fmserial filters introduced in r51
fixed maximum for 16 bit input with diagonal filters and optimizations
fixed more averageframes bugs (sekrit-twc)
Ah, that explains, thanks for the update!
ChaosKing
20th August 2020, 20:17
Will you keep the "new name" vspackages3.json for the vsrepo file?
Myrsloik
20th August 2020, 20:19
Will you keep the "new name" vspackages3.json for the vsrepo file?
Yes, that way it won't create conflicts with older versions.
Myrsloik
23rd August 2020, 14:29
R52 (https://github.com/vapoursynth/vapoursynth/releases/tag/R52)
Identical to RC1 if you don't want to redownload. Mostly regression fixes for R51.
mastrboy
25th August 2020, 02:20
Is there something similar to Avisynth TCPServer for Vapoursynth?
I have a headless Debian Linux server that I would like to utilize for Vapoursynth, and run a Gui script editor like VapoursynthEditor on a different Windows machine.
t3nzin
25th August 2020, 04:41
Is there something similar to Avisynth TCPServer for Vapoursynth?
I have a headless Debian Linux server that I would like to utilize for Vapoursynth, and run a Gui script editor like VapoursynthEditor on a different Windows machine.
https://github.com/Beatrice-Raws/VapourSynth-TCPClip
lansing
25th August 2020, 07:28
I have a function in vseditor that create a vscore from the api and then free it right away, however the memory didn't get released.
const VSAPI * cpVSAPI = m_pVSScriptLibrary->getVSAPI();
VSCore *pCore = cpVSAPI->createCore(0);
cpVSAPI->freeCore(pCore);
Each call to the function leaked about 9 MB.
Myrsloik
25th August 2020, 10:51
R52 portable updated since I forgot to include the VS2019 runtime dlls.
mastrboy
25th August 2020, 14:49
https://github.com/Beatrice-Raws/VapourSynth-TCPClip
Thanks.
Having an issue getting it to work though:
Error:
vspipe test.vpy -
Script evaluation failed:
Python exception: name 'get_output' is not defined
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 2244, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 2245, in vapoursynth.vpy_evaluateScript
File "test.vpy", line 9, in <module>
Server('0.0.0.0', 14322, get_output(), threads=8, log_level='info')
NameError: name 'get_output' is not defined
Script:
import vapoursynth as vs
from vapoursynth import core
from TCPClip import Server
video = core.std.BlankClip(width=640,height=480, format=vs.RGB24, length=500, fpsnum=2997, fpsden=125, color=[0, 0, 0])
video.set_output()
Server('0.0.0.0', 14322, get_output(), threads=8, log_level='info')
get_output should be a VapourSynth function according to the docs: http://www.vapoursynth.com/doc/pythonreference.html#get_output
Any idea what I'm doing wrong here?
vspipe --version
VapourSynth Video Processing Library
Copyright (c) 2012-2020 Fredrik Mellbin
Core R52
API R3.6
Options: -
DJATOM
25th August 2020, 15:37
> import vapoursynth as vs
So it goes to vs.get_output(), I assume. I imported it into script directly, so no namespace in example.
mastrboy
25th August 2020, 16:11
> import vapoursynth as vs
So it goes to vs.get_output(), I assume. I imported it into script directly, so no namespace in example.
That worked, thanks.
Another thing I noticed, which I'm unsure if it's a bug or user error on my side.
The frameserving works as expected now, when running it with python: python3 test.vpy
Server [info]: socket created.
Server [info]: socket bind complete.
Server [info]: listening the socket.
Server [info]: accepting connection from 192.168.10.5:65514.
Server [info]: connection 192.168.10.5:65514 closed.
But gives errors with vspipe:
vspipe test.vpy -
Server [info]: socket created.
Server [info]: socket bind complete.
Server [info]: listening the socket.
Server [info]: accepting connection from 192.168.10.5:65368.
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 674, in vapoursynth.frameDoneCallbackRaw
File "src/cython/vapoursynth.pyx", line 604, in vapoursynth.RawCallbackData.receive
File "src/cython/vapoursynth.pyx", line 600, in vapoursynth.RawCallbackData.handle_future
File "src/cython/vapoursynth.pyx", line 355, in vapoursynth.use_environment
TypeError: cannot create weak reference to 'NoneType' object
DJATOM
25th August 2020, 17:22
Yeah, because you need to run server side via python. Client side might be used as python script in case you just need to encode result from the other server. That mode will be more efficient as no extra data copy will occur. Also you can use VS source mode if you want to split procession between servers. Received data will be copied into re-created clip (it makes std.BlankClip internally and stuff it with server's data using std.FrameEval).
mastrboy
25th August 2020, 21:56
Yeah, because you need to run server side via python. Client side might be used as python script in case you just need to encode result from the other server. That mode will be more efficient as no extra data copy will occur. Also you can use VS source mode if you want to split procession between servers. Received data will be copied into re-created clip (it makes std.BlankClip internally and stuff it with server's data using std.FrameEval).
I see, so calling the scripts through python and not vspipe is the correct usage when TCPClip is involved on the server side.
Are you planning on adding Huffman/Gzip compression like Avisynth TCPServer has?
I'm currently bottle-necked by my network bandwidth, probably since the frames are transferred uncompressed.
DJATOM
26th August 2020, 15:25
I thought about adding LZO compression, it should be fast and probably effective enough for 1080p content. The other option is involving ffv1, which can save more bandwidth, but I'll have to overhaul script's logic to support that (for example, we will need to encode output by chunks and send those chunks, not frames). Anyway I've got a lot of work last months and don't have enough time for TCPClip development. Once I'll have more free time, I'll consider that.
Selur
27th August 2020, 16:24
using:
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020cl", range_in=0, range=0)
I get:
Resize error 3074: invalid colorspace definition (5/10/2 => 10/10/2). May need to specify additional colorspace parameter
So I'm guessing I'm missing some additional colorspace parameter.
Looking at http://www.vapoursynth.com/doc/functions/resize.html
Didn't really help and using, trying to add a transfer characteristics with:
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020cl", range_in=0, range=0,transfer_in="470m")
I get
Python exception: invalid literal for int() with base 10: '470m'
-> would be nice if someone could update the documentation (http://www.vapoursynth.com/doc/functions/resize.html) in a way that it includes the int values.
=> Can someone tell me what parameters are additionally needed and if they map to int, where to lookup those int values.
Cu Selur
Cary Knoop
27th August 2020, 16:42
Resize error 3074: invalid colorspace definition (5/10/2 => 10/10/2). May need to specify additional colorspace parameter
Do you get this message by viewing the result with Vapoursynth Editor?
You do not need to use a transfer characteristic for a matrix transform but you do need it for instance if you want to change the primaries because that requires a linear operation.
poisondeathray
27th August 2020, 17:26
-> would be nice if someone could update the documentation (http://www.vapoursynth.com/doc/functions/resize.html) in a way that it includes the int values.
_Al_ posted a link before
https://github.com/UniversalAl/view/blob/02bbbd982b346d0131e479478ab9949690c4bf7b/view.py#L121
TRANSFER = {
#transfer_in or transfer : transfer_in_s or transfer_s
0:'reserved',
1:'709',
2:'unspec',
3:'reserved',
4:'470m',
5:'470bg',
6:'601',
7:'240m',
8:'linear',
9:'log100',
10:'log316',
11:'xvycc',
13:'srgb',
14:'2020_10',
15:'2020_12',
16:'st2084',
18:'std-b67'
}
MATRIX = {
#matrix_in or matrix : matrix_in_s or matrix_s
0:'rgb',
1:'709',
2:'unspec',
3:'reserved',
4:'fcc',
5:'470bg',
6:'170m',
7:'240m',
8:'ycgco',
9:'2020ncl',
10:'2020cl' ,
12:'chromancl',
13:'chromacl',
14:'ictcp'
}
PRIMARIES = {
#primaries_in or primaries : primaries_in_s or primaries_s
1 : '709' ,
2 : 'unspec' ,
4 : '470m' ,
5 : '470bg' ,
6 : '170m' ,
7 : '240m' ,
8 : 'film' ,
9 : '2020' ,
10 : 'st428' , #'xyz'
11 : 'st431-2',
12 : 'st432-1',
22 : 'jedec-p22'
}
Selur
27th August 2020, 20:48
Do you get this message by viewing the result with Vapoursynth Editor?
yes.
You do not need to use a transfer characteristic for a matrix transform but you do need it for instance if you want to change the primaries because that requires a linear operation.
Okay, now I have still no clue what parameter is missing. :)
_Al_ posted a link before
Thanks for the info about the numbers. Sorry, in advance. I'll probably ask this every few months till this is also somewhere in the documentation or like matrix_in_s and matrix_s you can also use the string names for transfer_in_s, transfer_s, primaries_in_s , primaries_s . :)
-> so still hoping someone can tell me what additional parameters are needed. :)
Cu Selur
Cary Knoop
27th August 2020, 21:03
yes.
Okay, now I have still no clue what parameter is missing. :)
The problem is the Vapoursynth Editor.
If you call this hack function the problem goes away:
def TrickIt(c):
c = core.std.SetFrameProp(c,prop="_Matrix",delete=True)
c = core.std.SetFrameProp(c,prop="_Transfer",delete=True)
c = core.std.SetFrameProp(c,prop="_Primaries",delete=True)
return c
But don't use this when you actually encode the video.
Selur
28th August 2020, 16:10
Thanks I'll try it. :)
Selur
28th August 2020, 19:09
@Cary Knoop: Doesn't help here.
using:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# loading source: F:\TestClips&Co\files\test.avi
# color sampling YUV420P8@8, matrix:470bg, scantyp: progressive
# luminance scale TV
# resolution: 640x352
# frame rate: 25 fps
# input color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25
# Loading source using FFMS2
clip = core.ffms2.Source(source="F:/TestClips&Co/files/test.avi",cachefile="E:/Temp/avi_078c37f69bb356e7b5fa040c71584c40_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
clip = core.std.SetFrameProp(clip,prop="_Matrix",delete=True)
clip = core.std.SetFrameProp(clip,prop="_Transfer",delete=True)
clip = core.std.SetFrameProp(clip,prop="_Primaries",delete=True)
# ColorMatrix: adjusting color matrix from 470bg to 2020cl
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020cl", range_in=0, range=0)
# Output
clip.set_output()
I still get:
Error getting the frame number 0:
Resize error: Resize error 3074: invalid colorspace definition (5/2/2 => 10/2/2). May need to specify additional colorspace parameters.
Cu Selur
_Al_
28th August 2020, 19:37
To delete props before resize does not make sense, only after resize if you want to trick whatever folows (vsedit).
_Al_
28th August 2020, 19:43
And what happen if you serve it for vsedit in RGB, so it does not do anything, only just converting it losslessly to QT5 pixmap?
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020cl", range_in=0, range=0)
clip = core.resize.Point(clip=clip, matrix_in_s="2020cl", format=vs.RGB24)
clip.set_output()
Selur
28th August 2020, 19:51
Seems to work fine if I set a transfer beforehand for example:
# ColorMatrix: adjusting color matrix from 470bg to 2020ncl
clip = core.std.SetFrameProp(clip,prop="_Transfer",intval=1)
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020ncl", range_in=0, range=0)
Not sure what vsViewer does internally (to lazy to check he code atm.), settings a transfer value is fine for me.
Cu Selur
Ps.: Still the documentation isn't really helping and should be adjusted.
Selur
29th August 2020, 21:50
What's needed here:
clip = core.resize.Bicubic(clip=clip, matrix_in_s="709", matrix_s="ictcp", range_in=0, range=0)
gives me:
invalid colorspace definition (1/1/2 => 14/1/2). May need to specify additional colorspace parameter
adding '_Transfer' doesn't help,...
Cu Selur
DJATOM
30th August 2020, 13:50
I see, so calling the scripts through python and not vspipe is the correct usage when TCPClip is involved on the server side.
Are you planning on adding Huffman/Gzip compression like Avisynth TCPServer has?
I'm currently bottle-necked by my network bandwidth, probably since the frames are transferred uncompressed.
I had some rest day recently and managed to implement LZO compression (not yet pushed in the repo).
What I have found on that matter - single-threaded compression is slow, it might end up in a bottleneck for your script. So to deal with that there are two options: 1) set lzo level 1, which near 30% less size (compared to uncompressed) and still fast enough (60 fps for 1080p not "flat" content, I've tested with Ergo Proxy OP), 2) actually use multi-threaded execution. While single-threaded lzo level 2 compression performs like at 1.8-2.2 fps in general, with 24 threads (3900x) I've got 33.88 fps (near 15x speed-up). Of course you don't want to waste your CPU for intermediate compression, so I'll make compression defaults at "level = 1, threads = 1", you can tune it on your side. I will publish that update after minor code clean-up.
mastrboy
31st August 2020, 15:09
I had some rest day recently and managed to implement LZO compression (not yet pushed in the repo).
What I have found on that matter - single-threaded compression is slow, it might end up in a bottleneck for your script. So to deal with that there are two options: 1) set lzo level 1, which near 30% less size (compared to uncompressed) and still fast enough (60 fps for 1080p not "flat" content, I've tested with Ergo Proxy OP), 2) actually use multi-threaded execution. While single-threaded lzo level 2 compression performs like at 1.8-2.2 fps in general, with 24 threads (3900x) I've got 33.88 fps (near 15x speed-up). Of course you don't want to waste your CPU for intermediate compression, so I'll make compression defaults at "level = 1, threads = 1", you can tune it on your side. I will publish that update after minor code clean-up.
That was fast, thank you.
I testet a little, without compression on a 2700x on the server side I get ~40fps.
And with various compression options:
Compression level 1 and compression thread 1: 30-35fps
Compression level 1 and compression thread 2: 55-60fps
Compression level 1 and compression thread 4: 80-85fps
Compression level 1 and compression thread 8: 85-90fps (maxing network).
Compression level 2 and compression thread 8: 10fps
Compression level 2 and compression thread 16: 12-15fps
It's a very nice boost with 2-4 threads as long as I have CPU resources to spare.
Above compression level 1 seems too slow for my CPU though.
DJATOM
31st August 2020, 16:20
Glad it helped with your stuff. I want to do some code improvements later, now it's a new week for my work stuff :)
Myrsloik
31st August 2020, 22:15
I have a function in vseditor that create a vscore from the api and then free it right away, however the memory didn't get released.
const VSAPI * cpVSAPI = m_pVSScriptLibrary->getVSAPI();
VSCore *pCore = cpVSAPI->createCore(0);
cpVSAPI->freeCore(pCore);
Each call to the function leaked about 9 MB.
I figured out why. Some dlls leak memory when freed. I'm currently trying to figure out the exact compiler/configuration that causes this.
lansing
1st September 2020, 16:18
Myrsloik, I have a question about node cloning.
If I have a VSNodeRef returned from a slow script(a lot of filters) and I cloned it to a new VSNodeRef, and then I request a frame from both nodes at the same time, will the time it takes to complete doubled?
Myrsloik
1st September 2020, 16:38
Myrsloik, I have a question about node cloning.
If I have a VSNodeRef returned from a slow script(a lot of filters) and I cloned it to a new VSNodeRef, and then I request a frame from both nodes at the same time, will the time it takes to complete doubled?
No, you're only cloning the reference. No work will ever be duplicated assuming the second request is made before the first one completes.
lansing
2nd September 2020, 04:00
No, you're only cloning the reference. No work will ever be duplicated assuming the second request is made before the first one completes.
What if I take the cloned nodeRef and run a filter to it programatically? Does its process start all over again with "slow script + new filter" or does it starts where I cloned it, that is without the slow script part?
lansing
4th September 2020, 03:26
Is there a proper way to add a vapoursynth script to a VSNodeRef programatically? I have a script in vseditor and I want to add some filters just for preview, right now I'm doing this by having the original script and the filter scripts join on script evaluation, but the problem with this is that between switching the filters on and off, the entire script has to be rerun again.
jackoneill
4th September 2020, 21:17
Is there a proper way to add a vapoursynth script to a VSNodeRef programatically? I have a script in vseditor and I want to add some filters just for preview, right now I'm doing this by having the original script and the filter scripts join on script evaluation, but the problem with this is that between switching the filters on and off, the entire script has to be rerun again.
Yes:
https://github.com/dubhater/Wobbly/blob/f74f85a284b4552ed82c966249385a79c21db27f/src/shared/WobblyProject.cpp#L3335
lansing
4th September 2020, 22:36
Yes:
https://github.com/dubhater/Wobbly/blob/f74f85a284b4552ed82c966249385a79c21db27f/src/shared/WobblyProject.cpp#L3335
You're also doing script joining->evaluate, I want to do user_script->evaluate_to_node->append_filter_script_from_node, with this I can have both the node from the original script where I can get videoInfo/frameInfo, and the node from the filter script for display.
To do this with script joining, I will need to evaluate the original script to get one node, and then evaluate the original script (again) + filter script to get the display node. It would evaluate the original script twice.
feisty2
5th September 2020, 04:19
is there a way for vspipe to partially evaluate a script and write the result to hard disk, then read the partially evaluated result form hard disk and continue the rest of evaluation? something like a breakpoint in a debugger.
clip = very_slow_filter_1(clip, ...).mark_for_breakpoint()
# when evaluating the script, vspipe will first solely evaluate very_slow_filter_1
then continue the evaluation of very_slow_filter_2 when the evaluation of very_slow_filter_1 completes
clip = very_slow_filter_2(clip, ...)
clip.set_output()
jackoneill
5th September 2020, 10:45
You're also doing script joining->evaluate, I want to do user_script->evaluate_to_node->append_filter_script_from_node, with this I can have both the node from the original script where I can get videoInfo/frameInfo, and the node from the filter script for display.
To do this with script joining, I will need to evaluate the original script to get one node, and then evaluate the original script (again) + filter script to get the display node. It would evaluate the original script twice.
You can do that with vsscript_setVariable/vsscript_getVariable (http://www.vapoursynth.com/doc/api/vsscript.h.html#vsscript-getvariable).
lansing
6th September 2020, 03:30
You can do that with vsscript_setVariable/vsscript_getVariable (http://www.vapoursynth.com/doc/api/vsscript.h.html#vsscript-getvariable).
vsscript_setVariable saves the variable into a vsmap, but I couldn't find a function that evaluate a script with vsmap. I came up with something like this, will it work?
VSScriptLibrary->vsscript_evaluateScript(&userScriptEnv, userScript);
VSNodeRef * userScriptNode = VSScriptLibrary->getOutput(userScriptEnv, 0);
VSScriptLibrary->vsscript_evaluateScript(&userScriptEnv, filterScript)
VSNodeRef * previewNode = VSScriptLibrary->getOutput(userScriptEnv, 0);
filter script.vpy
clip = vs.get_output()
# filtering
clip.set_output()
jackoneill
6th September 2020, 18:37
vsscript_setVariable saves the variable into a vsmap, but I couldn't find a function that evaluate a script with vsmap. I came up with something like this, will it work?
VSScriptLibrary->vsscript_evaluateScript(&userScriptEnv, userScript);
VSNodeRef * userScriptNode = VSScriptLibrary->getOutput(userScriptEnv, 0);
VSScriptLibrary->vsscript_evaluateScript(&userScriptEnv, filterScript)
VSNodeRef * previewNode = VSScriptLibrary->getOutput(userScriptEnv, 0);
filter script.vpy
clip = vs.get_output()
# filtering
clip.set_output()
Perhaps read the documentation for vsscript_setVariable again. And the function signature.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.