Log in

View Full Version : Vapoursynth


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 [67] 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

lansing
30th March 2019, 00:40
When I use the vcmove rotate function, vs doesn't flush the memory after I close the preview in the editor.


clip = core.ffms2.Source(video_file)
rotate = core.vcmove.Rotate(clip, clip, angle=45)
rotate.set_output()


I got this message

Core freed but 4838400 bytes still allocated in framebuffers

Myrsloik
30th March 2019, 00:54
When I use the vcmove rotate function, vs doesn't flush the memory after I close the preview in the editor.


clip = core.ffms2.Source(video_file)
rotate = core.vcmove.Rotate(clip, clip, angle=45)
rotate.set_output()


I got this message

Core freed but 4838400 bytes still allocated in framebuffers

It's a vcmove bug. Report it to the author. The frame reference bkg in line 144 of moveRotate.cpp is never freed. Other operations may have the same typo so check all filters.

lansing
30th March 2019, 00:59
It's a vcmove bug. Report it to the author. The frame reference bkg in line 144 of moveRotate.cpp is never freed. Other operations may have the same typo so check all filters.

Okay.

thedangle
7th April 2019, 21:18
Not sure if this is a VS or waifu2x caffe thing, but using scripts with caffe seems to cause large amounts of virtual memory to be committed, even with core.max_cache_size set to 5124. Physical memory use seems to adhere to the memory limit, though, even if there's about 6gb of "available" physical memory and 3gb free VRAM.

I'd just ignore it since memory is meant to be used anyway but when it hits my commit cap virtualdub64 crashes. Example script (source res is 720x480):

import vapoursynth as vs
import havsfunc as haf
import adjust
from vapoursynth import core
core.num_threads = 8
core.max_cache_size = 5124

clp = core.lsmas.LWLibavSource(r'test.avi',threads=8)
clp = adjust.Tweak(clp,sat=1.05)
clp = core.fft3dfilter.FFT3DFilter(clp, sigma = 2.2, planes=[1,2])
clp = core.pp7.DeblockPP7(clp, qp=1.8, mode=2)
clp = core.fmtc.matrix (clp, mat="601",col_fam=vs.RGB)
clp = core.fmtc.bitdepth (clp,bits=32,dmode=0)
clp = core.caffe.Waifu2x(clp, noise=2, model=6, scale=2, block_w=320, block_h=240, cudnn=True, tta=False, batch=3) # crashes at 720 wblock
clp = core.fmtc.bitdepth(clp, bits=16,dmode=0)
clp = core.knlm.KNLMeansCL(clp, d=0, a=12, s=0, h=.23, wmode=0)
clp = core.f3kdb.Deband(clp,random_algo_ref=2,random_algo_grain=2,blur_first=True,dynamic_grain=True,sample_mode=1,range=16,dither_algo=1,y=64,cb=80,cr=80,grainy=0,grainc=0,output_depth=16)
clp.set_output()

Looking at it further it seems windows 10 considers vram use as part of total usable memory, but does not add it to the calculation of max memory available. For example if I have 16gb ram, 6gb virtual memory and 8gb vram, my commit max is only 22gb, but if I use 8gb of vram and 1gb of ram windows considers 9gb of memory committed. Maybe this is working as intended? Not sure how separate pools are handled.

Tima
16th April 2019, 15:05
DoubleWeave doesn't seem to pick up field props:

DoubleWeave: field order could not be determined from frame properties


import vapoursynth as vs
import havsfunc as haf
import nextfunc as nextf
core = vs.get_core()
std = core.std

clip = core.avisource.AVISource(src)

clip = std.SetFieldBased(clip, 2)

woven = std.DoubleWeave(clip)
clip = std.SelectEvery(woven, 2, 0)

clip.set_output()

poisondeathray
16th April 2019, 15:17
@Tima - if your AVI clip doesn't have field order in the file metadata, you can set the frame props

clip = core.std.SetFrameProp(clip, prop="_FieldBased", intval=0) #0=frame based (progressive), 1=bottom field first, 2=top field first.

jackoneill
16th April 2019, 20:42
Until R46 you will have to avoid using DoubleWeave's tff parameter. If you use it and the _Field property is not present/usable, DoubleWeave will swap the fields. Or I guess you can say tff=1 when you mean tff=0, and vice versa, but then your script will break when R46 appears.

A solution that will work both before and after R46 is to set the _Field property:

clip = core.avisource.AVISource(src)

tff = True

even = clip.std.SelectEvery(cycle=2, offsets=0)
even = even.std.SetFrameProp(prop="_Field", intval=tff)

odd = clip.std.SelectEvery(cycle=2, offsets=1)
odd = odd.std.SetFrameProp(prop="_Field", intval=not tff)

clip = std.Interleave(clips=[even, odd])

clip = clip.DoubleWeave()

zorr
16th April 2019, 22:07
Would it be possible to add 'pop' or some other means to remove the top of the stack in Expr. I'm trying to make a sorting algorithm and it's kinda hard without that instruction. Well, it's not exactly easy with it either, sorting 5 values will take about 100 instructions, but at least it would be possible... :D

Myrsloik
17th April 2019, 10:44
Would it be possible to add 'pop' or some other means to remove the top of the stack in Expr. I'm trying to make a sorting algorithm and it's kinda hard without that instruction. Well, it's not exactly easy with it either, sorting 5 values will take about 100 instructions, but at least it would be possible... :D

At this point I'm surprised you don't propose a special sorting instruction. Something like "v1 v2 v3 v4 <number of previous values to sort on the stack> sortasc/sortdesc".

Also consider using a real compiler. If you have the patience to sort things using Expr then you should find that plugin writing isn't that bad.

zorr
18th April 2019, 00:12
At this point I'm surprised you don't propose a special sorting instruction. Something like "v1 v2 v3 v4 <number of previous values to sort on the stack> sortasc/sortdesc".

Yes, that would be awesome! :D I did consider it but I know you're a busy guy. But if you're willing to entertain the idea of aggregate functions then I do think they would make Expr more... Expressive and useful. Median would be useful too (hard to implement), perhaps even a reverse (of top n values). The syntax you proposed seems good. Or you could do it in the style of SwapN and there would be Sort2, Sort3 etc.

Also consider using a real compiler. If you have the patience to sort things using Expr then you should find that plugin writing isn't that bad.

Not knowing much about the plugin development I think that would be quite a lot more time consuming endeavour than fiddling with the stack. But yeah, 100 instructions is not going to be too hot performance-wise when applied to every pixel... Are there good tutorials / introductions to VapourSynth plugin development? There was a reference to SDK directory, is that part of the full installation package only (didn't find it in the FATPACK)?

AzraelNewtype
21st April 2019, 00:10
Until R46 you will have to avoid using DoubleWeave's tff parameter. If you use it and the _Field property is not present/usable, DoubleWeave will swap the fields. Or I guess you can say tff=1 when you mean tff=0, and vice versa, but then your script will break when R46 appears.

A solution that will work both before and after R46 is to set the _Field property:

clip = core.avisource.AVISource(src)

tff = True

even = clip.std.SelectEvery(cycle=2, offsets=0)
even = even.std.SetFrameProp(prop="_Field", intval=tff)

odd = clip.std.SelectEvery(cycle=2, offsets=1)
odd = odd.std.SetFrameProp(prop="_Field", intval=not tff)

clip = std.Interleave(clips=[even, odd])

clip = clip.DoubleWeave()


Using SetFrameProp in this manner is throwing the exact error it was supposed to be avoiding. DoubleWeave only does anything at all if I set tff explicitly.

jackoneill
21st April 2019, 11:21
Using SetFrameProp in this manner is throwing the exact error it was supposed to be avoiding. DoubleWeave only does anything at all if I set tff explicitly.

I can't see any problem there. What does your script look like?

AzraelNewtype
21st April 2019, 17:48
res = core.std.Interleave(clips=[re, ro])
res = res.std.SeparateFields(True)
res = res.std.SelectEvery(cycle=4, offsets=[2, 1])
res = res.std.SetFrameProp(prop="_Field", intval=1)
# res = res.text.FrameProps()
# res = res.std.SetFrameProp(prop="_FieldBased", intval=2)
# res = res.std.SetFieldBased(2)
res = res.std.DoubleWeave(tff=False)[::2]

It sets the prop just fine, but taking out the explicit tff=False and or using any of the commented lines instead/in addition just reports that it can't figure out field order from frame properties.

Edit: and of course I've just realized that I probably should have set this at the re/ro level one top and one bottom, because _Field and _FieldBased aren't really saying the same thing.

jackoneill
28th April 2019, 16:24
VapourSynth works in Wine now. Maybe this is of interest to someone.

I was able to use 64 bit VSEdit r19 with VapourSynth r45 portable and Python 3.7.3 portable in Wine 4.3.

ChaosKing
29th April 2019, 13:09
How fast/slow is it compared to Windows?

jackoneill
29th April 2019, 17:09
How fast/slow is it compared to Windows?

I don't know. I don't have Windows on this computer. I assume it's mostly the same once it's started. Wine takes a second or two to start up.

lansing
10th May 2019, 09:21
I'm trying to mass apply hundreds of lut files to segments of a clip. I ran a test loading 100 lut files in the script, each lut file is about 8MB, and it took a minute 45 seconds to load, that is not good. Considering the size of 300/400 lut will take over 5 minutes and more. Can I improve the loading speed with some lazy loading?


path = r"my file path"
file_list = os.listdir(path) # saving the lut file names to an array

clip = core.lsmas.LWLibavSource(file)
clip = clip[0:990]
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGBS)

accu_file = core.std.BlankClip(rgb_clip, length=1) #dummy initial file for concat

for cube_file, frame in zip(file_list, range(0, 991, 10)):
cube_file_path = path + '//' + cube_file
accu_file += core.timecube.Cube(rgb_clip[frame: frame+10], cube=cube_file_path)

accu_file.set_output()

WolframRhodium
10th May 2019, 11:32
I'm trying to mass apply hundreds of lut files to segments of a clip. I ran a test loading 100 lut files in the script, each lut file is about 8MB, and it took a minute 45 seconds to load, that is not good. Considering the size of 300/400 lut will take over 5 minutes and more. Can I improve the loading speed with some lazy loading?


path = r"my file path"
file_list = os.listdir(path) # saving the lut file names to an array

clip = core.lsmas.LWLibavSource(file)
clip = clip[0:990]
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGBS)

accu_file = core.std.BlankClip(rgb_clip, length=1) #dummy initial file for concat

for cube_file, frame in zip(file_list, range(0, 991, 10)):
cube_file_path = path + '//' + cube_file
accu_file += core.timecube.Cube(rgb_clip[frame: frame+10], cube=cube_file_path)

accu_file.set_output()


Does FrameEval() work?


from functools import partial

def apply_lut(n, f, clip, file_list):
cube_file = file_list[n % 10]
cube_file_path = path + '//' + cube_file

return core.timecube.Cube(clip, cube=cube_file_path)

accu_file = core.std.FrameEval(rgb_clip, partial(apply_lut, clip=rgb_clip, file_list=file_list))

lansing
10th May 2019, 17:26
Does FrameEval() work?


from functools import partial

def apply_lut(n, f, clip, file_list):
cube_file = file_list[n % 10]
cube_file_path = path + '//' + cube_file

return core.timecube.Cube(clip, cube=cube_file_path)

accu_file = core.std.FrameEval(rgb_clip, partial(apply_lut, clip=rgb_clip, file_list=file_list))


Thanks, this works when take out the "f" from the function. Each frame took about a second to load now. But can I make it even more faster? Since one cube file would be applied to a range of frames, so the same cube doesn't have to be reloaded again on frames that lie within that range.

WolframRhodium
10th May 2019, 19:03
Thanks, this works when take out the "f" from the function. Each frame took about a second to load now. But can I make it even more faster? Since one cube file would be applied to a range of frames, so the same cube doesn't have to be reloaded again on frames that lie within that range.

One of the solutions is to stack frames together:

from functools import partial

rgb_clip_stacked = core.std.StackVertical([rgb_clip[i::10] for i in range(10)])

h = rgb_clip.height
sh = rgb_clip_stacked.height

def apply_lut(n, clip, file_list):
cube_file = file_list[n]
cube_file_path = path + '//' + cube_file
return core.timecube.Cube(clip, cube=cube_file_path)

accu_file_stacked = core.std.FrameEval(
rgb_clip_stacked,
partial(apply_lut, clip=rgb_clip_stacked, file_list=file_list)
)
accu_file = core.std.Interleave(
[core.std.Crop(accu_file_stacked, top=h*i, bottom=sh-h*(i+1)) for i in range(10)]
)

lansing
10th May 2019, 20:34
One of the solutions is to stack frames together:

from functools import partial

rgb_clip_stacked = core.std.StackVertical([rgb_clip[i::10] for i in range(10)])

h = rgb_clip.height
sh = rgb_clip_stacked.height

def apply_lut(n, clip, file_list):
cube_file = file_list[n]
cube_file_path = path + '//' + cube_file
return core.timecube.Cube(clip, cube=cube_file_path)

accu_file_stacked = core.std.FrameEval(
rgb_clip_stacked,
partial(apply_lut, clip=rgb_clip_stacked, file_list=file_list)
)
accu_file = core.std.Interleave(
[core.std.Crop(accu_file_stacked, top=h*i, bottom=sh-h*(i+1)) for i in range(10)]
)


This will explode the memory in seconds. Stacking 10 frames of 1920x1080 here already took up 1GB of memory. In real life each segments would have around 200 frames.

jackoneill
11th May 2019, 07:45
Can I improve the loading speed with some lazy loading?


path = r"my file path"
file_list = os.listdir(path) # saving the lut file names to an array

clip = core.lsmas.LWLibavSource(file)
clip = clip[0:990]
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGBS)

accu_file = core.std.BlankClip(rgb_clip, length=1) #dummy initial file for concat

for cube_file, frame in zip(file_list, range(0, 991, 10)):
cube_file_path = path + '//' + cube_file
accu_file += core.timecube.Cube(rgb_clip[frame: frame+10], cube=cube_file_path)

accu_file.set_output()


Instead of using vspipe, maybe you could use clip.output() in a loop. Then you might achieve lazy loading.

lansing
11th May 2019, 14:18
Instead of using vspipe, maybe you could use clip.output() in a loop. Then you might achieve lazy loading.

WolframRhodium's solution with FrameEval() is lazy loading, but what kills it is the startup time for the timecube, as each call took a second to load.

What I'm thinking now is maybe I can have a temp clip file on the top level and then inside the callback function use "global" to get that file into the function and update it on some logic? Something like this:


temp_clip = clip

def apply_lut(n, clip, file_list):
global temp_clip

if n > blah:
temp_clip = core.timecube.Cube(clip, cube=cube_file_path)
return core.timecube.Cube(clip, cube=cube_file_path)
if n < blah and n > blah:
return temp_clip
else:
return clip

accu_file = core.std.FrameEval(rgb_clip, partial(apply_lut, clip=rgb_clip, file_list=file_list))

lansing
12th May 2019, 16:56
How can I print out log right in the script for debugging? I called print(some_string) and it's not outputting anything in the log of the editor.

LoRd_MuldeR
12th May 2019, 17:54
After learning, the hard way, that VapourSynth (vspipe.exe) requires the environment variable %USERPROFILE% to be set correctly – otherwise loading of plugins that have been installed via VSRepo will fail – I was wondering why VapourSynth relies on %USERPROFILE% to deduce the location of the <AppData> directory. Wouldn't it be more obvious and more reliable to look at %APPDATA% instead? Sure, most of the time the path of <AppData> will be equal to "<UserProfile>\AppData\Roaming", but I think we can not really rely on that. If there exists a dedicated environment variable for <AppData>, why not make use of it? And, maybe, fall back "<UserProfile>\AppData\Roaming", if either %APPDATA% is not set or the specified path does not exist. Or even better: Don't rely on environment variables at all (you never know what some user has set up here!), but rather use the SHGetKnownFolderPath() system function?

https://i.imgur.com/09jRinm.png

_Al_
12th May 2019, 19:44
How can I print out log right in the script for debugging? I called print(some_string) and it's not outputting anything in the log of the editor.
naming script *.py, not *.vpy and running that script from any Python console, like IDLE etc.

Myrsloik
12th May 2019, 20:45
...

I don't use environment variables. I only use this code to retrieve the path:SHGetFolderPath(nullptr, CSIDL_APPDATA, nullptr, SHGFP_TYPE_CURRENT, appDataBuffer.data());

Of course it doesn't mean windows itself won't implement it by using %USERPROFILE% behind the scenes anyway. I guess.

LoRd_MuldeR
12th May 2019, 22:29
Of course it doesn't mean windows itself won't implement it by using %USERPROFILE% behind the scenes anyway. I guess.

You are right. My test shows that SHGetFolderPath() with parameters CSIDL_APPDATA and SHGFP_TYPE_CURRENT fails, if environment variable %USERPROFILE% is set to the wrong directory.

There is no such problem, if %USERPROFILE% is not set at all. Furthermore, if %USERPROFILE% is set to the wrong directory, SHGetFolderPath() with parameters CSIDL_APPDATA and SHGFP_TYPE_DEFAULT works.

Interestingly, SHGetFolderPath() with parameters CSIDL_PROFILE does not seem to care about %USERPROFILE% at all :confused:

My conclusion for now: If call SHGetFolderPath() with parameters CSIDL_APPDATA and SHGFP_TYPE_CURRENT has failed, then we should retry with SHGFP_TYPE_DEFAULT flag.

lansing
13th May 2019, 00:16
naming script *.py, not *.vpy and running that script from any Python console, like IDLE etc.

It doesn't work when I'm calling print inside a callback function that was used in FrameEval().

WolframRhodium
13th May 2019, 01:00
It doesn't work when I'm calling print inside a callback function that was used in FrameEval().

You can print values in vsedit by raising an exception.

lansing
13th May 2019, 01:43
You can print values in vsedit by raising an exception.

How do I do that?

_Al_
13th May 2019, 01:50
It doesn't work when I'm calling print inside a callback function that was used in FrameEval().
you have to request actual frames, because if you do not preview it, nothing is happening, so at the end of your script you can add:
for frame in range(0, len(accu_file)):
accu_file.get_frame(frame)

lansing
13th May 2019, 09:43
you have to request actual frames, because if you do not preview it, nothing is happening, so at the end of your script you can add:
for frame in range(0, len(accu_file)):
accu_file.get_frame(frame)

This is only for sequential reading, I'm trying to find out a problem caused by reading backward.

_Al_
13th May 2019, 15:19
that loop could be reversed
for frame in reversed(range(0, len(accu_file))):
accu_file.get_frame(frame)

or just clip could be reversed before that loop:
accu_file=accu_file[::-1]

Natty
17th May 2019, 00:08
is there a function in vs similar to avs's function setmemorymax()
i read http://www.vapoursynth.com/doc/ but couldn't find.
having issues of very high ram usage

gonca
17th May 2019, 00:39
is there a function in vs similar to avs's function setmemorymax()
i read http://www.vapoursynth.com/doc/ but couldn't find.
having issues of very high ram usage
Try
core.max_cache_size =xxxx

aldix
17th May 2019, 01:50
dear all,

been away for long, but figured i'll finally take up python/vapoursynth.

however, been messing around and having problems with an avisynth encoding script i'm trying to port over whole day.

and now i just can't wrap my head around what i'm doing wrong. script itself is pieced together from what i've found here based on the plugins i need to use.


import os
import sys
import vapoursynth as vs
scriptPath = "C:/vapoursynth editor r19 64bit/scripts/"
sys.path.append(os.path.abspath(scriptPath)
import finesharp as finesharp
import dehalo_alpha as dehalo_alpha
core = vs.get_core()
clip = core.ffms2.Source("c:/temp/video.mkv")
clip = core.fmtc.resample(clip,w="1280",h="720", kernel="blackmanminlobe", taps="4")
src_clip = core.mv.Super(clip,pel="1", sharp="2", rfilter="2")
shp = finesharp.sharpen(src_clip,mode=3)
bv1 = core.mv.analyse(src_clip,isb="True",delta="1",overlap="8",blksize="16",truemotion="False",search="5",chroma="True")
fv1 = core.mv.analyse(src_clip,isb="False",delta="1",overlap="8",blksize="16",truemotion="False",search="5",chroma="True")
video = core.mv.Degrain1(clip,src_clip,bv1,fv1,thsad="85")
video = dehalo_alpha(self,video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
video = core.f3kdb.Deband(video,sample_mode="2",dynamic_grain="False",keep_tv_range="False",dither_algo="3",input_depth="8",output_depth="8",y="48",cb="48",cr="48",grainY="48",grainC="48")
video.set_output()



Failed to evaluate the script:
Python exception: invalid syntax (C:/vapoursynth editor r19 64bit/GoT_python_test.vpy, line 6)

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1924, in vapoursynth.vpy_evaluateScript
File "C:/vapoursynth editor r19 64bit/test.vpy", line 6
import finesharp as finesharp
^
SyntaxError: invalid syntax


thank you so much in advance!

gonca
17th May 2019, 02:32
scriptPath = "C:/vapoursynth editor r19 64bit/scripts/"
This might be an issue "/"

aldix
17th May 2019, 02:47
right. i also started to think that maybe spaces shouldn't be there so i made a new folder.

however, even if i remove the "/" i still get an error, just a different one now. any idea?


Failed to evaluate the script:
Python exception: No module named 'finesharp'

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1927, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 1928, in vapoursynth.vpy_evaluateScript
File "C:/vapoursynth editor r19 64bit/test.vpy", line 6, in
import finesharp as finesharp
ModuleNotFoundError: No module named 'finesharp'

_Al_
17th May 2019, 02:54
sys.path.append(os.path.abspath(scriptPath)) # parentheses is missing

aldix
17th May 2019, 03:14
yup, i've meanwhile spotted that, too, and corrected.

this is the most recent script:

import os
import sys
import vapoursynth as vs
scriptPath = "C:/vapoursynth_scripts"
sys.path.append(os.path.abspath(scriptPath))
import finesharp as finesharp
import dehalo_alpha as dehalo_alpha
core = vs.get_core()
clip = core.ffms2.Source("c:/temp/video.mkv")
clip = core.fmtc.resample(clip,w="1280",h="720", kernel="blackmanminlobe", taps="4")
src_clip = core.mv.Super(clip,pel="1", sharp="2", rfilter="2")
shp = finesharp.sharpen(src_clip,mode=3)
bv1 = core.mv.analyse(src_clip,isb="True",delta="1",overlap="8",blksize="16",truemotion="False",search="5",chroma="True")
fv1 = core.mv.analyse(src_clip,isb="False",delta="1",overlap="8",blksize="16",truemotion="False",search="5",chroma="True")
video = core.mv.Degrain1(clip,src_clip,bv1,fv1,thsad="85")
video = dehalo_alpha(self,video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
video = core.f3kdb.Deband(video,sample_mode="2",dynamic_grain="False",keep_tv_range="False",dither_algo="3",input_depth="8",output_depth="8",y="48",cb="48",cr="48",grainY="48",grainC="48")
video.set_output()


i'm still getting the error cited above.

thanks!

stax76
17th May 2019, 03:21
Maybe you can install finesharp with vsrepo or vsrepogui.

_Al_
17th May 2019, 03:24
finesharp.py has to exist and be either in working directory or put it in Lib\site-packages directory

you can put all py moduls into that directory so they are always available for Python for any script:
C:\Users\your-user-name\AppData\Local\Programs\Python\Python37\Lib\site-packages\vapoursynth

aldix
17th May 2019, 03:39
finesharp.py has to exist and be either in working directory or put it in Lib\site-packages directory

you can put all py moduls into that directory so they are always available for Python for any script:
C:\Users\your-user-name\AppData\Local\Programs\Python\Python37\Lib\site-packages\vapoursynth

hmm, interesting, thank you a lot. this did help me move past those errors but on toward new ones.

script with newest corrections. (e.g., should be Analyse, not analyse). also removed chroma="True" cos for some reason it shouted at that. it does keep at it with other stuff, though, so. o.O

import os
import sys
import vapoursynth as vs
scriptPath = "C:/vapoursynth_scripts"
sys.path.append(os.path.abspath(scriptPath))
import finesharp as finesharp
import dehalo_alpha as dehalo_alpha
core = vs.get_core()
clip = core.ffms2.Source("c:/temp/video.mkv")
clip = core.fmtc.resample(clip,w="1280",h="720", kernel="blackmanminlobe", taps="4")
src_clip = core.mv.Super(clip,pel="1", sharp="2", rfilter="2")
shp = finesharp.sharpen(src_clip,mode=3)
bv1 = core.mv.Analyse(src_clip,isb="True",delta="1",overlap="8",blksize="16",truemotion="False",search="5")
fv1 = core.mv.Analyse(src_clip,isb="False",delta="1",overlap="8",blksize="16",truemotion="False",search="5")
video = core.mv.Degrain1(clip,src_clip,bv1,fv1,thsad="85")
video = dehalo_alpha(self,video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
video = core.f3kdb.Deband(video,sample_mode="2",dynamic_grain="False",keep_tv_range="False",dither_algo="3",input_depth="8",output_depth="8",y="48",cb="48",cr="48",grainY="48",grainC="48")
video.set_output()


...and new error.


2019-05-17 05:37:16.593
Failed to evaluate the script:
Python exception: invalid literal for int() with base 10: 'True'

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1927, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 1928, in vapoursynth.vpy_evaluateScript
File "C:/vapoursynth editor r19 64bit/test.vpy", line 13, in
bv1 = core.mv.Analyse(src_clip,isb="True",delta="1",overlap="8",blksize="16",truemotion="False",search="5")
File "src\cython\vapoursynth.pyx", line 1813, in vapoursynth.Function.__call__
File "src\cython\vapoursynth.pyx", line 638, in vapoursynth.typedDictToMap
ValueError: invalid literal for int() with base 10: 'True'

2019-05-17 05:37:16.698
Core freed but 6 filter instance(s) still exist
Core freed but 6 filter instance(s) still exist


wut now? :/

aldix
17th May 2019, 03:44
huh.

looks like it didn't like quotes in the core.mv.Analyse call. removing them fixed this particular issue. fascinating stuff!


bv1 = core.mv.Analyse(src_clip,isb=True,delta=1,overlap=8,blksize=16,truemotion=False,search=5,chroma=True)
fv1 = core.mv.Analyse(src_clip,isb=False,delta=1,overlap=8,blksize=16,truemotion=False,search=5,chroma=True)


shouted at the "self" in the dehalo_alpha call. removed it. and now it's this:

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1927, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 1928, in vapoursynth.vpy_evaluateScript
File "C:/vapoursynth editor r19 64bit/test.vpy", line 16, in
video = dehalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
TypeError: 'module' object is not callable

_Al_
17th May 2019, 04:18
Python can use argument values as :
string, value ="something"
bool, value =True or value=False
int, (integer) value=2
float, value=0.8

so you can fix your script accordingly removing those quotes, only string uses quotes

_Al_
17th May 2019, 04:47
also if you find "self" in a code it is a sort of giveaway there might be a class constructed within that modul

if this is the modul https://github.com/darealshinji/vapoursynth-plugins/blob/master/scripts/dehalo_alpha.py
you need to instantiate Python class DeHalo_alpha first to access dehalo_alpha function:
my_dehalo = dehalo_alpha.DeHalo_alpha() #DeHalo_alpha is attribute of that dehalo_alpha py script
video = my_dehalo.dehalo_alpha(video,rx=1.1,ry=1.1,brightstr=0.8,ss=1.5) #now dehalo_alpha is an attribute of DeHalo_alpha script

not knowing if it is functional, just trying to get Python syntax straight,

note: there is three different things called the same: Python modul, then class name (first letter is upper case) and then that class attribute(function). Python is case sensitive so as far Python is concerned, it is not the same, classes usually have first letter upper case.

stax76
17th May 2019, 12:44
In this thread there is someone who is not able to get VapourSynth running:

https://forum.doom9.org/showthread.php?p=1874637#post1874637

Is there any diagnostic tool like avsmeter?

ChaosKing
17th May 2019, 12:48
I made a simple wrapper around LoadPlugin() https://github.com/theChaosCoder/vapoursynth-plugin-check/blob/master/vs_plugin_check.py

error 193 means a 32bit dll is used with VS 64bit, in this case ffms2.dll

stax76
17th May 2019, 13:26
@ChaosKing

Thanks, I suggested running the script and hope he can make it work.