Adding script to Vapoursynth in Hybrid - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html) +--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html) +--- Thread: Adding script to Vapoursynth in Hybrid (/thread-1542.html) |
Adding script to Vapoursynth in Hybrid - Garo 7 - 22.09.2020 Hello, question: If I want to add the following import and filter commands to VapourSynth script in Hybrid, how do I do this? import vapoursynth as vs core = vs.get_core() import fvsfunc as fvf import kagefunc as kgf import fag3kdb as Fag3kdb core.max_cache_size = 8192 ############################################## clip = core.lsmas.LWLibavSource(r"G:\SOURCE PATH AND FILE NAME.mkv") clip = core.fmtc.bitdepth(clip, bits=16) RESCALE = fvf.DescaleAA(clip, 1600, 900, kernel='bicubic', b=0, c=0.5, thr=7, expand=9) DENOISE = core.fft3dfilter.FFT3DFilter(RESCALE) DEBAND = core.f3kdb.Deband(DENOISE, range=12, y=60, cb=40, cr=40, grainy=0, grainc=0, output_depth=16) GRAIN = kgf.adaptive_grain(DEBAND, strength=0.10, static=True, show_mask=False) clip = core.fmtc.bitdepth(GRAIN, bits=10) ############################################## clip.set_output() *** I tried adding them in Custom "Before END" and it does not seem to work. Can you perhaps guide me? **** Also, where do I copy new *.vs script files for Vapoursynth, such as kagefunc.py? Again I tried and it did not seem to work. Guidance please...? Thank you - Garo RE: Adding script to Vapoursynth in Hybrid - Selur - 22.09.2020 1. Hybrid does not support any sort of templating. 2. Custom section is the right place if you want to add content. 3. Hybrid doesn't care where you put your stuff as long as you properly load it in Vapoursynth. So your main problem is you need to understand how Python/Vapoursynth works. => Short answer: Sorry to tell you, but Hybrid isn't customisable the way you want to. Long answer: To be able to import fvsfunc as fvf you Vapoursynth/Python must know the fvsfunc.py file. To archive this you either need to place them into the folders Vapoursynth automatically loads scripts form (see: http://www.vapoursynth.com/doc/plugins.html), or manually tell Hybrid to import scripts from a specific folder. Hybrid does the later whenever a script is used by is using: # Imports So to be able for Vapoursynth to understand: import fvsfunc as fvf The same is true for filters in .dll form, Vapoursynth needs to know of them, so they either need to be loaded explicitly for example through: # Loading Plugins So your custom addition must: 1. let vapoursynth know about the scripts (or they need to be placed inside one of the autoload folders) 2. import the scripts import fvsfunc as fvf # Loading Plugins Small warning: scripts will crash if a filter is in an autoload folder and explicitly loaded. 4. do what ever you want it to do: RESCALE = fvf.DescaleAA(clip, 1600, 900, kernel='bicubic', b=0, c=0.5, thr=7, expand=9) -> this is all really straight forward assuming you know how basic Vapoursynth works. Hope this helps a bit. So now to the bad news: Your script addition is not compatible with Hybrids custom option since it changes the resolution and Hybrid has not the ability to know this so using your script with Hybrid will not work. => Sorry to tell you, but Hybrid isn't customisable the way you want to. Cu Selur Ps.: Assuming the script you use can be previewed in vsViewer or Vapoursynth Editor you can use it as source in Hybrid. |