Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
14th May 2020, 14:21 | #3841 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
@Txico: you can also do something like:
Code:
# Import scripts folder scriptPath = '/home/myuser/vapoursynth-scripts' sys.path.append(os.path.abspath(scriptPath)) Note that this will not automatically import the libraries,... --- @all: are there any Intel® Open Image Denoise filters for Vapoursynth out there? Last edited by Selur; 14th May 2020 at 14:26. |
16th May 2020, 20:29 | #3842 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Lets talk again about this problem here https://forum.doom9.org/showthread.p...96#post1840996
I'm now very sure that this problem is in some way connected to FrameEval() Problem: Functions with a high temporal radius (called by frameEval) produces different results then without FrameEval I don't think that all 4 plugins are storing temporal state incorrectly. Example script: Code:
import functools import vapoursynth as vs import mvsfunc as mvf #https://github.com/HomeOfVapourSynthEvolution/mvsfunc/blob/master/mvsfunc.py core = vs.get_core() def comp(a, b, crop=0): return core.std.StackHorizontal([ core.std.CropRel(a, crop,crop,0,0), \ core.std.CropRel(b, crop,crop,0,0), \ ]) # Goal here is to remove dynamic grain and replace it with similar static grain def ReGrainDenoise(clip): # test denoiser 1 #clip = mvf.Depth(clip, 32) #sup = core.mvsf.Super(clip) #vec = core.mvsf.Analyze(sup, radius=9, overlap=4) #vec = core.mvsf.Recalculate(sup, vec, blksize=4, overlap=2) #denoised = core.mvsf.Degrain(clip, sup, vec, thsad=1600) # test denoiser 2 #import havsfunc as haf #https://github.com/HomeOfVapourSynthEvolution/mvsfunc/blob/master/mvsfunc.py #clip = mvf.Depth(clip, 16) #denoised = haf.SMDegrain(clip, tr=3, thSAD=1500) #denoised = denoised.flux.SmoothST( temporal_threshold=16, spatial_threshold=16) #denoised = mvf.Depth(denoised, 32) #clip = mvf.Depth(clip, 32) # test denoiser 3 ##lip = mvf.Depth(clip, 16) #denoised = clip.knlm.KNLMeansCL(d=8, h=6) #denoised = mvf.Depth(denoised, 32) #clip = mvf.Depth(clip, 32) # test "denoiser" 4 denoised = clip.misc.AverageFrames(weights=[1]*31)[::31].misc.AverageFrames(weights=[1]*31) # add back static grain grain = denoised.grain.Add(var=1200.0, constant=True) diff_clip = core.std.Expr([clip, denoised], 'x y - abs').std.Inflate(threshold=200/255).std.Inflate(threshold=200/255) mask_clip = diff_clip.std.Binarize(threshold=[3.3/219, 3.3/224], v0=0, v1=80/255) clip = core.std.MaskedMerge(clipa=denoised, clipb=grain, mask=mask_clip) return mvf.Depth(clip, 32) clip = core.std.BlankClip(format=vs.YUV420P16, width=120*2, height=80*2, length=100, color=[206,235,135]) clip = mvf.Depth(clip, 32) clip = clip.grain.Add(var=100.0, constant=False) orig=clip def CalledbyFrameEval(n, c): return ReGrainDenoise(c) WithFrameEval = clip.std.FrameEval(functools.partial(CalledbyFrameEval, c=clip)) NoFrameEval = ReGrainDenoise(clip) clip = comp( WithFrameEval.text.Text("called from FrameEval").std.AddBorders(right=2), NoFrameEval.text.Text("Without FrameEval").std.AddBorders(right=2), crop=0 ) clip = comp(clip, orig.text.Text("unfiltered"), crop=0) clip.set_output()
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 16th May 2020 at 20:36. |
18th May 2020, 19:15 | #3843 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
I have 2 questions regarding the API
1) what kind of filter outputs multiple clips, and what is the python syntax to bind the outputs of such filter? is it Code:
clips = core.???.filter(...) #clips[0], clips[1], ... Code:
clip1, clip2, ... = core.???.filter(...) 2) does audio support break compatibility with the current API? where can I find the audio API? |
18th May 2020, 20:00 | #3844 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
2. Audio support doesn't break the API at all, simply extends it. You can find it in the doodle1 branch. Expect a new test release in a few days when I finish writing and testing a few more simple audio filters.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
2nd June 2020, 20:20 | #3846 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
why does vspipe freeze then crash if I comment out this line (which assumes the default multithreading mode, fmParallel)?
the default multithreading mode however seems to work with vsedit (preview) Last edited by feisty2; 2nd June 2020 at 20:25. |
2nd June 2020, 20:34 | #3847 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
2nd June 2020, 20:42 | #3848 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
yes, GCC10 is required to compile this thing, I guess clang10 should also work. However I believe this problem could be reproduced with the C API as well, since I copied this parallel request mode from the core code base.
|
3rd June 2020, 10:41 | #3849 | Link |
Registered User
Join Date: Oct 2010
Location: Auckland, Aotearoa/New Zealand
Posts: 8
|
Getting an odd compilation error Cython compiling vapoursynth.c during vapoursynth make:
Error compiling Cython file: ------------------------------------------------------------ ... def keys(self): cdef const VSMap *m = self.funcs.getFramePropsRO(self.constf) cdef int numkeys = self.funcs.propNumKeys(m) result = set() for i in range(numkeys): set.add(self.funcs.propGetKey(m, i).decode('utf-8')) ^ ------------------------------------------------------------ src/cython/vapoursynth.pyx:1095:19: Call with wrong number of arguments (expected 2, got 1) make: *** [Makefile:2368: src/cython/vapoursynth.c] Error 1 Ubuntu 20.04 on Windows Linux Subsystem, did a pip3 install cython: Successfully installed cython-0.29.19 added /home/<username>/.local/bin to $PATH, all the usual stuff. Any ideas/ further information needed? I successfully installed on Native Ubuntu 19.10 a while back and updated to 20.04; all still A-OK there. TIA |
3rd June 2020, 10:52 | #3850 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
7th June 2020, 06:26 | #3852 | Link |
Registered User
Join Date: Oct 2010
Location: Auckland, Aotearoa/New Zealand
Posts: 8
|
Interesting scripting error arose:
outclip = core.std.StackVertical(clip,clip,clip,clip) gave the error File "src/cython/vapoursynth.pyx", line 1822, in vapoursynth.Function.__call__ vapoursynth.Error: StackVertical: Too many unnamed arguments specified. Is there not a way to stack the same clip vertically or horizontally, or am I missing something? TIA |
7th June 2020, 07:05 | #3853 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Code:
outclip = core.std.StackVertical([clip,clip,clip,clip]) |
|
7th June 2020, 19:17 | #3854 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
suggestion: dynamically typed filter arguments should be supported (something like "param: dynamic: opt")
this could greatly simplify the user interface of filters like std.SetFrameProp "intval", "floatval" and "data" could be unified by a single dynamically typed parameter "val" there's no need to separate arguments of different data types since whenever the user passes a value to "val", the C++ plugin could query the type of the item associated with "val", then decide how "val" should be handled, example here: https://github.com/IFeelBloated/vsFi...e/Map.vxx#L159 |
10th June 2020, 09:26 | #3856 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Those of you who are interested in audio support should take a look at the latest audio build and the audio development thread.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
14th June 2020, 04:18 | #3857 | Link |
Registered User
Join Date: May 2019
Posts: 5
|
Hi I need some help.
I have a clip with the property 'Scenechange' added to all frames (by WWXD) I want to do the following: For every scenechange frame I want to extract 4 frames: The two before it, the marked frame and the 1 after it. I also want to label them with their frame numbers in the source (using Text). I then want all these series' of 4 frames in sequence as 1 clip. Can someone help me please? Also FrameEval is runtime evaluated and I don't know if I need that... Edit: Here's what I've come up with... it seems fairly slow - vsedit hangs for a bit. And the 4 frames all have the same frame# (of the scenechange), can anyone tell me if this is the right way to go about what I want. Code:
def extractSC(clip): scdetect = core.wwxd.WWXD(clip=clip) extract = core.std.BlankClip(clip=scdetect, length = 1) sceneChangeNr = 0 for i in range(scdetect.num_frames-1): frame = scdetect.get_frame(i) if frame.props['Scenechange'] == 1: sceneChangeNr+=1 before = i - 2 after = i + 2 if i < 2: before = i extract += core.text.Text(scdetect[before:after], "Frame No.: " + str(i) '\nScene Change: ' + str(sceneChangeNr)) return extract Last edited by nacho; 15th June 2020 at 01:11. |
15th June 2020, 19:05 | #3858 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Is there maybe something like AviSynth AddAutoloadDir?
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
15th June 2020, 19:15 | #3859 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
I don't think so but it's easy to make your own Autoloaddir with something like
Code:
import glob plugins = glob.glob(r"C:\plugins64\*.dll") for plugin in plugins: try: vs.core.std.LoadPlugin(plugin) except: print("some err")
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
15th June 2020, 19:30 | #3860 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
The reason why I ask is in portable mode VapourSynth has an auto load folder defined but I don't want staxrip users to modify anything within the startup folder because then it would be difficult to update staxrip, so for portable mode I'm adding another auto load folder located in the staxrip settings folder, it can be opened in the main menu the same way as the installed auto load folder. I've added code like suggested so no problem.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
Tags |
speed, vaporware, vapoursynth |
|
|