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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd May 2020, 21:59   #3901  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,196
Quote:
Originally Posted by Myrsloik View Post
Code:
r50:
fixed regression in r49 where the python dll could only be located when in the PATH on windows
I can confirm it's fixed now. Thanks!
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.


LoRd_MuldeR is offline   Reply With Quote
Old 3rd May 2020, 03:34   #3902  |  Link
HuBandiT
Registered User
 
Join Date: Dec 2017
Posts: 12
Quote:
Originally Posted by feisty2 View Post
you could take a look at vsFilterScript if ur compiler supports most of C++20 core language features, it is the easiest way to get started.

the namespace must be unique, you must define ur own namespace.
Thank you, I started doing my own thing from scratch to practice some C++, I took a short look at yours, but I'll look more closely later. It does look very script-y though.
HuBandiT is offline   Reply With Quote
Old 3rd May 2020, 20:40   #3903  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
R50-RC2

Code:
r50:
updated zimg to latest v2.9 so grayscale colorspace are supported
added __version__ and __api_version__ to python module to make detecting version mismatches easier
improved rounding in averageframes (sekrit-twc)
fixed averageframes not properly rejecting more than 31 weights or nodes
fixed crash in textfilter line wrapping introduced in r49 (sekrit-twc)
fixed regression introduced in r48 where expr, sobel and prewitt wouldn't clamp 9-15 bit output to valid range (sekrit-twc)
fixed crash due to null pointer dereference when instantiation many vapoursynth classes directly in python
fixed regression in r49 where the python dll could only be located when in the PATH on windows
If someone on linux can confirm or deny this bug https://github.com/vapoursynth/vapoursynth/issues/503 it'd be helpful.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 7th May 2020, 05:01   #3904  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 299
If I could make a recommendation, it would be nice if the Linux setup automatically detected if dist-packages exists and then use that instead of site-packages considering Debian based Linux distros and a few others use that instead of site-packages for Python. Either that or updating the current guide on the main site to recommend checking for that and creating a symbolic link to redirect files from site-packages to dist-packages would be nice considering this affects quite a few popular Linux distros, such as Ubuntu. Side note, most of the distros that have that issue also need the end user to run ldconfig or it will fail to load as well so it would be nice to include that in the documentation as well.
l33tmeatwad is offline   Reply With Quote
Old 8th May 2020, 02:21   #3905  |  Link
HuBandiT
Registered User
 
Join Date: Dec 2017
Posts: 12
Low priority question:

Is queryCompletedFrame() still "This function has several issues and may or may not return the actual node or frame number."? Even in an fmSerial filter?

If yes, how much work would be needed to fix it? (Or is there another way to query the new frame when VSFilterGetFrame() is called with arFrameReady?)
HuBandiT is offline   Reply With Quote
Old 8th May 2020, 07:22   #3906  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by HuBandiT View Post
Low priority question:

Is queryCompletedFrame() still "This function has several issues and may or may not return the actual node or frame number."? Even in an fmSerial filter?

If yes, how much work would be needed to fix it? (Or is there another way to query the new frame when VSFilterGetFrame() is called with arFrameReady?)
The frame number is always correct in more recent versions. It's just the node pointer you can't trust. Modes and other things have nothing to do with it and change nothing.

This much work needed to fix it:
|--------------------|
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 8th May 2020, 16:17   #3907  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
R50 is released. Bug fixes only so everyone should update.
Code:
r50:
updated zimg to latest v2.9 so grayscale colorspace are supported
fixed several minor issues related to path handling in vsrepo
added __version__ and __api_version__ to python module to make detecting version mismatches easier
improved rounding in averageframes (sekrit-twc)
fixed averageframes not properly rejecting more than 31 weights or nodes
fixed crash in textfilter line wrapping introduced in r49 (sekrit-twc)
fixed regression introduced in r48 where expr, sobel and prewitt wouldn't clamp 9-15 bit output to valid range (sekrit-twc)
fixed crash due to null pointer dereference when instantiation many vapoursynth classes directly in python
fixed regression in r49 where the python dll could only be located when in the PATH on windows
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th May 2020, 10:11   #3908  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,991
Thank you for the new release
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is online now   Reply With Quote
Old 12th May 2020, 00:29   #3909  |  Link
Txico
Registered User
 
Join Date: Nov 2017
Posts: 5
Hello there.
Last time I posted here was in august because I had trouble with the environment variables, python 3.7 and Ubuntu. Gladly solved.
Now Ubuntu 20.04 is out and I'm not any longer capable of compiling the sources to build.
After installing all the packages in the documentation for Linux compilation I got through the ./autogen.sh and ./configure, but now make give me this error:
CXXLD vspipe
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `Py_InitializeEx'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyDict_GetItemString'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `_Py_Dealloc'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyImport_ImportModule'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyCapsule_GetPointer'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyCapsule_IsValid'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyEval_SaveThread'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyGILState_Ensure'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `Py_IsInitialized'
collect2: error: ld returned 1 exit status
make: *** [Makefile:1318: vspipe] Error 1

At least the first error, the one with Py_InitializeEx, I get is threads related. But I don't know what I'm missing and documentation doesn't give me any clue.
Anybody? Please?
Txico is offline   Reply With Quote
Old 12th May 2020, 17:09   #3910  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 744
Quote:
Originally Posted by Txico View Post
Hello there.
Last time I posted here was in august because I had trouble with the environment variables, python 3.7 and Ubuntu. Gladly solved.
Now Ubuntu 20.04 is out and I'm not any longer capable of compiling the sources to build.
After installing all the packages in the documentation for Linux compilation I got through the ./autogen.sh and ./configure, but now make give me this error:
CXXLD vspipe
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `Py_InitializeEx'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyDict_GetItemString'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `_Py_Dealloc'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyImport_ImportModule'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyCapsule_GetPointer'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyCapsule_IsValid'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyEval_SaveThread'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `PyGILState_Ensure'
/usr/bin/ld: ./.libs/libvapoursynth-script.so: undefined reference to `Py_IsInitialized'
collect2: error: ld returned 1 exit status
make: *** [Makefile:1318: vspipe] Error 1

At least the first error, the one with Py_InitializeEx, I get is threads related. But I don't know what I'm missing and documentation doesn't give me any clue.
Anybody? Please?
It's because of a change in Python 3.8, but this is supposed to work now with VapourSynth R50. What version are you trying to compile?

A temporary solution is to run make again like this:
Code:
make LIBS="$(python3-config --libs --embed)"
(It has nothing to do with threads.)
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 12th May 2020, 17:59   #3911  |  Link
Txico
Registered User
 
Join Date: Nov 2017
Posts: 5
Thanks a lot! That did the trick. And thanks for the quick response.
I was trying to compile the latest release R50, now it works.
I know it was nothing related to threads. It was related to standard libraries not been found, but I didn't know how to solved it.
An official documentation update could be really nice ...
Txico is offline   Reply With Quote
Old 14th May 2020, 10:11   #3912  |  Link
Txico
Registered User
 
Join Date: Nov 2017
Posts: 5
And now I'm having trouble loading plug-ins ...
I tried to set the UserPluginDir variable on compile time with "configure --with-plugindir='/home/myuser/vapoursynth-plugins'", creating a vapoursynth.conf file with "UserPluginDir=/home/myuser/vapoursynth-plugins" and setting an incorrect value for the folders or change the name folder: Autoloading the user plugin dir '/home/myuser/vapoursynth-plugins' failed. Directory doesn't exist?
So the variable is working.
So, why I'm having trouble doing something as easy as "import havsfunc as haf" when the file havsfunc.py is there?
ModuleNotFoundError: No module named 'havsfunc'

Any clue? Anything else I need to know?
Txico is offline   Reply With Quote
Old 14th May 2020, 10:44   #3913  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 311
Because .py files are not plugins but python modules. You need to place them inside your root protected site-packages directory (ore whatever is called in your distro).

If you don't want to mess with that you can create a .pth file there with the path to de directory you want to put your python modules inside. Like for example:
Code:
$ cat /usr/lib64/python3.6/site-packages/vapoursynth-autoload.pth
/home/youruser/vapoursynth-python-modules
Are_ is online now   Reply With Quote
Old 14th May 2020, 14:21   #3914  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,206
@Txico: you can also do something like:
Code:
# Import scripts folder
scriptPath = '/home/myuser/vapoursynth-scripts'
sys.path.append(os.path.abspath(scriptPath))
to allow "import havsfunc as haf" when the havsfunc.py is inside the '/home/myuser/vapoursynth-scripts' folder.
Note that this will not automatically import the libraries,...

---
@all: are there any Intel® Open Image Denoise filters for Vapoursynth out there?
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..

Last edited by Selur; 14th May 2020 at 14:26.
Selur is offline   Reply With Quote
Old 16th May 2020, 20:29   #3915  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,440
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()
EDIT: Added AverageFrames() as "denoiser"
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository

Last edited by ChaosKing; 16th May 2020 at 20:36.
ChaosKing is offline   Reply With Quote
Old 18th May 2020, 19:15   #3916  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,504
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], ...
or
Code:
clip1, clip2, ... = core.???.filter(...)
?

2) does audio support break compatibility with the current API? where can I find the audio API?
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 18th May 2020, 20:00   #3917  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by feisty2 View Post
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], ...
or
Code:
clip1, clip2, ... = core.???.filter(...)
?

2) does audio support break compatibility with the current API? where can I find the audio API?
1. It returns a list of clips so your first guess is used.
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
Myrsloik is offline   Reply With Quote
Old 25th May 2020, 19:34   #3918  |  Link
HuBandiT
Registered User
 
Join Date: Dec 2017
Posts: 12
What is the problem you are trying to solve?

Do you really need FrameEval() for it?

Also, why are you denoising in YUV space? Your result will look blurry.

Last edited by HuBandiT; 25th May 2020 at 19:36.
HuBandiT is offline   Reply With Quote
Old 2nd June 2020, 20:20   #3919  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,504
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)
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated

Last edited by feisty2; 2nd June 2020 at 20:25.
feisty2 is offline   Reply With Quote
Old 2nd June 2020, 20:34   #3920  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by feisty2 View Post
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)
Does this require a C++20 comoiler to test?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.