View Full Version : Vapoursynth
ChaosKing
9th February 2022, 18:00
Linux / cross plattform alternative https://github.com/dubhater/D2VWitch
Jukus
9th February 2022, 18:03
Linux / cross plattform alternative https://github.com/dubhater/D2VWitch
What can do if the DVD has video in two angles? If just use d2vwitch then get video and audio where 2 seconds of video comes from one angle and then the same action from the other angle.
Use PGCDemux or similar to extract the content you want.
There is no Vapoursynth filter (neither is there one for Avisynth) which properly parses DVD structures in details.
*****
Boulder
9th February 2022, 18:48
I don't feel like using Windows programs even under Wine
Thanks for the answers
What if you pretend that it's not a Windows program :D:p
Or ask if videoh could do a Linux build. Or use a Linux build of DGIndexNV+DGSource if you have a suitable GPU.
Jukus
9th February 2022, 19:59
not very elegant, but solved my problem with https://www.makemkv.com/
Selur
14th February 2022, 14:22
Is there an Vapoursynth plugin for inpainting?
kedautinh12
14th February 2022, 14:32
Here:
https://github.com/invisiblearts/VapourSynth-Inpaint
Selur
14th February 2022, 14:50
Does that actually work? Code seems rather short with 133lines. (cpp file)
Also is there a compiled version of this?
Selur
17th February 2022, 15:58
Is it possible to restrict the number of threads for just a specific filter?
PRAGMA suggested:
One mistake people are doing is letting VS use the default multi-threading with EGVSR when it should be disabled with `core.num_threads = 1`. Once you do this, it will only run the model on the current frame + n(interval) next frames at a time, instead of e.g. 72 frames with a num_threads of 1
source: https://forum.doom9.org/showpost.php?p=1962294&postcount=83
So I was wonder whether one could limit the threads just for vsgan and keep the rest of the script running with the full number of threads?
Cu Selur
Myrsloik
18th February 2022, 01:27
Recompile/binary hack the filter to be a parallel requests filter instead of true parallel.
I guess.
Selur
18th February 2022, 05:58
Okay, that isn't really an option or generic use, but thanks for clearing that up. :)
Cu Selur
Myrsloik
18th February 2022, 09:25
Okay, that isn't really an option or generic use, but thanks for clearing that up. :)
Cu Selur
Why do you need it for "generic use"? Badger the filter authors until they write it properly instead. Not going to implement hacks for badly programmed things.
Selur
18th February 2022, 10:05
Why do you need it for "generic use"?
So that I don't have to "Badger the filter authors until they write it properly instead." for any filter where this might happen. :D
It's no problem I can live with it. :)
Not going to implement hacks for badly programmed things.
btw. any news regarding the possiblity to disable auto loading filter?
Cu Selur
mastrboy
19th February 2022, 14:24
How does one convert a framenumber to a "audio sample unit"?
Trying to to use std.AudioTrim to match std.Trim for some video cutting.
I already checked the docs (http://www.vapoursynth.com/doc/functions/audio/audiotrim.html) but there is no info how to convert between those units...
lewyturn
20th February 2022, 13:26
How to use this function 'vscomp.comp'. can anyone help me with an example?
DJATOM
20th February 2022, 15:19
How does one convert a framenumber to a "audio sample unit"?
Trying to to use std.AudioTrim to match std.Trim for some video cutting.
I already checked the docs (http://www.vapoursynth.com/doc/functions/audio/audiotrim.html) but there is no info how to convert between those units...
I think it's accurate enough
samples_per_video_frame = sample_rate / 24000 * 1001 (fps)
audio_sample_position = video_frame * samples_per_video_frame
mastrboy
21st February 2022, 00:50
I think it's accurate enough
samples_per_video_frame = sample_rate / 24000 * 1001 (fps)
audio_sample_position = video_frame * samples_per_video_frame
Thanks, you got me on the right track:
samples_per_video_frame = audio.sample_rate / video.fps.numerator * video.fps.denominator
audio_trim_start = trim_start * samples_per_video_frame
audio_trim_end = trim_end * samples_per_video_frame
It's a weird default unit for a mainly video editing tool though...
Would love to see something like a "unit_type" parameter to choose between frames and audio samplerate, would be easier for python noobs like myself.
DJATOM
21st February 2022, 08:23
No, there's a reason to trim on sample positions. Audio and video isn't interleaved, also you cant reliably trim vfr video with audio (it requires evaluation of entire video clip).
mastrboy
6th March 2022, 17:09
Is it possible to get the framenumber to audio sample unit calculation more "accurate" ?
I'm not getting the same result when comparing the same trimmed audio between Vapoursynth and Avisynth.
Vapoursynth audio after trim: 00:23:31.535
Avisynth audio after trim: 00:23:31.576
A 41ms difference, this ends up being noticeable during video playback when using multiple trims unfortunately.
tebasuna51
7th March 2022, 01:29
I'm not getting the same result when comparing the same trimmed audio between Vapoursynth and Avisynth.
Maybe because an AviSynth Trim go from the begining of first frame to the end of last frame?
mastrboy
8th March 2022, 00:38
Maybe because an AviSynth Trim go from the begining of first frame to the end of last frame?
Might be, I think I found audiotrim function for avisynth:
https://github.com/AviSynth/AviSynthPlus/blob/master/avs_core/filters/edit.cpp#L124
If that is the correct one, it does a lot more than the few python lines I used.
Unfortunately I don't know enough c++ and python to port that over to a vapoursynth function.
I'll just stick with audio work in avisynth until someone writes a more userfriendly wrapper function for trimming audio in vapoursynth.
Selur
10th March 2022, 17:25
Is there a Vapoursynth alternative to Avisynths 'UnDot' filter?
Myrsloik
10th March 2022, 17:46
Is there a Vapoursynth alternative to Avisynths 'UnDot' filter?
UnDot is equivalent to one of the removegrain modes since it's a simple median like thing. I think it's mode 1.
Selur
10th March 2022, 18:07
okay, thanks. :)
Selur
13th March 2022, 15:41
When using:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV.dll")
# source: 'C:\Users\Selur\Desktop\C0561.MP4'
# current color space: YUV420P8, bit depth: 8, resolution: 3840x2160, fps: 25, color matrix: 2020cl, yuv luminance scale: full, scanorder: progressive
# Loading C:\Users\Selur\Desktop\C0561.MP4 using DGSource
clip = core.dgdecodenv.DGSource("E:/Temp/mp4_ea827f2d745535e110d775a539fd1cdd_853323747.dgi")
# Setting color matrix to 2020cl.
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=10)
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=9)
clip = core.std.SetFrameProps(clip, _Matrix=10)
# Setting color range to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
and opening it in https://github.com/YomikoR/VapourSynth-Editor
I get:
Error on frame 0 request:
Resize error: Resize error 3074: invalid colorspace definition (10/2/2 => 0/2/2). May need to specify additional colorspace parameters.
which is cause by
clip = core.std.SetFrameProps(clip, _Matrix=10).
first I thought I used the wrong Matrix value, but looking at http://www.vapoursynth.com/doc/functions/video/resize.html and then https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.265-201612-S!!PDF-E&type=items table E.5 then is correct for "Rec. ITU-R BT.2020-2 constant luminance system" (same indicated in https://github.com/UniversalAl/view/blob/02bbbd982b346d0131e479478ab9949690c4bf7b/view.py#L143)
Using:
VSPipe.exe -p c:\Users\Selur\Desktop\testing.vpy e:\test.y4m
an output file is created, but ffplay reports:
[yuv4mpegpipe @ 0000023b56629440] Format yuv4mpegpipe detected only with low score of 1, misdetection possible!
[yuv4mpegpipe @ 0000023b56629440] Header too large.
and MediaInfo only reports:
General
Complete name : e:\test.y4m
File size : 8.20 GiB
using:
VSPipe.exe c:\Users\Selur\Desktop\testing.vpy -c y4m | i:\Hybrid\64bit\x264.exe --demuxer y4m -o e:\test.mkv -
gives me:
y4m [error]: bad sequence header magic
x264 [error]: could not open input file `-'
I'm using:
VapourSynth Video Processing Library
Copyright (c) 2012-2021 Fredrik Mellbin
Core R57
API R4.0
API R3.6
Options: -
I just tested 'clip = core.std.SetFrameProps(clip, _Matrix=9)' and get a preview.
-> Any idea what am I missing? Do I need to specify some additional info before setting '_Matrix' ? Shouldn't 2020cl(=10) work?
Cu Selur
Myrsloik
25th March 2022, 09:09
R58-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R58-RC1)
Will probably be realeased in a few days unless major bugs are found.
r58:
updated the supported python versions to 3.10 and 3.8
updated visual studio 2022 runtime version
updated projects to visual studio 2022
updated zimg to 3.0.4
fixed certain expressions failing to compile in expr filter
fixed averageframes not respecting scenechange property (sekrit-twc)
added bob filter (sekrit-twc)
added support for separable convolutions and optimized convolution in general (sekrit-twc)
fixed audionode get_frame() in python
enabled cache for nodes with no registered dependencies, this means nodes returned by getoutput won't need to manually have the cache enabled if they have no filter consumers
Yomiko
25th March 2022, 11:50
Could you please mention in the changelog that "prefer_props" is no more an argument of internal resizers? I'm sure people are going to ask because this breaks existing previewers.
Selur
25th March 2022, 16:28
I agree. Is there some overview somewhere what API-wise changed from R57 to R58?
Myrsloik
25th March 2022, 20:15
I agree. Is there some overview somewhere what API-wise changed from R57 to R58?
Nothing should have changed. Maybe I'll add back a dummy prefer_props argument to avoid breakage.
Selur
26th March 2022, 13:08
One thing that did change is that since Python 3.9 isn't supported all the ml based filters form HolyWu don't work any more. So anyone who uses them should not upgrade to Vapoursynth R58 just yet.
-> okay filters should work again when https://pypi.org/project/VapourSynth/#files get's updated. So probably when R58 final gets release. :)
@Myrsloik: Any update on an option to stop autoloading?
l33tmeatwad
31st March 2022, 22:13
Nothing should have changed. Maybe I'll add back a dummy prefer_props argument to avoid breakage.
That would be great to help support older systems that may not be able to update to the latest preview versions.
Myrsloik
1st April 2022, 13:50
One thing that did change is that since Python 3.9 isn't supported all the ml based filters form HolyWu don't work any more. So anyone who uses them should not upgrade to Vapoursynth R58 just yet.
-> okay filters should work again when https://pypi.org/project/VapourSynth/#files get's updated. So probably when R58 final gets release. :)
@Myrsloik: Any update on an option to stop autoloading?
Sure, it's called "use the portable version". Maybe another option will appear at some later date but not a high priority.
Selur
1st April 2022, 14:36
Sure, it's called "use the portable version". Maybe another option will appear at some later date but not a high priority.
Problem is I use a portable version in Hybrid, but folks sometimes also have installed a system wide version where they have dlls in that version that get autoloaded. Which results in users complaining about errors like:
vapoursynth.Error: Plugin D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll already loaded (com.Khanattila.KNLMeansCL) from D:/Programs/VapourSynth64Portable/VapourSynth64/vapoursynth64/plugins/KNLMeansCL.dll
To avoid these it would be nice to have a way to disable the autoloading inside the script. :)
Myrsloik
1st April 2022, 15:32
Problem is I use a portable version in Hybrid, but folks sometimes also have installed a system wide version where they have dlls in that version that get autoloaded. Which results in users complaining about errors like:
vapoursynth.Error: Plugin D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll already loaded (com.Khanattila.KNLMeansCL) from D:/Programs/VapourSynth64Portable/VapourSynth64/vapoursynth64/plugins/KNLMeansCL.dll
To avoid these it would be nice to have a way to disable the autoloading inside the script. :)
Or you could catch the exception and move on? If the user wants to override plugin versions you don't have to fail...
Selur
1st April 2022, 15:48
Sure I could write a wrapper which does a try&catch, but that really seems like a really ugly workaround and it would only lead to more confusion, because then you wouldn't know what file versions are loaded.
Would it may be possible to add an additional parameter to 'core.std.LoadPlugin' to change the default behaviour from 'throw error if dll is already loaded' to 'drop already loaded dll and use the one explicitly called' ?
(explicitly loaded libaries should trump out automatically loaded ones)
Cu Selur
_Al_
1st April 2022, 16:48
On occasions I experienced some problems too. Having installed vs and also many portable versions with different python and vs versions. Giving portable frozen versions to someone where user might load different DLL.
Reading Selur idea to "unload" dll if a conflict happens, and load portable dll, would it be possible to use ctypes as well? Like here:
https://stackoverflow.com/questions/19547084/can-i-explicitly-close-a-ctypes-cdll
windows:
file = ctypes.CDLL('file.dll')
handle = file._handle
windll.kernel32.FreeLibrary(handle)
or linux:
file = CDLL('./file.so')
handle = file._handle
cdll.LoadLibrary('libdl.so').dlclose(handle)
Not sure where windll and cdll comes from, are they ctype modules? Upper or lower case could be used?
Even if it worked it introduces os dependancy so vs solution to "unload" might be the best. But only if it sort of knows what dlls are to be loaded beforehand. Because if already loaded, would vs have to deal with this also depending on operating system?
So a choice not to load dll's explicitly by vs seams like a solution.
_Al_
1st April 2022, 17:07
this has more details too: https://stackoverflow.com/questions/359498/how-can-i-unload-a-dll-using-ctypes-in-python
in the middle of page there are examples for win, linux, darwin, msys, cygwin, freeBSD
EDIT: fixed the link
Selur
1st April 2022, 17:17
@_AI_: that link doesn't work,...
Myrsloik
1st April 2022, 17:21
R58-RC2 (https://github.com/vapoursynth/vapoursynth/releases/tag/R58-RC2)
Adds a dummy prefer_props argument. Test so it actually fixinates things.
Selur
13th April 2022, 18:53
Thanks for R58. :)
https://github.com/vapoursynth/vapoursynth/releases/tag/R58
Cu Selur
Ps.: btw. who updates the version over at https://pypi.org/search/?q=Vapoursynth&o= ?
l33tmeatwad
14th April 2022, 18:29
So I've stumbled upon an issue I didn't realize was there for macOS, apparently R55+ will crash when using subtext. So the few tests I did revealed the lib that works in R54 hard crashes on R55+, and compiling from the new respiratory doesn't give any different results. I'm using static libs for the dependencies and I'm going to test with shared libs sometime next week, but I was just curious if there was some change in R55 they would have completely broke it. It appears it's saying it's missing calls from freetype, however this was not an issue on R54 with the same lib.
Myrsloik
14th April 2022, 19:45
So I've stumbled upon an issue I didn't realize was there for macOS, apparently R55+ will crash when using subtext. So the few tests I did revealed the lib that works in R54 hard crashes on R55+, and compiling from the new respiratory doesn't give any different results. I'm using static libs for the dependencies and I'm going to test with shared libs sometime next week, but I was just curious if there was some change in R55 they would have completely broke it. It appears it's saying it's missing calls from freetype, however this was not an issue on R54 with the same lib.
Try to get something out of gdb. I'm curious where things go wrong exactly. The code itself has very little changes from when it was a part of the main repo so it shouldn't affect anything.
l33tmeatwad
14th April 2022, 21:03
I'll see what I can find out when I get the chance next week, and just to be clear, the lib from R54 crashes too with VapourSynth R55+, but still works fine with R54.
ChaosKing
19th April 2022, 09:29
Are there offical doc pages somewhere available for the former included plugins like subtext? http://www.vapoursynth.com/doc/plugins/subtext.html
Or is this now the offical "doc page"? https://github.com/vapoursynth/subtext/blob/master/docs/subtext.rst
Myrsloik
19th April 2022, 10:11
Are there offical doc pages somewhere available for the former included plugins like subtext? http://www.vapoursynth.com/doc/plugins/subtext.html
Or is this now the offical "doc page"? https://github.com/vapoursynth/subtext/blob/master/docs/subtext.rst
That is indeed the most official page. I should set it up to generate a proper html again some day.
Selur
19th April 2022, 16:46
btw.: does anyone have an idea when Vapoursynth R58 will be available through pip?
Myrsloik
19th April 2022, 22:40
btw.: does anyone have an idea when Vapoursynth R58 will be available through pip?
The current packager no longer has a windows computer and effectively quit.
Write your application for the position below the line.
-----------------------------------------------------------
Selur
20th April 2022, 04:03
The current packager no longer has a windows computer and effectively quit.
Thanks for the info. :)
sofakng
27th April 2022, 19:18
Does VapourSynth depend on memory (RAM) speed? I'm having issues with extremely large videos (6K-8K). They are choppy when playback is started but then it smooths out.
However, it also heavily stutters using interpolation (SVP/RIFE) but I'm seeing low CPU/GPU usage so I'm thinking it might be RAM related?
Myrsloik
27th April 2022, 20:38
Does VapourSynth depend on memory (RAM) speed? I'm having issues with extremely large videos (6K-8K). They are choppy when playback is started but then it smooths out.
However, it also heavily stutters using interpolation (SVP/RIFE) but I'm seeing low CPU/GPU usage so I'm thinking it might be RAM related?
Yes, it's extremely dependent on ram bandwidth for 4k+ resolutions.
sofakng
27th April 2022, 21:18
Is there a benchmark that I can run or how can I determine what speed is required?
For example, I'm on an i7-8700k (5.0 GHz) and the RAM is 32GB (8GBx4) but it's DDR4 at 3200 MHz. I can upgrade to DDR4 4133 MHz but I'm not sure if that is enough or if I need DDR5 (and a new motherboard/cpu, etc).
(Also, I think my issue might not be related to RAM [I've posted an issue on the VapourSynth GitHub] but I'm still interested in RAM requirements, etc)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.