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

aldix
17th May 2019, 15:10
thank you for the replies.

i'm not sure what i'm supposed to do with the wrapper thing, though. add it to the script?

i did do what @_AI_ suggested, with the addition of "core" at front (and changing the calling of core earlier than before), but it just ends up showing new error msgs... any more advice?


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()
my_dehalo = core.dehalo_alpha.DeHalo_alpha()
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 = my_dehalo.dehalo_alpha(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()



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 9, in
my_dehalo = core.dehalo_alpha.DeHalo_alpha()
File "src\cython\vapoursynth.pyx", line 1522, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name dehalo_alpha exists. Did you mistype a plugin namespace?

ChaosKing
17th May 2019, 15:23
Just download/install this https://github.com/HomeOfVapourSynthEvolution/havsfunc/blob/master/havsfunc.py and use it like this
import havsfunc as haf
clip = haf.DeHalo_alpha(clip)

aldix
17th May 2019, 17:39
thank you so much! it's really fascinating to build this new 'system' up from scratch, as it were, hehe.

now i'm so far, there are still new errors, though:


import os
import sys
import vapoursynth as vs
core = vs.get_core()
#scriptPath = "C:/vapoursynth_scripts"
#sys.path.append(os.path.abspath(scriptPath))
#my_dehalo = core.DeHalo_alpha.dehalo_alpha()
import finesharp as finesharp
import mvsfunc as mvsfunc
import adjust as adjust
import havsfunc as haf
#import dehalo_alpha as dehalo_alpha
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 = haf.DeHalo_alpha(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,output_depth=8,y=48,cb=48,cr=48,grainY=48,grainC=48)
video.set_output()



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 20, in
video = haf.DeHalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\vapoursynth\havsfunc.py", line 408, in DeHalo_alpha
halos = core.resize.Bicubic(clp, m4(ox / rx), m4(oy / ry)).resize.Bicubic(ox, oy, filter_param_a=1, filter_param_b=0)
TypeError: unsupported operand type(s) for /: 'int' and 'str'


am i doing something wrong, or what?

stax76
17th May 2019, 17:51
video = haf.DeHalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")

you are passing strings instead of floats

edit:

try:

video = haf.DeHalo_alpha(video, rx = 1.1, ry = 1.1, brightstr = 0.8, ss = 1.5)

aldix
17th May 2019, 20:14
video = haf.DeHalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")

you are passing strings instead of floats

edit:

try:

video = haf.DeHalo_alpha(video, rx = 1.1, ry = 1.1, brightstr = 0.8, ss = 1.5)

hah. thank you!!

i knew it had to be something simple like that. removed the quotes and it worked (extra spaces weren't even necessary). just for the sake of learning, though, why do the quotes go through with the mv.super/analyse? i now removed those, as well, but even if i kept it, the script still ran when checked?

aldix
17th May 2019, 20:25
it'd be fantastic if i'd get a few more things from the old script integrated also, so.

how to deal with these in vs?

some_source_plugin("video.mkv").ConvertToYV12(matrix="rec709")



maskstars=source.mt_binarize(upper=false)



mt_merge(last,maskstars)



z = 2 # z = zero point
p = 0.9 # p = power
str = 0.9 # str = strength
rad = 1.0 # radius for "gauss"

o = last
g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)

mt_lutxy(o,g,"x x y - abs "+string(z)+" / 1 "+string(p)+" / ^ "+string(z)+" * "+string(str)+" * x y - x y - abs 0.001 + / * +",U=2,V=2)



YLevels(3, 1.0, 255, 1, 255)


thank you a bunch in advance!

also, there's no port of the Seesaw script for vs, right, or?

ChaosKing
17th May 2019, 20:41
also, there's no port of the Seesaw script for vs, right, or?
These two have it:
http://vsdb.top/plugins/muvsfunc
http://vsdb.top/plugins/G41fun

_Al_
18th May 2019, 00:07
You are using dehalo from havsfunc.py now, so good,
but as for that previous dehalo_alpha.py, you do not involve core. If you import modul, you do not use Vapoursynths' core attributes.

import dehalo_alpha
my_dehalo = dehalo_alpha.DeHalo_alpha()
video = my_dehalo.dehalo_alpha(video,rx=1.1,ry=1.1,brightstr=0.8,ss=1.5)

aldix
18th May 2019, 00:34
These two have it:
http://vsdb.top/plugins/muvsfunc
http://vsdb.top/plugins/G41fun

thank you!! this is awesome.

aldix
18th May 2019, 00:36
You are using dehalo from havsfunc.py now, so good,
but as for that previous dehalo_alpha.py, you do not involve core. If you import modul, you do not use Vapoursynths' core attributes.

import dehalo_alpha
my_dehalo = dehalo_alpha.DeHalo_alpha()
video = my_dehalo.dehalo_alpha(video,rx=1.1,ry=1.1,brightstr=0.8,ss=1.5)

right, thank you. i'll keep this in mind for the future :)

think i never tried it with "import dehalo_alpha." initially you posted the two lines following that and this threw up some errors, as observed from the previous posts.

in any case, it's very good to know that there's a number of ways to do things now. great!

aldix
18th May 2019, 00:54
think i've almost everything fixed and set up now the way i need to. sorry about being so dense.

i'm still struggling with core.std.Interleave tho. what's the correct way using it?

i'm getting

vapoursynth.Error: Interleave: the clips' formats don't match


using:

...
src = core.fmtc.resample(clip,w=1280,h=720, kernel="blackmanminlobe", taps=4)
...
video = core.f3kdb.Deband(video,sample_mode=2,dynamic_grain=False,keep_tv_range=False,dither_algo=3,output_depth=8,y=48,cb=48,cr=48,grainy=48,grainc=48)
int = core.std.Interleave(clips=[src,video])
int.set_output()


and both are 1280/720.

_Al_
18th May 2019, 02:11
resolution is not enough, comment out that interleave line and add:
src = src.text.ClipInfo()
src.set_output()
to see parameters of that clip and then delete those two lines and add other clip:
video = video.text.ClipInfo()
video.set_output()

aldix
18th May 2019, 02:25
| Format: YUV420P16
...
Format: YUV420P8


hmm, so src clip is 16-bit and filtered is 8? but how do i change the src clip to 8-bit right at the beginning?
and will it mess all the rest up again, or what?

_Al_
18th May 2019, 02:41
don't know , you can change it right after loading src source or just before interleaving

src = core.resize.Bicubic(src, format = vs.YUV420P8)

aldix
18th May 2019, 02:51
think i fixed it with these changes.


src = core.fmtc.resample(clip,w=1280,h=720, kernel="blackmanminlobe", taps=4,css=420)
src = core.fmtc.bitdepth(clip,bits=8,dmode=1)


at least the script runs now. but, um, when i initiate the preview, i've no idea which frames from which i'm looking at?

too used to moving back and forth with keyboard arrows with the regular interleave. what's the how-to here?

aldix
18th May 2019, 02:54
hmm, never mind.

think it does work the same way, though. just the changes are too negligible with finesharp. oh well.

gotta try to get seesaw to work now :D

_Al_
18th May 2019, 03:04
You could switch to zimg - Vapoursynth's resize (http://www.vapoursynth.com/doc/functions/resize.html), like in my example, that changes resolutions, color spaces and much more. fmtconv is another way to do it though. Zimg is written by myrsloik I think so I'm sure it sits well within Vapoursynth.

edcrfv94
18th May 2019, 04:28
Will vivtc.VFM support ovr text file like tivtc?

_Al_
24th May 2019, 04:05
If anyone can answer,
why there is kernel or resize method set as resize attribute and not just an argument in core.resize ?
example: clip = core.resize(clip, kernel = Bicubic, ......)

DJATOM
24th May 2019, 11:03
Something like that will work:

resizer = {
'bicubic': core.resize.Bicubic,
'bilinear': core.resize.Bilinear,
'spline36': core.resize.Spline36,
'spline16': core.resize.Spline16
}
clip = resizer['bicubic'](clip, 960, 540, format=vs.YUV420P8)

_Al_
24th May 2019, 15:16
I meant why is that, if author wanted that to look more like Avisynth command, to keep a pattern. Not that it matters.

That example is cool, yes tables with dictionaries, tuples, lists, that's the way to go. :-).

Or checking if kernel exists might be done by checking if it exists as a resize attribute:
my_cool_function(clip, kernel='Bicubic', miracle_settings=True)
try:
getattr(vs.core.resize, kernel)
except:
print("Wrong kernel")

edit: fixed missing quotes , because that's the whole point in this example with getattr , getting an object from a string name

aldix
26th May 2019, 02:21
ok, i'm back again so please bear with me here.


...
maskstars=src.mt_binarize(upper=false)
...
mt_merge(last,maskstars)
...


so i went ahead and tried


...
maskstars = core.std.Binarize(src,threshold=0)
...
video = core.std.Merge(video,maskstars)
...


but think i'm doing something wrong, cos "threshold=0" doesn't seem to equal "upper=false" for video picture changes color in weird ways etc. so how should i use the vs binarize? is it even what i'm after here?
merge seems to be mt_merge, though, so at least that is straightforward.


z = 2 # z = zero point
p = 0.9 # p = power
str = 0.9 # str = strength
rad = 1.0 # radius for "gauss"

o = last
g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)

mt_lutxy(o,g,"x x y - abs "+string(z)+" / 1 "+string(p)+" / ^ "+string(z)+" * "+string(str)+" * x y - x y - abs 0.001 + / * +",U=2,V=2)


still don't know what to do with ^. as much as i googled, there seems to be some alternative for mt_lutxy under vs, but not like i'd know how to use it.
the resize can be done with core.std.resize etc i suppose. as far as the following calculation goes though, i've no idea. as much as i can recall, this
script snippet is something Didee wrote ages ago (if that helps any).

thanks!

WolframRhodium
26th May 2019, 18:18
maskstars=src.mt_binarize(upper=false)
in AVS is equivalent to
maskstars=src.std.Binarize(threshold=128+1, planes=[0])
in Vapoursynth.


still don't know what to do with ^.


The equivalent in std.Expr() is "pow".


there seems to be some alternative for mt_lutxy under vs, but not like i'd know how to use it.

It could be implemented through std.Lut2() or std.Expr(). The semantics of the later one is more close to mt_lutxy(), e.g.

core.std.Expr([o, g], [f"x x y - abs {z} / 1 {p} / pow {z} * {strength} * x y - x y - abs 0.001 + / * +", ""])


Avisynth functions and their VapourSynth equivalents (http://vapoursynth.com/doc/avisynthcomp.html) may be helpful to you.

aldix
27th May 2019, 02:13
maskstars=src.mt_binarize(upper=false)
in AVS is equivalent to
maskstars=src.std.Binarize(threshold=128+1, planes=[0])
in Vapoursynth.



The equivalent in std.Expr() is "pow".


It could be implemented through std.Lut2() or std.Expr(). The semantics of the later one is more close to mt_lutxy(), e.g.

core.std.Expr([o, g], [f"x x y - abs {z} / 1 {p} / pow {z} * {strength} * x y - x y - abs 0.001 + / * +", ""])


Avisynth functions and their VapourSynth equivalents (http://vapoursynth.com/doc/avisynthcomp.html) may be helpful to you.

awesome! thank you so much, i've the maskstars part sorted now. :thanks:

how would i write this in vs though? with a bunch of different core.resize.Bicubic calls or what? hmm, and what's the equivalent in vs for "round" and "rad"?


g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)



thanks a lot in any case. really loving the community here!

WolframRhodium
27th May 2019, 03:19
how would i write this in vs though? with a bunch of different core.resize.Bicubic calls or what? hmm, and what's the equivalent in vs for "round" and "rad"?


g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)




g = o.resize.Bicubic(round(o.width/rad/4)*4, round(o.height/rad/4)*4).resize.Bicubic(o.width, o.height, filter_param_a=1, filter_param_b=0)


"rad" is a variable in your code,

rad = 1.0 # radius for "gauss"


(Actually "round" should be implemented like this)

_round = lambda x: -int(-x+0.5) if x < 0 else int(x+0.5)
g = o.resize.Bicubic(_round(o.width/rad/4)*4, _round(o.height/rad/4)*4).resize.Bicubic(o.width, o.height, filter_param_a=1, filter_param_b=0)

aldix
28th May 2019, 02:58
g = o.resize.Bicubic(round(o.width/rad/4)*4, round(o.height/rad/4)*4).resize.Bicubic(o.width, o.height, filter_param_a=1, filter_param_b=0)


"rad" is a variable in your code,

rad = 1.0 # radius for "gauss"


(Actually "round" should be implemented like this)

_round = lambda x: -int(-x+0.5) if x < 0 else int(x+0.5)
g = o.resize.Bicubic(_round(o.width/rad/4)*4, _round(o.height/rad/4)*4).resize.Bicubic(o.width, o.height, filter_param_a=1, filter_param_b=0)



thank you so very much!! yes! this works.

and now i've whole of my old avs script working!

:thanks: :cool:

bjoker
28th May 2019, 13:01
Could anyone please advise on how to link ffms2 plugin to VapourSynth on Ubuntu linux? As there is no VapourSynth FATPACK for linux i had to compile/build ffms2. Please see below and advise, thanks!

vspipe /root/MyMovie.vpy - --y4m | x265 --crf 22 --preset slow --output-depth 10 --ctu 32 --max-tu-size 16 --analysis-reuse-level 8 --no-rect --b-intra --aq-mode 3 --subme 5 --merange 60 --max-merge 4 --weightb --bframes 8 --rc-lookahead 80 --ref 5 --colorprim bt709 --colormatrix bt709 --transfer bt709 --deblock -2:-1 --no-sao --no-strong-intra-smoothing --y4m --output /root/MyMovie-out.mkv -
Script evaluation failed:
Python exception: No attribute with the name ffms2 exists. Did you mistype a plugin namespace?

Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1937, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1938, in vapoursynth.vpy_evaluateScript
File "/root/MyMovie.vpy", line 8, in <module>
clip = core.ffms2.Source(r"/root/MyMovie-1min.mkv", cachefile = r"/root/MyMovie-1min.mkv.ffindex")
File "src/cython/vapoursynth.pyx", line 1532, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name ffms2 exists. Did you mistype a plugin namespace?

x265 [error]: unable to open input file <->


root@ubuntu19:~# cat MyMovie.vpy
import os
import sys
ScriptPath = '/root/VS/Scripts'
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source(r"/root/MyMovie-1min.mkv", cachefile = r"/root/MyMovie-1min.mkv.ffindex")
clip.set_output()

root@ubuntu19:~# python -V
Python 3.7.3
root@ubuntu19:~#
root@ubuntu19:~# vspipe --version
VapourSynth Video Processing Library
Copyright (c) 2012-2018 Fredrik Mellbin
Core R45
API R3.5
Options: -
root@ubuntu19:~# x265 --version
x265 [info]: HEVC encoder version 2.9
x265 [info]: build info [Linux][GCC 8.2.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
root@ubuntu19:~# ffmpeg --version
ffmpeg version 4.1.3-0ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Ubuntu 8.3.0-6ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Unrecognized option '-version'.
Error splitting the argument list: Option not found
root@ubuntu19:~#

root@ubuntu19:~# uname -a
Linux ubuntu19 5.0.0-15-generic #16-Ubuntu SMP Mon May 6 17:41:33 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu19:~#


I did set these below:
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
PYTHONPATH=/usr/local/lib/python3.7/site-packages/; export PYTHONPATH
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig; export PKG_CONFIG_PATH
LD_RUN_PATH=$LD_RUN_PATH:/usr/local/lib; export LD_RUN_PATH

and tried this too..
root@ubuntu19:~/.config/vapoursynth# cat /root/.config/vapoursynth/vapoursynth.conf
SystemPluginDir=/usr/local/lib/pkgconfig
root@ubuntu19:~/.config/vapoursynth#


fms2 install log:
root@ubuntu19:~/ffms2# make install
make[1]: Entering directory '/root/ffms2'
/usr/bin/mkdir -p '/usr/local/lib'
/bin/bash ./libtool --mode=install /usr/bin/install -c src/core/libffms2.la '/usr/local/lib'
libtool: install: /usr/bin/install -c src/core/.libs/libffms2.so.4.0.0 /usr/local/lib/libffms2.so.4.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libffms2.so.4.0.0 libffms2.so.4 || { rm -f libffms2.so.4 && ln -s libffms2.so.4.0.0 libffms2.so.4; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libffms2.so.4.0.0 libffms2.so || { rm -f libffms2.so && ln -s libffms2.so.4.0.0 libffms2.so; }; })
libtool: install: /usr/bin/install -c src/core/.libs/libffms2.lai /usr/local/lib/libffms2.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/mkdir -p '/usr/local/bin'
/bin/bash ./libtool --mode=install /usr/bin/install -c src/index/ffmsindex '/usr/local/bin'
libtool: install: /usr/bin/install -c src/index/.libs/ffmsindex /usr/local/bin/ffmsindex
/usr/bin/mkdir -p '/usr/local/share/doc/ffms2'
/usr/bin/install -c -m 644 doc/ffms2-api.md doc/ffms2-changelog.md '/usr/local/share/doc/ffms2'
/usr/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 ./include/ffms.h ./include/ffmscompat.h '/usr/local/include'
/usr/bin/mkdir -p '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 ffms2.pc '/usr/local/lib/pkgconfig'
make[1]: Leaving directory '/root/ffms2'
root@ubuntu19:~/ffms2#

ChaosKing
28th May 2019, 13:33
Maybe someone could make a flatpack / appimage / snap version with vsedit, vapoursynth and some plugins.

bjoker
28th May 2019, 15:14
I solved issue of loading plugins by
root@ubuntu19:~# cat MyMovie.vpy
import os
import sys
ScriptPath = '/root/VS/Scripts'
#LoadPlugin(path='/usr/local/lib/pkgconfig/ffms2.pc')
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(path='/usr/local/lib/vapoursynth/libffms2.so')
clip = core.ffms2.Source(r"/root/eega-1min.mkv", cachefile = r"/root/eega-1min.mkv.ffindex")
clip.set_output()

root@ubuntu19:~#


But do I need to load each one manually that I need?

Are_
28th May 2019, 15:24
The problem is /usr/local/lib is not in your path.
You can pass it to configure when you build ffms2 and then install to the common path:

./configure --prefix=/usr --libdir=/usr/lib64

Ops, and then soft-link in "/usr/lib64/vapoursynth" I guess.

bjoker
28th May 2019, 20:07
Ok I will do that but for now ffms2 issue is solved.

and a new problem..

Could anyone please point out what mistake I'm doing here? Thanks!

root@ubuntu19:~# vspipe /root/MyMovie-all.vpy - --y4m | x265 --crf 22 --preset slow --output-depth 10 --ctu 32 --max-tu-size 16 --analysis-reuse-level 8 --no-rect --b-intra --aq-mode 3 --subme 5 --merange 60 --max-merge 4 --weightb --bframes 8 --rc-lookahead 80 --ref 5 --colorprim bt709 --colormatrix bt709 --transfer bt709 --deblock -2:-1 --no-sao --no-strong-intra-smoothing --y4m --output /root/MyMovie-out.mkv -
Script evaluation failed:
Python exception: No attribute with the name mv exists. Did you mistype a plugin namespace?

Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1937, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1938, in vapoursynth.vpy_evaluateScript
File "/root/MyMovie-all.vpy", line 15, in <module>
denoise = havsfunc.SMDegrain(clip, tr=3, thSAD=300, thSADC=150, contrasharp=True, pel=2, Str=2, prefilter=2, hpad=32, vpad=32)
File "/usr/local/share/vsscripts/havsfunc.py", line 3335, in SMDegrain
super_search = core.mv.Super(pref, chroma=chroma, sharp=subpixel, rfilter=4, **super_args)
File "src/cython/vapoursynth.pyx", line 1670, in vapoursynth._CoreProxy.__getattr__
File "src/cython/vapoursynth.pyx", line 1532, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name mv exists. Did you mistype a plugin namespace?

x265 [error]: unable to open input file <->
root@ubuntu19:~#

root@ubuntu19:~# cat MyMovie-all.vpy
import os
import sys
ScriptPath = '/usr/local/share/vsscripts'
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(path='/usr/local/lib/vapoursynth/libffms2.so')
import importlib.machinery
mvsfunc = importlib.machinery.SourceFileLoader('mvsfunc', r"/usr/local/share/vsscripts/mvsfunc.py").load_module()
adjust = importlib.machinery.SourceFileLoader('adjust', r"/usr/local/share/vsscripts/adjust.py").load_module()
havsfunc = importlib.machinery.SourceFileLoader('havsfunc', r"/usr/local/share/vsscripts/havsfunc.py").load_module()
core.std.LoadPlugin(path='/usr/local/lib/vapoursynth/scenechange.so')
clip = core.ffms2.Source(r"/root/MyMovie-1min.mkv", cachefile = r"/root/MyMovie-1min.mkv.ffindex")
clip = core.std.Crop(clip, 0, 0, 132, 132)
denoise = havsfunc.SMDegrain(clip, tr=3, thSAD=300, thSADC=150, contrasharp=True, pel=2, Str=2, prefilter=2, hpad=32, vpad=32)
clip.set_output()

ChaosKing
28th May 2019, 20:17
No attribute with the name mv exists. => you need to load mvtools (and a bunch of other plugins)

bjoker
28th May 2019, 21:08
Thanks, could load mvtools & few others but stuck with ...

root@ubuntu19:~# vspipe /root/eega-all.vpy - --y4m | x265 --crf 22 --preset slow --output-depth 10 --ctu 32 --max-tu-size 16 --analysis-reuse-level 8 --no-rect --b-intra --aq-mode 3 --subme 5 --merange 60 --max-merge 4 --weightb --bframes 8 --rc-lookahead 80 --ref 5 --colorprim bt709 --colormatrix bt709 --transfer bt709 --deblock -2:-1 --no-sao --no-strong-intra-smoothing --y4m --output /root/eega-out.mkv -
Script evaluation failed:
Python exception: No attribute with the name rgvs exists. Did you mistype a plugin namespace?

Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1937, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1938, in vapoursynth.vpy_evaluateScript
File "/root/eega-all.vpy", line 17, in <module>
denoise = havsfunc.SMDegrain(clip, tr=3, thSAD=300, thSADC=150, contrasharp=True, pel=2, Str=2, prefilter=2, hpad=32, vpad=32)
File "/usr/local/share/vsscripts/havsfunc.py", line 3416, in SMDegrain
return ContraSharpening(output, CClip, planes=planes)
File "/usr/local/share/vsscripts/havsfunc.py", line 5259, in ContraSharpening
ssDD = core.rgvs.Repair(ssD, allD, [rep if i in planes else 0 for i in range(denoised.format.num_planes)]) # limit the difference to the max of what the denoising removed locally
File "src/cython/vapoursynth.pyx", line 1670, in vapoursynth._CoreProxy.__getattr__
File "src/cython/vapoursynth.pyx", line 1532, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name rgvs exists. Did you mistype a plugin namespace?

x265 [error]: unable to open input file <->
root@ubuntu19:~#


Can't find this plugin on my machine nor online, please advise!

root@ubuntu19:~# find / -name "*[rR][gG][vV][sS]*" -ls
48632 8 -rw-r--r-- 1 root root 7794 May 27 23:40 /root/vapoursynth/doc/plugins/rgvs.rst
root@ubuntu19:~#

Are_
28th May 2019, 21:22
Removegrain comes with vapoursynth itself, you compiled it without it.

bjoker
28th May 2019, 21:34
Thanks Are_ - but there's no mention of such things in their site = http://www.vapoursynth.com/doc/installation.html
All they mentioned is -
./autogen.sh
./configure
make
make install


please advise what is my choice now? how to recompile with all default-incl plugins?

qyot27
28th May 2019, 21:50
As I said in the other thread:
sudo ldconfig

Which should be interpreted to mean both 'use ldconfig after make install' and 'stop using the root account'.

bjoker
28th May 2019, 22:14
Hi qyot27
I already ran ldconfig (in fact few times) and now again but the same issue. Do you mean to say that I should recompile/build vapoursynth again and then run ldconfig immediately after that?

As for the root, I don't see any issue using it as it's NOT a production server and i want to use it until I get this setup done. AFter that I will continue using with normal user account.

qyot27
29th May 2019, 01:46
If you drop down to the normal account, do the errors with autoloading remain?

bjoker
29th May 2019, 03:16
Awesome! Many thanks qyot27. :thanks:

As normal user, Everything worked straightaway without having to load any plugins in the code (had to delete all the core.std.LoadPlugin entries from my vpy script).

It's very weird that there were issues running as root user but not as normal user.

bjoker
30th May 2019, 20:40
Hi,

I have a bit weird problem with Vapoursynth on my machine which hangs during encoding. It doesn't respond all of a sudden with keyboard/mouse and also no HDD/SDD activity so I had to power cycle the machine.

My HW config:
Threadripper 1950x (16 core/32 threads)
DDR4 32GB
Gigabyte x399 Motherboard.
Samsug EVO850 M.2

SW config:
1) Windows 10 Pro
StaxRip 2.0.2.1
VapourSynth64Portable_2019_03_11

Since avisynth using only <20% CPU I had to goto Vapoursynth. I tried multiple BD's but all of them caused system hang at some stage. If I do NOT use Vapoursynth, instead using x265 directly/ffmpeg/handbrake (with VS), it did not hang even once for number on encodes.

To further narrow down the problem, I did setup Ubuntu 19 with Vapoursynth which also hanged my machine during encoding. Again everything (x265 cli, ffmpeg/HB etc.) works just fine on Ubuntu as well as long as I do't use Vapoursynth.

During the encode, I monitored both CPU usage (which is around 80%) and CPU temp (less than threshold - under control). Could anyone please advise me on how to troubleshoot this issue of my machine with VS? Are there any logs? (I tried to investigate OS logs & StaxRip'ss logs but none of them gave any useful info int this regard).

Many thanks!!

Boulder
30th May 2019, 20:44
It sounds a lot like some overheating issue, but then again, x265 should also make the CPU work real hard.

Maybe you could install some CPU temp monitoring tool to verify when it hangs.

bjoker
30th May 2019, 20:49
It sounds a lot like some overheating issue, but then again, x265 should also make the CPU work real hard.

Maybe you could install some CPU temp monitoring tool to verify when it hangs.

Yes, I monitored both CPU usage (70-80%) and it's temperatures (~ 80 degrees whereas MAX temp threshold shown as 92 degrees) which seem to be under control. I also think that if there's is too much CPU temp that should cause server to power OFF, not hang? (not sure).

I'm using only the SMDegrain plugin with VS (other than x265 encoding and cropping). I also tried same settings with NLMEans denoiser with Handbrake that never caused this issue. I see 10% more CPU usage with StaxRip/VS vs HB/NLmeans.

None of the other encoding methods (other than using VS) causes system hang.

Thanks for your reply.

Myrsloik
30th May 2019, 22:02
Yes, I monitored both CPU usage (70-80%) and it's temperatures (~ 80 degrees whereas MAX temp threshold shown as 92 degrees) which seem to be under control. I also think that if there's is too much CPU temp that should cause server to power OFF, not hang? (not sure).

I'm using only the SMDegrain plugin with VS (other than x265 encoding and cropping). I also tried same settings with NLMEans denoiser with Handbrake that never caused this issue. I see 10% more CPU usage with StaxRip/VS vs HB/NLmeans.

None of the other encoding methods (other than using VS) causes system hang.

Thanks for your reply.

I recommen using occt (https://www.ocbase.com/) to really test stability. I think it changed a bit in the most recent version but avx2 linpack is what I like to use to test stability. Note that the CPU usage percentage isn't a perfect indicator of actual load. It's actually really shit.

jackoneill
30th May 2019, 22:20
Hi,

I have a bit weird problem with Vapoursynth on my machine which hangs during encoding.

What happens if you remove the VapourSynth plugin KNLMeansCL?

Boulder
31st May 2019, 09:01
Yes, I monitored both CPU usage (70-80%) and it's temperatures (~ 80 degrees whereas MAX temp threshold shown as 92 degrees) which seem to be under control. I also think that if there's is too much CPU temp that should cause server to power OFF, not hang? (not sure).

Usually the safety shutdown temp is much higher than where some CPU-intensive application causes hangs. It's what any overclocker sees when they start finding the limits of the chip.

Myrsloik
1st June 2019, 14:35
R46 test1 (https://www.dropbox.com/s/v2mgw0t91d9nu3j/VapourSynth-R46-test1.exe?dl=1)

Everything is changed! There could be installer bugs, compiler bugs and code bugs at the same time!

Test the new unprivileged install mode a bit extra.

r46:
updated windows projects to use vs2019, inno setup 6 and latest zimg
the windows installer now supports installs without administrator privileges
the windows installer no longer puts a copy of vsscript.dll in the system directory and no longer writes the legacy registry entries, deprecated since r31
the portable install now includes all the sdk files
added a fallback to how the appdata path is retrieved which works even if %USERPROFILE% isn't set
added an option to vspipe to make it not modify the current working directory
added a better equality check for the Format class in python
fixed doubleweave sometimes using the opposite field order (dubhater)
fixed broken output when stride wasn't equal to width in the python output function (stuxcrystal)
relaxed mask clip requirements in maskedmerge (dubhater)
fixed overflow with int16 in maskedmerge (dubhater)
fixed swapped fields in doubleweave (dubhater)
fixed selectevery breaking and leaking when there are no frames to return

stax76
1st June 2019, 15:39
StaxRip needed an adjustment to find the dll in unprivileged per user setup, other than that it's working so far.

ChaosKing
1st June 2019, 15:49
If I click on "install for me only" it says "no python 3.7 installation is not found". But finds python 3.7 for "all users".

EDIT: So I guess I need also a per user python installation then!?

stax76
1st June 2019, 16:02
I've only one per user Python installed and it was found.

C:\Users\frank\AppData\Local\Programs\Python\Python37\python.exe

Myrsloik
1st June 2019, 17:55
If I click on "install for me only" it says "no python 3.7 installation is not found". But finds python 3.7 for "all users".

EDIT: So I guess I need also a per user python installation then!?

Yes, obviously a per user Python installation is needed. You don't even have write permissions to install a module otherwise most of the time.