i moved to vapoursynth and i am having a hard time trying to figure out how to load and use plugins and filters .
most conversions i find are not .dll files but .pyd or .py
there were plugins that were saved with .avsi in vap...' is it .vpy? or .vpyi ? if i want to use it us a plugin ?
how do i "install" the plugins i need assuming i know their name and where to download them, and how do i use them in the code?
lets say in avspMod it was just "sharpen("x")" in vapoursynth its something else
edit:figured out some stuff is in a "package" like "havsfunc" and "muvsfunc" and i have to load them "import muvsfunc as X"
how do i use them when i import them as "x"?
+ Reply to Thread
Results 1 to 17 of 17
-
Last edited by zanzar; 8th Feb 2019 at 12:11.
-
You have to use their namespace . If you "import havsfunc as haf" , then "haf" is the namespace for the functions defined in havsfunc.vpy. Then you call the actual function . But you can use whatever namespace you want. I find it's easier to put the .vpy scripts into the python/Lib/site-packages folder . It would be analgous to the avisynth "plugins" folder with .avsi scripts, but you still have to use the import function to define the namespace .
e.g for LSFMod
Code:import vapoursynth as vs import havsfunc as haf core = vs.get_core() clip = core.lsmas.LWLibavSource(r'PATH\video.mkv') clip = haf.LSFmod(clip) clip.set_output()
-
Another way is to use avisynth directly in the vpy script . You can load an avs script in a vpy script with AVISource (limited to certain pixel formats). This can be useful when you're learning the syntax for vapoursynth, or the native plugin version or equivalent is slightly different (eg. VIVTC doesn't have all the functions of avisynth's TIVTC)
Or the reverse - you can also load vpy script in avisynth (limited to certain pixel formats) with VapourSource
For both of those - you need matching x64 or x86 versions installed of avisynth and vapoursynth; so those really work best only on Windows
Other options are loading the avs plugin directly - you can load avs plugins through avs.LoadPlugin , or avsw.Eval (avsproxy) . But direct equivalents (native vapoursynth plugins and scripts) are usually faster. There is less overhead. Same with running avisynth host, and using VapourSource - native is almost always faster -
Using Vapoursynth you directly write a script in Python language. You can name your script *.py , not necessarily *.vpy and it is going to work. Consoles (that you write in python) would not read vpy at first.
Python import function is an equivalent to import *.avsi in Avisynth, except it is tons of more powerful because having Python going on you can import moduls of shear power to do almost anything because Python modul library is extremely large.
in case of havsfunc.py, that is a legit Pyhon script and if you want to import it into your script , it is called importing modul havsfunc.
Sometimes it is better to start with basics, for example, so your QTGMC script could be:
Code:import vapoursynth import havsfunc file = r'C:\files\my_file.mp4' clip = vapoursynth.core.ffms2.Source(file) clip = vapoursynth.core.std.SetFrameProp(clip, prop="_FieldBased", intval=2) #intval=1 for bff , 2 for tff, 0 for frame based clip = havsfunc.QTGMC(clip, Preset='Fast', TFF=True) clip.set_output()
Code:from vapoursynth import core import havsfunc as haf file = r'C:\files\my_file.mp4' clip = core.ffms2.Source(file) clip = core.std.SetFrameProp(clip, prop="_FieldBased", intval=2) #intval=1 for bff , 2 for tff, 0 for frame based clip = haf.QTGMC(clip, Preset='Fast', TFF=True) clip.set_output()
Code:from vapoursynth import core from havsfunc import QTGMC file = r'C:\files\my_file.mp4' clip = core.ffms2.Source(file) clip = core.std.SetFrameProp(clip, prop="_FieldBased", intval=2) #intval=1 for bff , 2 for tff, 0 for frame based clip = QTGMC(clip, Preset='Fast', TFF=True) clip.set_output()
Code:import vapoursynth as vs from havsfunc import QTGMC file = r'C:\files\my_file.mp4' clip = vs.core.ffms2.Source(file) clip = vs.core.std.SetFrameProp(clip, prop="_FieldBased", intval=2) #intval=1 for bff , 2 for tff, 0 for frame based clip = QTGMC(clip, Preset='Fast', TFF=True) clip.set_output()
you might for example do this:
Code:import vapoursynth as vs from havsfunc import QTGMC file = r'C:\files\my_file.mp4' load = vs.core.ffms2.Source clip = load(file) clip = vs.core.std.SetFrameProp(clip, prop="_FieldBased", intval=2) #intval=1 for bff , 2 for tff, 0 for frame based clip = QTGMC(clip, Preset='Fast', TFF=True) clip.set_output()
that 'r' character in front of quotes for string means to ignore backslash characters , it is used only in windows in python to make sure a path string would be correct, because strings use '\' as a character to signal some function and read a character right after, for example \n means a new line, so 'something\nagain' if you print it, you'd get:
something
again
in linux you do not have to use that 'r' because linux uses '/' character in paths, or in windows you do not have to use that r character but you'd need to double all backslashes like C:\\path ....Last edited by _Al_; 8th Feb 2019 at 21:38.
-
-
ok i got how to run filters that needs just its own plugin (sharpen , blur , DeHalo_alpha etc) but it seems that there is a problem running stuff that needs bunch of plugins working tougether.
for example "MCTemporalDenoise" is included in the "HAvsFunc" py package but when calling it (or any other more complex filter , for example Smoothlevels , MCTemporalDenoise...
here is the error it gives me
Code:from vapoursynth import core import muvsfunc as puf import mvsfunc as muf import havsfunc as kuf clip = core.ffms2.Source(r'D:\Z.mp4') clip = kuf.MCTemporalDenoise(clip,settings="very low") clip.set_output()
Code:Failed to evaluate the script: Python exception: No attribute with the name dfttest exists. Did you mistype a plugin namespace? 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 "D:/Untid.vpy", line 9, in clip = core.ffms2.Source(r'D:\Z.mp4') File "src\cython\vapoursynth.pyx", line 1660, in vapoursynth._CoreProxy.__getattr__ File "src\cython\vapoursynth.pyx", line 1522, in vapoursynth.Core.__getattr__ AttributeError: No attribute with the name dfttest exists. Did you mistype a plugin namespace?
it states here https://forum.doom9.org/showthread.php?t=139766 , what filters are needed to run "MCTemporalDenoise" , in avisyth ill just putt their dlls in the plugins folder, in vapor synth it seems that even tho "havsfunc" has the filter itself in the package , it doesnt have the plugins that are needed to run it in the same .py
with smoothlevels it gives me this
Code:from vapoursynth import core import muvsfunc as puf import mvsfunc as muf import havsfunc as kuf clip = core.ffms2.Source(r'D:\Z.mp4') clip = kuf.SmoothLevels(clip,30, 0.85, 246, 5, 255) clip.set_output()
Code:Failed to evaluate the script: Python exception: can't convert complex to float 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 "D:/Untid.vpy", line 10, in clip = kuf. File "C:\Users\Perfect Plan\VapourSynth\havsfunc.py", line 3985, in SmoothLevels level = core.std.Lut(limitI, planes=[0], function=get_lut) File "src\cython\vapoursynth.pyx", line 1833, in vapoursynth.Function.__call__ vapoursynth.Error: can't convert complex to float
-
It tells you the error , just like avisynth
No attribute with the name dfttest exists
A good database for search, links for vpy plugins / scripts
http://vsdb.top/
For the smoothlevels error , you have to split out the gamma with 2 calls
Code:clip = kuf.SmoothLevels(clip, input_low=30, gamma=1, input_high=246, output_low=5, output_high=255) clip = kuf.SmoothLevels(clip, input_low=0, gamma=0.85, input_high=255, output_low=0, output_high=255)
-
-
VIVTC . But its missing some of the additional features and modes of avisynth's TIVTC. But it should be sufficient for simple/standard IVTC
http://www.vapoursynth.com/doc/plugins/vivtc.html
Or you can use avisynth and vapoursynth . Recall the AVISource workaround mentioned earlier (you can do the IVTC part in avisynth, then feed that script into vapoursynth with AVISource). TIVTC is definitely better for complex DVD's which are not simple/standard
eg. feeding avisynth script into vapoursynth script
Code:clip = core.avisource.AVISource(r'PATH\avs_script.avs')
-
-
Yes, slower. But if you're using things like waifu2x, it won't be a bottleneck
Anything that is hard telecine but not strict cadence, or if it has combing will usually be slightly worse with VIVTC than using avisynth alternative. I would only trust VIVTC with clean DVD, strict cadence, no combing.
TFM() in default mode has pp comb detection and low quality deinterlace. Otherwise you should use pp=0 if absolutely no combing, or use clip2 for higher quality deinterlacer on combed -
well i do use the DVD iso files this seems to work
Code:from vapoursynth import core clip = core.d2v.Source(r'D:\VIDEO_TS.d2v') clip = core.vivtc.VFM(clip,1) clip = core.vivtc.VDecimate(clip) clip.set_output()
-
If it's standard, strict cadence (3:2) , hasn't been edited while interlaced, no combing you should be ok (ie. a perfect DVD). Otherwise you might get wrong matches, combing artifacts. VIVTC has no comb pp by default
Anime DVD's are typically bad for this, unless they are from a modern series release -
any advice on resizing the waifu2x downscale back to 720p?
something like
Code:clip = nnrs.nnedi3_resample(clip, clip.width * 0.75, clip.height * 0.75)
Code:clip = core.resize.Spline36(clip, 1280, 720)
Code:nnedi3_rpow2(2, cshift="spline64resize", fwidth=1280, fheight=720)
Last edited by zanzar; 12th Feb 2019 at 16:37.
-
It won't make much of a difference for downsizing . You can preview and see what you like better
-
last thing
i cant get smoothlevels running
Code:import vapoursynth as vs import muvsfunc as puf import mvsfunc as muf import havsfunc as kuf core = vs.get_core() clip = core.ffms2.Source(r'D:\Z.mp4') clip = kuf.SmoothLevels(clip, input_low=30, gamma=1, input_high=246, output_low=5, output_high=255) clip.set_output()
Code:Failed to evaluate the script: Python exception: There is no attribute or namespace named f3kdb 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 "D:/Untid.vpy", line 7, in File "C:\Users\Perfect Plan\VapourSynth\havsfunc.py", line 3993, in SmoothLevels process = core.std.Expr([process], [expr]).f3kdb.Deband(grainy=0, grainc=0, output_depth=input.format.bits_per_sample) File "src\cython\vapoursynth.pyx", line 1211, in vapoursynth.VideoNode.__getattr__ AttributeError: There is no attribute or namespace named f3kdb
-
That's what it is
If the github release does not have a compiled .dll , look in the discussion thread for links because someone probably already compiled it. (The database has links to the forum discussion thread too)
eg
https://forum.doom9.org/showthread.php?p=1841014#post1841014
https://mega.nz/#F!Y10U2LiJ!2H29c5mv5npZiTMdtSwveg
Similar Threads
-
Avisynth equivalent plugins for vapoursynth
By zanzar in forum Newbie / General discussionsReplies: 4Last Post: 4th Feb 2019, 11:58 -
Help transitioning from avisynth to vapoursynth.
By zanzar in forum Newbie / General discussionsReplies: 10Last Post: 3rd Feb 2019, 16:50 -
Debading method (Vapoursynth to avisynth)
By frank_zappa in forum RestorationReplies: 2Last Post: 3rd Nov 2017, 12:26 -
Problems loading plugins into AVISynth
By bvdd in forum Video ConversionReplies: 51Last Post: 20th Nov 2015, 07:15 -
HELP! MeGUI can't load certain avisynth plugins
By Throw_Hammer in forum Newbie / General discussionsReplies: 3Last Post: 22nd Feb 2014, 17:19