View Full Version : Vapoursynth
Selur
18th April 2018, 16:49
I have 16gb of ram.
+
with core.max_cache_size = 32768
this seems strange,...
Boulder
19th April 2018, 17:24
I did some tests on a Blu-ray source with my usual script to denoise and downsize to 720p, 2000 frames from the middle:
v44-test1, cache 32768:
Large pages - 10,74 fps
No large pages - 11,06 fps
v43
cache 32768 - 11,02 fps
default cache - 10,02 fps
So no use for me, but the cache size needs to be increased - so thanks for that tip :) I have 16 GB of memory and an AMD Ryzen 1800X system.
Selur
21st April 2018, 08:10
Still a bit confused about max_cache_size.
max_cache_size
Set the upper framebuffer cache size after which memory is aggressively freed. The value is in megabytes.
set_max_cache_size(mb)
Deprecated, use max_cache_size instead.
so since max cache size is in MB and you have 16GB why set it to 32768 = 32GB, shouldn't your 16GB (- normal system memory usage) of RAM be the largest value one should set and not twice the available RAM or am I missing something?
foxyshadis
25th April 2018, 16:34
Still a bit confused about max_cache_size.
so since max cache size is in MB and you have 16GB why set it to 32768 = 32GB, shouldn't your 16GB (- normal system memory usage) of RAM be the largest value one should set and not twice the available RAM or am I missing something?
It's a workaround for large pages in the current version only. If you aren't interested in large pages right now, or you're worried about a filter sucking up all of the cache, don't touch it.
DJATOM
25th April 2018, 16:52
I found a bug. Well, not sure if that's really a bug, but might be unwanted behaviour of resizer.
Nowadays almost all anime blu-rays are upscales. I'd like to fight such upscales downscaling to original resolution using the mixed Descale and Spline36 clip, upscale back with eedi3 and merge it with source clip using lines mask.
Today my friend noticed slight shift in the source/AA comparisons. I tried to debug my script and found that resizer is just copying clip instead of fixing eedi3 shift. In that case 1920x1080 clip was downscaled to 960x540 and upscaled back (so we got 1920x1080 after eedi3 stuff).
As I understand, vapoursynth (zimg) resizer is just copying clip if input width and height matches with output. That might be unwanted if cropping options is set.
On my opinion resizer should check for crop options and do proper resizing in that case.
Selur
25th April 2018, 17:43
@foxyshadis: I get what max_cache_size is meant to do, what I don't get is why setting it to two times your RAM size is the right thing.
Boulder
25th April 2018, 18:25
@foxyshadis: I get what max_cache_size is meant to do, what I don't get is why setting it to two times your RAM size is the right thing.
It's really not. It can easily eat all the RAM you have when the script is initialized and it takes quite a lot of time for VS to release the excess memory so your computer is pretty much frozen. I've settled down for 10240 on my 16 GB system as I can just manage that with BD to 720p encodes.
DJATOM
26th April 2018, 10:00
You probably need to provide an script to demonstrate what you really do, if you want the developers to resolve your doubts.
Okay. Script below is just stripped version to reproduce my problem.
import havsfunc as haf
import mvsfunc as mvf
import descale as dsc
clip = <some 1920x1080 clip>
descale_str = 0.32
kernel = 'bicubic'
descale_h = 540 # 1080/2 to reproduce the problem
w = clip.width
h = clip.height
descale_w = haf.m4((w * descale_h) / h)
descale_natural = dsc.Descale(clip, descale_w, descale_h, kernel=kernel)
descale_aa = core.resize.Spline36(clip, descale_w, descale_h)
descaled = core.std.Merge(clipb=descale_natural, clipa=descale_aa, weight=descale_str)
dx = w
dy = h
ux = descale_w * 2
uy = descale_h * 2
rescale = core.eedi3m.EEDI3(descaled, field=1, dh=True, alpha=0.2, beta=0.25, gamma=1000.0, vcheck=3, sclip=core.znedi3.nnedi3(descaled, field=1, dh=True, nsize=0, nns=4, pscrn=1))
rescale = core.std.Transpose(clip=rescale)
rescale = core.eedi3m.EEDI3(rescale, field=1, dh=True, alpha=0.2, beta=0.25, gamma=1000.0, vcheck=3, sclip=core.znedi3.nnedi3(rescale, field=1, dh=True, nsize=0, nns=4, pscrn=1))
rescale = core.std.Transpose(clip=rescale)
#rescale = core.fmtc.resample(rescale, dx, dy, -0.5, -0.5, ux, uy, kernel='spline36').fmtc.bitdepth(bits=8) # always fixes eedi3 shift, but I need to call bitdepth function, that's not convenient.
rescale = core.resize.Spline36(rescale, dx, dy, src_left=-0.5, src_top=-0.5, src_width=ux, src_height=uy) # leaves eedi3 shift untouched if rescale clip's width and height matches the source.
ChaosKing
26th April 2018, 11:16
You could also use edi_rpow2.py https://gist.github.com/YamashitaRen/020c497524e794779d9c (or just copy the shifting code)
DJATOM
26th April 2018, 11:50
You could also use edi_rpow2.py https://gist.github.com/YamashitaRen/020c497524e794779d9c (or just copy the shifting code)
zimg way is most likely broken, I didn't checked.
Y=core.std.ShufflePlanes(clips=clip, planes=0, colorfamily=vs.GRAY)
Y=core.resize.Spline36(clip=Y,width=clip.width,height=clip.height,src_left=hshift,src_top=-0.5)
clip.width = Y.width, clip.height = Y.height, so resizer is just copying whole plane without doing the job. Another planes should be fixed if colorspace is not YUV444.
hydra3333
28th April 2018, 02:49
Yay, vapoursynth ffmpeg integration seems to be in its way.
http://ffmpeg.org/pipermail/ffmpeg-devel/2018-April/229137.html
I also hold some hope for "for dummies" vapoursynth library build instructions leading to building of a static ffmpeg.exe (including python libs and any other dependencies) ...
Selur
28th April 2018, 06:57
... leading to building of a static ffmpeg.exe (including python libs and any other dependencies) ...
I highly doubt that will happen, since you would probably need to include a whole Python portable environment (or at least a huge portion of it).
To open .vpy-scripts you at least some sort of a Python (runtime) environment.
Cu Selur
Ps.: To open .avs-scripts you need the avisynth.dll (and dependencies).
hydra3333
28th April 2018, 07:05
Ah. I'd hoped, since youtube-dl manages to do it resulting in a standalone .exe ...
For some, unless maybe it could use vapoursynth portable in the same folder, non-static would be as useful as teats on a bull :)
Selur
28th April 2018, 07:26
Ah. I'd hoped, since youtube-dl manages to do it resulting in a standalone .exe ...
youtube-dl isn't statically compiled it seems to wrap all the dependencies it requires.
Yes once could also wrap a whole hdd this way and create one large binary, but that isn't statically compiling that is basically the same thing Mac does with it's .app files.
(Provide mostly standalone packages which are basically a folder structure which contains dependencies&co.)
Cu Selur
ChaosKing
30th April 2018, 00:36
Is it possible to compare the value of f.props.PlaneStatsAverage in a FrameEval function with the previous and the next frame (n-1 and n+1)? Sould I use get_frame_async() for that?
def g(n, f, clip, d_clip):
clip=clip.text.Text("current: "+ f.props.PlaneStatsAverage)
clip=clip.text.Text("\nPrev: "+ ???)
clip=clip.text.Text("\n\nNext: "+ ???)
return clip
clip = clip.std.FrameEval(functools.partial(g, d_clip=d_clip, clip=clip), prop_src=x)
Edit
This works but feels more like a hack.
x= clip.std.PlaneStats()
x1= clip.std.PlaneStats().std.DuplicateFrames(0) #prev
x2= clip.std.PlaneStats().std.Trim(1) #next
clip = clip.std.FrameEval(functools.partial(g, d_clip=d_clip, clip=clip), prop_src=[x, x1, x2])
amayra
1st May 2018, 22:39
Python development mode
A new command-line switch for the Python interpreter, -X, lets the developer set a number of low-level options for the interpreter. With Python 3.7, the option -X dev enables “development mode,” a slew of runtime checks that normally have a big impact on performance, but are useful for a developer during the debugging process
as vapoursynth user is this benefits me ?
Myrsloik
1st May 2018, 22:44
Is it possible to compare the value of f.props.PlaneStatsAverage in a FrameEval function with the previous and the next frame (n-1 and n+1)? Sould I use get_frame_async() for that?
def g(n, f, clip, d_clip):
clip=clip.text.Text("current: "+ f.props.PlaneStatsAverage)
clip=clip.text.Text("\nPrev: "+ ???)
clip=clip.text.Text("\n\nNext: "+ ???)
return clip
clip = clip.std.FrameEval(functools.partial(g, d_clip=d_clip, clip=clip), prop_src=x)
Edit
This works but feels more like a hack.
x= clip.std.PlaneStats()
x1= clip.std.PlaneStats().std.DuplicateFrames(0) #prev
x2= clip.std.PlaneStats().std.Trim(1) #next
clip = clip.std.FrameEval(functools.partial(g, d_clip=d_clip, clip=clip), prop_src=[x, x1, x2])
That's the right way.
@ amayra:
Users will probably not benefit directly from debugging switches, because users will usually prefer the fastest possible execution. You may have read that these additional runtime checks will "have a big impact on performance" (see your quote), which means that it will run a lot slower and report a lot of warnings, even of less probable conditions.
But if a developer can use this mode to discover risky code and fix bugs (possibly even before they cause noticeable issues), then users may benefit indirectly from an advanced release build.
ChaosKing
2nd May 2018, 14:16
@Myrsloik
Ok, thx.
I found a strange behaviour while playing with FrameEval func.
The very same function gives different output if it's called within FrameEval.
Is it a bug or did I miss something?
Here's an animated gif of my problem (correct output is in the middle):
https://i.imgur.com/r2pqEj9.gif
And my script (You'll need also Single Precision MVTools https://github.com/IFeelBloated/vapoursynth-mvtools-sf):
import sys
import os
import functools
import vapoursynth as vs
import mvsfunc as mvf #https://github.com/HomeOfVapourSynthEvolution/mvsfunc/blob/master/mvsfunc.py
import havsfunc as haf
import mvmulti as mv #https://github.com/IFeelBloated/vapoursynth-mvtools-sf/blob/master/src/mvmulti.py
import fvsfunc as fvf #https://github.com/Irrational-Encoding-Wizardry/fvsfunc/blob/master/fvsfunc.py
core = vs.get_core()
def myFilter(clip):
pre = haf.SMDegrain(clip, tr=2, pel=2, contrasharp=False, thSAD = 1200, thSADC = 1200, prefilter=2)
pre = pre.flux.SmoothT(temporal_threshold=6)
pre = haf.DitherLumaRebuild(pre, s0=1)
pre = fvf.Depth(pre, 32, range_in=1)
clip = mvf.Depth(clip, 32)
super = core.mvsf.Super(pre,16,16,1,0)
vectors = mv.Analyze(super, blksize=16, overlap=8, search=4, tr=6)
super = core.mvsf.Super(clip,16,16,1,1)
blur_clip = mv.DegrainN(clip, super, vectors, thsad=600, tr=6)
grain = blur_clip.grain.Add(var=1200.0, constant=True)#.std.BoxBlur(hradius=1, hpasses=1, vradius=1, vpasses=1)
#return grain
diff_clip = core.std.Expr([clip, blur_clip], '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=blur_clip, clipb=grain, mask=mask_clip)
return mvf.Depth(clip, 8)
clip = core.std.BlankClip(format=vs.YUV420P8, width=120*2, height=80*2, length=100, color=[206,235,135])
g_static = clip.grain.Add(var=100.0, constant=True)
g_dynamic = clip.grain.Add(var=100.0, constant=False)
clip = core.std.StackHorizontal([
core.std.StackVertical([g_static, g_static]),
core.std.StackVertical([g_static, g_dynamic])
])
goal = core.std.StackHorizontal([
core.std.StackVertical([g_static, g_static]),
core.std.StackVertical([g_static, g_static])
])
orig=clip
def asd(n, c):
return myFilter(c)
feval = clip.std.FrameEval(functools.partial(asd, c=clip))
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), \
])
nofeval = myFilter(clip)
clip = comp(feval.text.Text("Function inside FrameEval").std.AddBorders(right=2), nofeval.text.Text("No FrameEval").std.AddBorders(right=2), crop=0)
clip = comp(clip, orig.text.Text("unfiltered"), crop=0)
clip.set_output()
Myrsloik
2nd May 2018, 14:22
@Myrsloik
Ok, thx.
I found a strange behaviour while playing with FrameEval func.
The same function gives different output if it's called within FrameEval.
Is it a bug or did I miss something?
Here's a animated gif of my problem (correct output is in the middle):
https://i.imgur.com/r2pqEj9.gif
And my script (You'll need also Single Precision MVTools https://github.com/IFeelBloated/vapoursynth-mvtools-sf):
...
Should be identical in theory, yes. Unless some filter stores temporal state incorrectly. Then you get this. Gradually remove each filter and see when the output is once again identical, then report which filter it was. I'm going to bet mvtools or fluxsmooth right away.
ChaosKing
2nd May 2018, 14:31
Seems it only happens if mvtools-sf is in the filter chain.
Edit:
Is there a way (hack) to avoid this problem without modifying mvtools? I mean except putting it outside of FrameEval, bcs it's very slow and I need it only for many short scenes.
I will report this bug to feisty2 but who knows when and if he's gonna fix it.
ChaosKing
2nd May 2018, 15:39
Generally I don't recommend invoking filters within FrameEval unless unavoidable, because that introduces extra overhead.
from vapoursynth import core
import vapoursynth as vs
import functools
def frame_eval(n, clip):
return core.misc.AverageFrames(clip, weights=[1] * 5)
clip = core.std.BlankClip(width=720, height=480, format=vs.YUV420P8, length=10000)
#clip = core.misc.AverageFrames(clip, weights=[1] * 5)
# I get 1014.60 fps
#clip = core.std.FrameEval(clip, functools.partial(frame_eval, clip=clip))
# I get 566.09 fps
clip.set_output()
You should assign the filtered result to a variable outside FrameEval and then pass it in via functools.partial() as additional argument if possible.
Why didn't I think of that... it works perfectly. :thanks:
ChaosKing
2nd May 2018, 16:45
I get the same speed up ~3x with your script. But what kind of cpu do you have to get 3000fps? My Ryzen 1700 8core @3.6ghz gets only half of that (VS R43)
Myrsloik
5th May 2018, 18:27
R44-test2 (https://www.dropbox.com/s/r2b3pnhfsw452zy/VapourSynth-R44-test2.exe?dl=1)
More large page fixes and updated zimg. Test again because this will probably work better.
WINDOWS 10 APRIL UPDATE IS REQUIRED FOR PROPER LARGE PAGE TESTING
I forgot to mention that the cache logic has been improved so settings max memory usage to yuuuuuge numbers shouldn't be necessary anymore.
ChaosKing
5th May 2018, 23:55
Yep, I get the same speed (64-65fps, 4fps more than test1) with and without core.max_cache_size = 32768, cpu @ 99%, April 1803 update is installed.
With no max_cache set this is shown: Script exceeded memory limit. Consider raising cache size.
Boulder
7th May 2018, 16:31
Did something break with the Windows 10 April 1803 update? I'm unable to load KNLMeansCL anymore; the plugin has been in the plugins64 folder all the time and now VSEdit is saying "AttributeError: No attribute with the name knlm exists. Did you mistype a plugin namespace?"
import vapoursynth as vs
core = vs.get_core()
clp = core.dgdecodenv.DGSource(r'C:\Temp\testclip.dgi')
clp = core.knlm.KNLMeansCL(clp)
clp.set_output()
DJATOM
7th May 2018, 16:39
Check if your video drivers properly installed... Massive updates usually breaks things for me.
Boulder
7th May 2018, 16:41
Check if your video drivers properly installed... Massive updates usually breaks things for me.
Yes, just found out that the stupid update rendered the graphics card useless and the NVIDIA driver package didn't even find an older version from the computer. Because I don't play games with the computer, I never noticed until now.
:sly::mad:
Boulder
7th May 2018, 17:13
With no max_cache set this is shown: Script exceeded memory limit. Consider raising cache size.
I get this message with a 1080p source and some MVTools-based denoising + contrasharpening and advanced downsizing stuff in the script. I've tried setting the cache at 12000 but at some point the warning appears in the encoder log. Of course, with that value being so high (I have 16 GB of memory), the computer ends up swapping a lot so I need to tune it back to 10240 or so.
After some time, the memory usage of the vspipe process goes down to 3-4 GB of memory and stays there until the end. Does it mean that it's actually not useful to set a high value to start the encoding with?
EDIT: Except that with r44t2, the memory usage stays high all the time.
Side info...
MABS is supposed to be able to build ffmpeg with VapourSynth support (for video filtering, like in mpv, IIRC). But it is important to know: If you build ffmpeg with VS support, VS also becomes a requirement to even start this specific ffmpeg build, it won't run on a PC where VS is not installed.
So I doubt I would provide such a build, as I won't need it for this kind of usage.
Myrsloik
7th May 2018, 20:19
I get this message with a 1080p source and some MVTools-based denoising + contrasharpening and advanced downsizing stuff in the script. I've tried setting the cache at 12000 but at some point the warning appears in the encoder log. Of course, with that value being so high (I have 16 GB of memory), the computer ends up swapping a lot so I need to tune it back to 10240 or so.
After some time, the memory usage of the vspipe process goes down to 3-4 GB of memory and stays there until the end. Does it mean that it's actually not useful to set a high value to start the encoding with?
EDIT: Except that with r44t2, the memory usage stays high all the time.
Basically the logic is closer to Avisynth behavior now. All leftover memory is used for recycled framebuffers. I have some ideas on how to improve things later. I don't think it's ideal but it does improve another corner case a lot... But if it stops at such a low total memory usage you can set it lower to begin with and it won't cause any problems.
Pat357
18th May 2018, 23:46
Side info...
MABS is supposed to be able to build ffmpeg with VapourSynth support (for video filtering, like in mpv, IIRC). But it is important to know: If you build ffmpeg with VS support, VS also becomes a requirement to even start this specific ffmpeg build, it won't run on a PC where VS is not installed.
So I doubt I would provide such a build, as I won't need it for this kind of usage.
Appearently can ffmpeg with --enable vapoursynth be build that it will run also without any VS installed. This is done by building everything as static and load the stuff as delayed import.
The guys here build a binary ffmpeg this way (with gcc) and this version, unlike many other builds (ie the media-suite version) works very well.
The build from media-suite needs indeed that VS is installed, but even then I can't make it output any video from a valid VPY script.
See https://forum.doom9.org/showthread.php?t=175341
Supporting VS optionally when the environment is available ... that will be much more interesting. :cool:
lansing
21st May 2018, 20:10
I'm wondering can vapoursynth read color value in hex?
foxyshadis
22nd May 2018, 01:14
Color is only ever read as a Python list of each value per plane. There's nothing keeping you from implementing a convenience function, however, like:
def Hex2List(colorhex):
digits = math.ceil(colorhex ** (1/16.))
colorlist = []
for plane in range(0,digits):
colorlist.insert(0, colorhex % 256)
colorhex = colorhex // 256
return colorlist
And calling it as Hex2List(0x778899).
You can always use an actual list like [0x77, 0x88, 0x99], so the value of this convenience is questionable.
lansing
22nd May 2018, 02:32
Color is only ever read as a Python list of each value per plane. There's nothing keeping you from implementing a convenience function, however, like:
def Hex2List(colorhex):
digits = math.ceil(colorhex ** (1/16.))
colorlist = []
for plane in range(0,digits):
colorlist.append(colorhex % 256)
colorhex = colorhex // 256
return colorlist
And calling it as Hex2List(0x778899).
You can always use an actual list like [0x77, 0x88, 0x99], so the value of this convenience is questionable.
I'm talking about things like using it in blankclip like this, instead of the longer rgb value.
clip = core.std.BlankClip(color="#ffffff")
foxyshadis
22nd May 2018, 04:57
I'm talking about things like using it in blankclip like this, instead of the longer rgb value.
clip = core.std.BlankClip(color="#ffffff")
Is BlankClip(color=[0xff, 0xff, 0xff]) that much harder? If it is, use that convenience function in my last post.
lansing
22nd May 2018, 05:23
Is BlankClip(color=[0xff, 0xff, 0xff]) that much harder? If it is, use that convenience function in my last post.
I will need to load in a bunch of color, so the shorter the representation the better.
And Hex2List(0x778899) and [0x77, 0x88, 0x99] give me different color.
foxyshadis
22nd May 2018, 07:15
Whoops, edited. I forgot to test. If you're going to get a lot of use out of it, might as well rename it H2L or something.
lansing
22nd May 2018, 08:43
Thanks foxyshadis and Holy, the function works now
Pat357
25th May 2018, 14:31
Supporting VS optionally when the environment is available ... that will be much more interesting. :cool:
That's exactly what I mean !
See https://forum.doom9.org/showthread.php?p=1840628#post1840628
See here for proof : HolyWu compiled a ffmpeg binary (https://forum.doom9.org/showthread.php?p=1840663#post1840663)
He has also given a way how to create such binary :
https://forum.doom9.org/showthread.php?p=1840703#post1840703
Or read the whole thread (only 2 pages) at
https://forum.doom9.org/showthread.php?t=175341
I hope this makes you reconsider building ffmpeg with --enable-vapoursynth, because it works for all : VS installed, portable VS and without any VS.
Selur
26th May 2018, 11:17
Got a small question, since my Vapoursynth/Python understanding is lacking. :/
I got the following script:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/Imagemagick/libimwri.dll")
# Import scripts
import havsfunc
import mvsfunc
# Loading C:\Users\Selur\Desktop\Image sequence\%02d.png using vsImageReader
clip = core.imwri.Read("C:/Users/Selur/Desktop/Image sequence/%02d.png", firstnum=1)
clip = core.std.Trim(clip=clip, length=30)
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Making sure input color range is set to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
original = clip
# line darkening using Toon
# adjusting color space from RGB24 to YUV444P16 for VsToon
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="709")
clip = havsfunc.Toon(input=clip)
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8)
# adjusting for FilterView; original is RGB24 and clip is YUV420P8
if original.format.id != clip.format.id:
if (original.format.id == vs.RGB24 or original.format.id == vs.RGB32):
original = core.resize.Bicubic(original, format=clip.format.id,matrix_s="709",matrix_in_s="709")
else:
original = core.resize.Bicubic(original, format=clip.format.id,matrix_in_s="709")
clip = core.text.Text(clip,"Filtered")
original = core.text.Text(original,"Original")
interleaved = core.std.Interleave([clip, original])
# Output
interleaved.set_output()
Where I want to apply 'Toon' to the input and compare it to the original, but get:
Error getting the frame number 1:
Resize error 1026: RGB color family cannot have YUV matrix coefficients
I hoped that using the if-block would fix the issue.
-> How to fix this? + Is there a way to check if original.format.id is inside vs.RGB ?
Cu Selur
Myrsloik
26th May 2018, 11:26
Check the color_family property instead. It indicates rgb/yuv/gray. I suspect that's what you want
Selur
26th May 2018, 11:38
What I want is that in case the formats of original and clip differ, that original should be adjusted.
Since converting from RGB to YUV requires that matrix_s is specified I need some 'if'-block.
How to get the frame propery?
original.props['color_family']
doesn't work. :)
Selur
26th May 2018, 11:48
okay it's original.format.color_family.
Problem is:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/Imagemagick/libimwri.dll")
# Import scripts
import havsfunc
import mvsfunc
# Loading C:\Users\Selur\Desktop\Image sequence\%02d.png using vsImageReader
clip = core.imwri.Read("C:/Users/Selur/Desktop/Image sequence/%02d.png", firstnum=1)
clip = core.std.Trim(clip=clip, length=30)
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Making sure input color range is set to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
original = clip
# line darkening using Toon
# adjusting color space from RGB24 to YUV444P16 for VsToon
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="709")
clip = havsfunc.Toon(input=clip)
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8)
# adjusting for FilterView
if original.format.id != clip.format.id:
if (original.format.color_family == vs.RGB and clip.format.color_family != vs.RGB):
original = core.resize.Bicubic(original, format=clip.format.id,matrix_s="709",matrix_in_s="709")
elif (original.format.color_family == clip.format.color_family):
original = core.resize.Bicubic(original, format=clip.format.id)
else:
original = core.resize.Bicubic(original, format=clip.format.id,matrix_in_s="709")
clip = core.text.Text(clip,"Filtered")
original = core.text.Text(original,"Original")
interleaved = core.std.Interleave([clip, original])
# Output
interleaved.set_output()
sill causes the error.
Error getting the frame number 1:
Resize error 1026: RGB color family cannot have YUV matrix coefficients
No clue where the problem is.
I thought this should do the conversion and not add YUV matrix to RGB.
Selur
26th May 2018, 23:37
Thanks a lot ! That helped.
Didn't know about mvsfuncs Preview function.
Cu Selur
Guys i got an error with some scripts
Failed to evaluate the script:
Python exception: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte (mvsfunc.py, line 1267)
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1847, in vapoursynth.vpy_evaluateScript
File "C:/Users/G_N-A/Desktop/VapourSynthEditor-r16-64bit/Untitled.vpy", line 4, in
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\fvsfunc.py", line 4, in
import havsfunc as haf # https://github.com/HomeOfVapourSynthEvolution/havsfunc
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\havsfunc.py", line 2, in
import mvsfunc as mvf
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\mvsfunc.py", line 1267
"""
^
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte
I have python-3.6.5-64 & VapourSynth-R43-64, and I have attached 3 scripts that showing in the error message.
any help!
lansing
30th May 2018, 15:53
Guys i got an error with some scripts
I have python-3.6.5-64 & VapourSynth-R43-64, and I have attached 3 scripts that showing in the error message.
any help!
You haven't put anything inside the double quotation.
You haven't put anything inside the double quotation.
I didn't get you!
this what inside the double quotation, the error message .
Failed to evaluate the script:
Python exception: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte (mvsfunc.py, line 1267)
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1847, in
vapoursynth.vpy_evaluateScript
File "C:/Users/G_N-A/Desktop/VapourSynthEditor-r16-64bit/Untitled.vpy", line 4, in
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\fvsfunc.py", line 4, in
import havsfunc as haf # https://github.com/HomeOfVapourSynthEvolution/havsfunc
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\havsfunc.py", line 2, in
import mvsfunc as mvf
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\mvsfunc.py", line 1267
"""
^
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte
Boulder
30th May 2018, 17:08
Have you checked that the file mvsfunc.py is not broken? I.e. open it in Notepad++ and see what that line shows.
lansing
30th May 2018, 17:08
I didn't get you!
this what inside the double quotation, the error message .
:script:
Have you checked that the file mvsfunc.py is not broken? I.e. open it in Notepad++ and see what that line shows.
One of the scripts was broken, and the second one was in ANSI encoding so i change it to UTF-8
thank you every one :thanks:
Back :rolleyes:
I got another an error
Failed to evaluate the script:
Python exception: module 'mvsfunc' has no attribute 'Depth'
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1847, in vapoursynth.vpy_evaluateScript
File "/XXXXX/Desktop/VapourSynthEditor-r16-64bit/Untitled.vpy", line 9, in
AttributeError: module 'mvsfunc' has no attribute 'Depth'
Boulder
31st May 2018, 09:42
Did you try the latest version of mvsfunc? That file of yours doesn't have that function that is being called.
Did you try the latest version of mvsfunc? That file of yours doesn't have that function that is being called.
You're right, it works now thanx =)
Guys one more question, I just try to use the portable ver of VSynth
VSynth library paths should direct to python lib or what?
& VP plugins paths should direct to plugins of VSynth (plugins64) right?
No need for bold face.
You mean the "portable" version (without installing Python into the system)?
And again, again, and again (Groundhog day): Prefer external image hosts over attaching images in the forum, because it takes time for a moderator to approve them.
No need for bold face.
You mean the "portable" version (without installing Python into the system)?
And again, again, and again (Groundhog day): Prefer external image hosts over attaching images in the forum, because it takes time for a moderator to approve them.
I just edited it and yes I mean portable version!
because it takes time for a moderator to approve them
I'm happy that you're not one of them.
anyway I think it's better to ask in "VapourSynth Editor" not here.
.
Selur
3rd June 2018, 18:09
Anyone got a download link to a up-to-date LSSMashSource dll for 64bit Vapoursynth ?
I tried to used IVTC but I got an error
script:
from vapoursynth import core
import vapoursynth as vs
core = vs.get_core()
src = core.d2v.Source('My.d2v')
src = src.vivtc.VFM().vivtc.VDecimate()
src.set_output()
error:
Failed to evaluate the script:
Python exception: VFM: argument order is required
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "C:/Users/Administrator/Desktop/encoder/Untitled.vpy", line 6, in
src.set_output()
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: VFM: argument order is required
-VapourSynthEditor-r18-64bit
-VapourSynth-R39
l33tmeatwad
8th June 2018, 15:05
-VapourSynthEditor-r18-64bit
-VapourSynth-R39
The first thing you may want to try updating VapourSynth, it's up to R43 now. Second, you'll want to specify order:
from vapoursynth import core
import vapoursynth as vs
core = vs.get_core()
src = core.d2v.Source('My.d2v')
src = src.vivtc.VFM(order=1).vivtc.VDecimate()
src.set_output()
Check your source to make sure you use the correct order.
Myrsloik
8th June 2018, 15:05
The first thing you may want to try updating VapourSynth, it's up to R43 now.
More like try reading the error message. You didn't set field ORDER.
l33tmeatwad
8th June 2018, 15:08
More like try reading the error message. You didn't set field ORDER.
Sorry, I accidentally hit submit as I was typing out my reply...
The first thing you may want to try updating VapourSynth, it's up to R43 now. Second, you'll want to specify order:
from vapoursynth import core
import vapoursynth as vs
core = vs.get_core()
src = core.d2v.Source('My.d2v')
src = src.vivtc.VFM(order=1).vivtc.VDecimate()
src.set_output()
Check your source to make sure you use the correct order.
I installed the last ver and I opened the file without
src = src.vivtc.VFM(order=1).vivtc.VDecimate()
but when i used it i got this error:
Failed to evaluate the script:
Python exception: VFM: argument order is required
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "C:/Users/Administrator/Desktop/encoder/Untitled.vpy", line 6, in
src.set_output()
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: VFM: argument order is required
Thanks l33tmeatwad for solving my issue =)
edcrfv94
10th June 2018, 13:04
I have a problem with VapourSynth Internal Resize use, but work fine with core.fmtc.resample.
Internal Resize result look like damaged.
VapourSynth Internal Resize
http://thumbs2.imagebam.com/48/b6/7d/4fa1cd891546834.jpg (http://www.imagebam.com/image/4fa1cd891546834)
haf.Resize(core.fmtc.resample)
http://thumbs2.imagebam.com/ad/72/15/87ab54891546814.jpg (http://www.imagebam.com/image/87ab54891546814)
example1:
test = core.resize.Bilinear(src8, 960, 540)
test = core.resize.Bilinear(test, 1920, 1080)
#Fixed
test = haf.Resize(src8, 960, 540, kernel="bilinear", noring=False)
test = haf.Resize(test, 1920, 1080, kernel="bilinear", noring=False)
example2:
def Padding(clip, left=0, right=0, top=0, bottom=0):
if not isinstance(clip, vs.VideoNode):
raise TypeError('Padding: This is not a clip')
if left < 0 or right < 0 or top < 0 or bottom < 0:
raise ValueError('Padding: border size to pad must not be negative')
return core.resize.Point(clip, clip.width + left + right, clip.height + top + bottom,
src_left=-left, src_top=-top, src_width=clip.width + left + right, src_height=clip.height + top + bottom)
#Fixed
def Padding(clip, left=0, right=0, top=0, bottom=0):
if not isinstance(clip, vs.VideoNode):
raise TypeError('Padding: This is not a clip')
if left < 0 or right < 0 or top < 0 or bottom < 0:
raise ValueError('Padding: border size to pad must not be negative')
src_w = clip.width
src_h = clip.height
return haf.Resize(clip, src_w + left + right, src_h + top + bottom, sx=-left, sy=-top, sw=src_w + left + right, sh=src_h + top + bottom, kernel="point", noring=False)
Padding(clip, left=8, right=8, top=8, bottom=8)
edcrfv94
11th June 2018, 06:49
Example1 is because your input is interlaced. Example2 is because the internal resizer uses a different border extension method from fmtc. You can use std.SetFieldBased (http://www.vapoursynth.com/doc/functions/setfieldbased.html) to force the input to be treated as progressive.
Thanks
Also VapourSynth Internal Resize src_left and src_top not working.
test = core.resize.Spline36(src8, 1920, 1080, src_left=0, src_top=-0.5)
Fixed
test = haf.Resize(src8, 1920, 1080, sx=0, sy=-0.5, kernel="spline36", noring=False)
or
test = core.fmtc.resample(src8, 1920, 1080, sx=0, sy=-0.5, kernel="spline36")
lansing
13th June 2018, 21:01
Color is only ever read as a Python list of each value per plane. There's nothing keeping you from implementing a convenience function, however, like:
def Hex2List(colorhex):
digits = math.ceil(colorhex ** (1/16.))
colorlist = []
for plane in range(0,digits):
colorlist.insert(0, colorhex % 256)
colorhex = colorhex // 256
return colorlist
And calling it as Hex2List(0x778899).
You can always use an actual list like [0x77, 0x88, 0x99], so the value of this convenience is questionable.
I have a follow-up issue with this. It works until I have a color hex like "000002"
color = "000002" # this doesn't work
#color = "53aadf" # this one works
hex_int = int(color, 16)
clip = core.std.BlankClip(width=patch_width, height=patch_width, length=1, color=Hex2List(hex_int))
It gives me an error "BlankClip: invalid number of color values specified".
Myrsloik
13th June 2018, 22:11
I have a follow-up issue with this. It works until I have a color hex like "000002"
color = "000002" # this doesn't work
#color = "53aadf" # this one works
hex_int = int(color, 16)
clip = core.std.BlankClip(width=patch_width, height=patch_width, length=1, color=Hex2List(hex_int))
It gives me an error "BlankClip: invalid number of color values specified".
Numbers starting with 0 are interpreted as octal numbers (base 8). If you always put a 0x in front you'll be fine or drop the leading zeroes.
lansing
14th June 2018, 02:24
After some searches I've found a 2 liner function for this in stackflow (https://stackoverflow.com/questions/214359/converting-hex-color-to-rgb-and-vice-versa)
def hex_to_rgb(value):
"""Return (red, green, blue) for the color given as #rrggbb."""
value = value.lstrip('#')
lv = len(value)
return list(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
hBIkOa7m
14th June 2018, 21:26
After some searches I've found a 2 liner function for this in stackflow (https://stackoverflow.com/questions/214359/converting-hex-color-to-rgb-and-vice-versa)
You do realise hexadecimal colours are already 0xRRGGBB? It's just stacked in base16 instead of split into a list of base10. You can just shift the input value to access the colour without any fancy stuff. Dumb example Python code.
input_hex = 0x53aadf
r = (input_hex >> 16) & 0xFF # 83
g = (input_hex >> 8) & 0xFF # 170
b = (input_hex >> 0) & 0xFF # 223
foxyshadis
14th June 2018, 21:45
After some searches I've found a 2 liner function for this in stackflow (https://stackoverflow.com/questions/214359/converting-hex-color-to-rgb-and-vice-versa)
def hex_to_rgb(value):
"""Return (red, green, blue) for the color given as #rrggbb."""
value = value.lstrip('#')
lv = len(value)
return list(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
Would you rather pass a string instead of a hex integer? OK, use that. You HAVE to pass a string though. It wouldn't be difficult to combine a way to pass string or integer, but it's not a 2-liner.
lansing
15th June 2018, 04:45
Would you rather pass a string instead of a hex integer? OK, use that. You HAVE to pass a string though. It wouldn't be difficult to combine a way to pass string or integer, but it's not a 2-liner.
It's good, I'm going to read the color from a text file, so they will be all strings.
ChaosKing
24th June 2018, 18:43
Is there a Despot script or plugin available for VS?
I tried this avs script by Didée http://forum.doom9.net/showthread.php?p=1402690#post1402690
which works good, but has problems with heavy motion / flashy scenes and produces sometimes ghosting. The two first problems can be compensated to some degree if used as a prefilter in smdegrain, but the ghosting problem remains.
Maybe someone knows an alternative or can improve this script?
def despot(o):
osup = o.mv.Super(pel=2, sharp=2)
bv1 = osup.mv.Analyse(isb=True, delta=1, blksize=8, overlap=4, search=4)
fv1 = osup.mv.Analyse(isb=False,delta=1, blksize=8, overlap=4, search=4)
bc1 = o.mv.Compensate(osup, bv1)
fc1 = o.mv.Compensate(osup, fv1)
clip = core.std.Interleave([fc1, o, bc1])
clip = core.rgvs.Clense(clip)
clip = core.std.SelectEvery(clip, cycle=3, offsets=1)
return clip
unix
29th June 2018, 13:13
is there a "histogram" filter for VapourSynth?
Wolfberry
29th June 2018, 13:44
Plugin List (www.vapoursynth.com/doc/pluginlist.html)
Histogram (https://github.com/dubhater/vapoursynth-histogram/releases)
Next time check the list before asking.
lansing
30th June 2018, 18:17
Reporting a bug cropping a rgb32 clip.
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)
rgb_clip = core.std.Crop(rgb_clip , bottom=50)
This will crop 50 from the top instead of the bottom. It works fine in YUV clips.
LigH
30th June 2018, 18:51
I remember there are top-down DIBs and bottom-up DIBs; maybe the COMPAT format is a factor here?
foxyshadis
30th June 2018, 22:14
I remember there are top-down DIBs and bottom-up DIBs; maybe the COMPAT format is a factor here?
Exactly. I think it's a legit bug, but DIB (COMPATRGB) should be converted away from as quickly as possible unless intending to display on a generic Windows control. Don't use DIB is a solid rule of thumb.
Hi!
guys I used InsertSign func but I didn't get the result properly!
import fvsfunc as fvf
v = core.ffms2.Source("ْX.mkv")
fx1 = core.ffms2.Source("AFX.avi")
v = fvf.InsertSign(v, fx1, 3895,4063)
final = v.set_output()
link: https://imgur.com/a/TFz2Hms
core.ffms2.Source("AFX.avi", alpha = True)
this is how it should be =)
Myrsloik
9th July 2018, 08:52
Go test R44-RC1 (https://www.dropbox.com/s/g3lvc0rqw6w5zex/VapourSynth-R44-RC1.exe?dl=1). Especially the fixed stuff like the crop bug. Will make a release in a few days if no serious regression is found.
r44:
fixed crop with compatbgr32 format where top and bottom crop would be switched
fixed crash in scdetect with one frame clips, now it simply returns an error since the operation is pointless
fixed potential multithreading issues in vsscript (stuxcrystal)
the resizer will now properly apply a shift even if no actual resizing/format conversion is being done
updated to zimg v2.7.4 to fix crash that only happens on core2 quad cpus
updated visual studio runtimes in installer
updated pismo runtime
added experimental large page support and changed cache logic (sekrit-twc)
minor documentation updates
ChaosKing
9th July 2018, 09:19
I get Failed to initialize VapourSynth environment after updating to RC1.
Python 3.6.5 is installed. Tested via vspipe and blankclip script.
I tried to restart my pc and reinstalled VS, didn't help.
Edit:
Reinstalled R43 again -> it works
Reinstalled R44rc1 -> Failed to initialize VapourSynth environment
EDIT2:
works good now with fixed link, thx
Myrsloik
9th July 2018, 09:38
I get Failed to initialize VapourSynth environment after updating to RC1.
Python 3.6.5 is installed. Tested via vspipe and blankclip script.
I tried to restart my pc and reinstalled VS, didn't help.
Edit:
Reinstalled R43 again -> it works
Reinstalled R44rc1 -> Failed to initialize VapourSynth environment
Doh, the 64bit python module was miscompiled for some reason. Link updated with a fixed version now.
Myrsloik
11th July 2018, 13:05
I have created a simple repository which can now basically install havsfunc and all its dependencies with one simple command.
VSRepo test2 (https://www.dropbox.com/s/dt9eizatnif7ufd/vsrepo-test2.7z?dl=1)
Usage:
vsrepo.py install havsfunc
vsrepo.py upgrade all
vsrepo.py list
You can also add the -p switch to run it in portable mode and -f to force unknown versions of plugins to be upgraded.
Files will be installed to %APPDATA%\VapourSynth\PluginsXX and %APPDATA%\Python\X.Y\site-packages
(also known as the per user autoload directory and python's per user site directory)
All installed files will by default end up in the path. Make sure that the portable python directory is also the working directory when running in portable mode.
HELP CREATING MORE PLUGIN DEFINITIONS WELCOME. See the files in the local folder for examples.
ChaosKing
11th July 2018, 13:47
Nice.
I had similar ideas but no time and motivation...
I have gathered almost all plugins & many scripts in a big json file incl. dependencies. It should be very easy to generate near ready plugin definitions with this: https://www53.zippyshare.com/v/WHUKg6fV/file.html
Scripts have "2 dependencies". The dependencies to import a script and dep. for each function.
example:
"com.wolframrhodium.bilateralGPU": {
"namespace": "bilateralgpu",
"identifier": "com.wolframrhodium.bilateralGPU",
"name": "BilateralGPU",
"type": "plugin",
"weblinks": [
{
"name": "source",
"link": "https://github.com/WolframRhodium/VapourSynth-BilateralGPU"
}
],
"description": "Bilateral filter for VapourSynth based on the OpenCV-CUDA library.",
"functions": {
"Bilateral": {
"defaults": "clip, sigma_spatial=1.0, sigma_color=1.0, planes, kernel_size=0, borderMode=4, device=0",
"description": "Bilateral filter is a non-linear, edge-preserving and noise-reducing smoothing filter for images.",
"bitdepth": "32",
"gpusupport": "CUDA",
"parameters": "clip:clip;sigma_spatial:float[]:opt;sigma_color:float[]:opt;planes:int[]:opt;kernel_size:int[]:opt;borderMode:int[]:opt;device:int[]:opt",
"tags": [
"Bilateral"
]
}
}
},
"havsfunc.py": {
"namespace": "havsfunc",
"shortalias": "haf",
"name": "havsfunc",
"description": "Holy's ported AviSynth functions for VapourSynth",
"weblinks": [
{
"name": "source",
"link": "https://github.com/HomeOfVapourSynthEvolution/havsfunc"
},
{
"name": "doom9-link",
"link": "https://forum.doom9.org/showthread.php?t=166582"
}
],
"type": "script",
"dependencies": [
"mvsfunc",
"adjust",
"mv",
"nnedi3_resample"
],
"dependencies-optional": [],
"functions": {
"daa": {
"defaults": "c, nsize=None, nns=None, qual=None, pscrn=None, int16_prescreener=None, int16_predictor=None, exp=None, opencl=False",
"description": "Anti-aliasing with contra-sharpening by Didée",
"bitdepth": "unknown",
"weblinks": [
{
"name": "Avisynth wiki",
"link": "http://avisynth.nl/index.php/DAA"
}
],
"dependencies": [
"nnedi3",
"nnedi3cl",
"rgvs",
"znedi3"
],
"tags": [
"antialiasing"
]
},
"santiag": {
"defaults": "c, strh=1, strv=1, type='nnedi3', nsize=None, nns=None, qual=None, pscrn=None, int16_prescreener=None, int16_predictor=None, exp=None, aa=None, alpha=None, beta=None, gamma=None, nrad=None, mdis=None, vcheck=None, fw=None, fh=None, halfres=False, typeh=None, typev=None, opencl=False",
"description": "santiag v1.6 - Simple antialiasing",
"bitdepth": "unknown",
"dependencies": [],
"tags": []
},
ChaosKing
11th July 2018, 14:05
Could you add a 7z.exe parameter? My 7zip is not installed in "c:\\Program Files\\7-Zip\\7z.exe"
Myrsloik
11th July 2018, 14:40
Could you add a 7z.exe parameter? My 7zip is not installed in "c:\\Program Files\\7-Zip\\7z.exe"
I will in the next version and registry detection for the default. Completely forgot about it...
ChaosKing
11th July 2018, 14:43
"Installed" via portableApps :D
Edit: here are some packages
It seems like the local folder is not necessary!?
minideen + smoothuv
{
"name": "MiniDeen",
"type": "Plugin",
"description": "MiniDeen is a spatial denoising filter. It replaces every pixel with the average of its neighbourhood. This is a port of the 'a2d' method from the Avisynth plugin Deen, version beta 2.",
"website": "https://github.com/dubhater/vapoursynth-minideen",
"doom9": "https://forum.doom9.org/showthread.php?t=175587",
"category": "Denoising",
"identifier": "com.nodame.minideen",
"namespace": "minideen",
"releases": [{
"version": "v1",
"win32": {
"url": "https://github.com/dubhater/vapoursynth-minideen/releases/download/v1/vapoursynth-minideen-v1-win32.7z",
"files": ["libminideen.dll"],
"hash": { "libminideen.dll": "250be1497035a51cabca751692010bd9300d9353" }
},
"win64": {
"url": "https://github.com/dubhater/vapoursynth-minideen/releases/download/v1/vapoursynth-minideen-v1-win64.7z",
"files": ["libminideen.dll"],
"hash": { "libminideen.dll": "7dfbdd3c7adf05e0deb7e99feee6b72000008d27" }
}
}]
},
{
"name": "SmoothUV",
"type": "Plugin",
"description": "SmoothUV is a spatial derainbow filter.",
"website": "https://github.com/dubhater/vapoursynth-smoothuv",
"doom9": "https://forum.doom9.org/showthread.php?t=175520",
"category": "Derainbowing",
"identifier": "com.nodame.smoothuv",
"namespace": "smoothuv",
"releases": [{
"version": "v2",
"win32": {
"url": "https://github.com/dubhater/vapoursynth-smoothuv/releases/download/v2/vapoursynth-smoothuv-v2-win32.7z",
"files": ["libsmoothuv.dll"],
"hash": { "libsmoothuv.dll": "67cfb0cec822c5f8ca3caef2b48034ebf22082e6" }
},
"win64": {
"url": "https://github.com/dubhater/vapoursynth-smoothuv/releases/download/v2/vapoursynth-smoothuv-v2-win64.7z",
"files": ["libsmoothuv.dll"],
"hash": { "libsmoothuv.dll": "2780e39bd1c974aea580c57f2f041233fc9db1e6" }
}
}]
},{
"name": "RainbowSmooth",
"type": "PyScript",
"description": "RainbowSmooth is a script which adds edge detection to SmoothUV. It is a port of the Avisynth function rainbow_smooth()",
"website": "https://github.com/dubhater/vapoursynth-smoothuv",
"doom9": "https://forum.doom9.org/showthread.php?t=175520",
"category": "Derainbowing",
"identifier": "RainbowSmooth",
"modulename": "RainbowSmooth",
"dependencies": [
"com.nodame.smoothuv"
],
"releases": [{
"version": "v1",
"script": {
"url": "https://raw.githubusercontent.com/dubhater/vapoursynth-smoothuv/master/RainbowSmooth.py",
"files": ["RainbowSmooth.py"],
"hash": { "RainbowSmooth.py": "2479c799ad1be9b1e6dfc2c50bf8595310934b2a" }
}
}]
},
ChaosKing
11th July 2018, 17:07
Now the question is: Is RainbowSmooth v1 or v2? it is in the same git repo as smoothuv but was not changed since the v1 release and is not inside the release zip. :-/
Myrsloik
11th July 2018, 22:16
Now the question is: Is RainbowSmooth v1 or v2? it is in the same git repo as smoothuv but was not changed since the v1 release and is not inside the release zip. :-/
I figured it out, added all your entries now
Myrsloik
11th July 2018, 22:45
VSRepo discussion continues in this thread (https://forum.doom9.org/showthread.php?t=175590)
Myrsloik
13th July 2018, 16:24
R44 released. It's a real maintenance release with nothing exciting added. Have fun...
ChaosKing
13th July 2018, 17:11
msvcp140_1.dll & msvcp140_2.dll <- are these testing leftovers? (see portable64 zip)
Will the next version be based on python 3.7?
Myrsloik
13th July 2018, 18:00
msvcp140_1.dll & msvcp140_2.dll <- are these testing leftovers? (see portable64 zip)
Will the next version be based on python 3.7?
They're official runrine dlls and not a leftover.
Yes, next version will be for python 3.7.
lansing
19th July 2018, 21:31
Is there a specific filter that can double the frames of a clip? I wanted to convert a 30fps clip to 60fps by doubling each frame but I couldn't find any info from the documentation.
Myrsloik
19th July 2018, 21:41
Is there a specific filter that can double the frames of a clip? I wanted to convert a 30fps clip to 60fps by doubling each frame but I couldn't find any info from the documentation.
Just plain repeat of the same frame twice?
std.Interleave([clip, clip])
lansing
19th July 2018, 21:49
Just plain repeat of the same frame twice?
std.Interleave([clip, clip])
Thanks it works.
lansing
20th July 2018, 22:34
I'm trying to pipe my script to ffmpeg to use its hardware encoding like this
vspipe --y4m "bob.vpy" - | ffmpeg -i pipe: -c:v h264_nvenc -preset llhq -rc:v vbr_minqp -qmin:v 19 -qmax:v 21 -b:v 2500k -maxrate:v 5000k -profile:v high hw_output.mp4
For some reason it has been pointing to the 32 bit version of vapoursynth, which result in failed attempt with errors like "znedi3 does not exist" because the required plugins in my script only has a 64 bit version. I checked my pc, my python default is 64 bit and the ffmpeg is also 64 bit, why does it still calling the 32 bit vapoursynth?
lansing
21st July 2018, 03:31
How do you make sure that vspipe.exe you are calling is 32 bit? I guess it's in your PATH environment variable.
I checked the PATH variable, it was not there. I tried uninstall and reinstall again, but the problem still existed.
lansing
21st July 2018, 09:30
Then firstly try calling vspipe with full path to see whether the problem still exists.
"C:\Program Files (x86)\VapourSynth\core64\vspipe.exe" --y4m "bob.vpy" - | ffmpeg ...
Declaring the whole path works. So the problem should be vs pointing to the wrong vspipe environment path on installation.
Update: I found the path in the system variable. It is pointing to "C:\Program Files (x86)\VapourSynth\core32".
Update 2: I changed the path manually to the core64 folder and it worked. But then when I run the vs installer again, it won't add back the original core32 path to the system variable. Even if I remove the modified path->uninstall->reinstall, the installation won't add it back, this looks like a bug to me.
lansing
21st July 2018, 13:26
IIRC the vs installer never adds the path to system environment variable for the users. You must manually add it yourself.
Oh yes you're right, I double checked on another computer and the installation is not adding the environment variable either, so it must be me who added it long time ago.
Myrsloik
22nd July 2018, 16:28
You should all try out VSRepo (https://forum.doom9.org/showthread.php?t=175590)now. As of test 9 it's more or less feature complete and only needs some additional testing.
If there's any plugin or script missing you think should be added simply request it in the linked thread.
IMPORTANT INFORMATION FOR PLUGIN/SCRIPT WRITERS:
If you host your stuff on GitHub new releases will be picked up automatically. Just remember to make official releases now and then (I'm looking at you, script writers) and that's it. If you choose to reject the light of GitHub then manual updates will be necessary. Fortunately very few of you have done so. Also post in the linked thread if a manual update is needed.
lansing
25th July 2018, 15:38
Just out of curiosity, does vapoursynth has an official logo/icon? I was using Simple x264 Launcher and in the "about" tabs, it has vapoursynth with a snake logo and I found it really funny.
poisondeathray
26th July 2018, 02:53
Just out of curiosity, does vapoursynth has an official logo/icon? I was using Simple x264 Launcher and in the "about" tabs, it has vapoursynth with a snake logo and I found it really funny.
I don't have Simple x264 Launcher, can you post the logo somewhere? (google can't find the snake)
I was wondering the same thing a while back.
Here is my logo animation when I was testing some particle simulations. I was thinking coalescing "vapour"; that type of thing - but it ended up looking more like "smoke" :( ... smoke synth
https://s22.postimg.cc/6yo6xau9d/vapoursynth.gif
lansing
26th July 2018, 03:59
I don't have Simple x264 Launcher, can you post the logo somewhere? (google can't find the snake)
I was wondering the same thing a while back.
Here is my logo animation when I was testing some particle simulations. I was thinking coalescing "vapour"; that type of thing - but it ended up looking more like "smoke" :( ... smoke synth
https://s22.postimg.cc/6yo6xau9d/vapoursynth.gif
https://i.imgur.com/oSbG7YI.jpg
poisondeathray
26th July 2018, 04:17
maybe the cute green guy is supposed to be a scary "python" ?
LigH
26th July 2018, 09:53
maybe the cute green guy is supposed to be a scary "python" ?
:sly: Quite probably a Python reference.
I could imagine a logo like a python appearing out of a steamy pot.
Myrsloik
26th July 2018, 09:56
Definitely a Python logo from somewhere. There's no official logo but one with some sharks circling a film clip would be nice to have...
ChaosKing
26th July 2018, 10:48
Definitely a Python logo from somewhere. There's no official logo but one with some sharks circling a film clip would be nice to have...
Hold My Beer ...
https://i.imgur.com/0Of3y7K.png
https://imgur.com/a/APLomKn
I think a steampunk shark would be way cooler
LigH
26th July 2018, 11:57
Damn. Now I wasted hours making a vapoured Python logo (https://www.ligh.de/pics/VapourSynth.png) (and then Mozilla browsers don't even render it transparently).
Why sharks?
Myrsloik
26th July 2018, 12:04
Damn. Now I wasted hours making a vapoured Python logo.
Why sharks?
I don't know, it was just a throwaway idea I had long ago. A python squeezing a movie clip would be fun too.
LigH
26th July 2018, 12:34
How about that: The Python double-snake logo being a "film clip"...
https://www.ligh.de/pics/VapourSynth_FilmClip.png — https://www.ligh.de/pics/VapourSynth_FilmClip.jpg
fAy01
26th July 2018, 15:54
https://i.pximg.net/img-master/img/2017/12/10/01/43/25/66229306_p0_master1200.jpg
https://www.pixiv.net/member_illust.php?mode=medium&illust_id=66229306
- need to ask for permission if used.
Myrsloik
26th July 2018, 20:03
How about that: The Python double-snake logo being a "film clip"...
https://www.ligh.de/pics/VapourSynth_FilmClip.png — https://www.ligh.de/pics/VapourSynth_FilmClip.jpg
I like this one. Give me an icon version and I'll make it the default icon for vpy files.
LigH
26th July 2018, 20:40
I hope this ICO file (https://www.ligh.de/software/VapourSynth.ico) is sufficient. It contains 32×32 and 48×48 icons with 256 and high colors (XP compatible), and 256×256 high colors with PNG compression for Vista+.
https://www.ligh.de/pics/VapourSynth_FilmClip32.png
https://www.ligh.de/pics/VapourSynth_FilmClip48.png
lansing
26th July 2018, 21:37
I think the shape looks weird, it would be better to be shaped as a square or a circle for an icon. For example, the original python logo is a circle.
poisondeathray
26th July 2018, 21:48
I'm not a fan of the "pink" film color either, or the translucency color combo where the "yellow" python looks "orange-ish?" behind the film
When viewing small icons, you lose sight and obscure part of the python logo (or at least the yellow python; blue guy is still visible), so the idea of "wrapping" around a film is not as clear either. Maybe a more transparent value , lighter gray shade for the film ?
LigH
26th July 2018, 22:23
@lansing: Icons are always squares; you may not notice that when they have transparency. But gradual transparency only works in high color modes for icons. And circles are hard to create with low resolutions, may look frayed out, as you see in the samples above (binary transparency, 256 color palette icons).
@poisondeathray: Yes, the strip color is not so fortunate, it is the original from a free clipart; I may change that to a neutral gray, or you won't recognize the yellow well. Soon...
Are_
26th July 2018, 23:30
Can you make a svg version of it too?
LigH
27th July 2018, 07:22
I don't have much experience with editing vector graphics. But the original ingredients used to be just that...
LigH
27th July 2018, 15:16
another ICO (https://www.ligh.de/software/VapourSynth_FilmClip.ico)
https://www.ligh.de/pics/VapourSynth_FilmClip256XP.png https://www.ligh.de/pics/VapourSynth_FilmClip48XP.png https://www.ligh.de/pics/VapourSynth_FilmClip32XP.png
kolak
27th July 2018, 17:48
Looks over-done/complicated for an icon :)
poisondeathray
27th July 2018, 18:23
I looks better IMO, but personally , I would go even more transparent for the film. Yellow python dude is not getting exposure
Also the original yellow logo path (I saw this on google images too) , seems to have a problem - the (viewer) right edge of is missing some points or flattened compared to the blue python's rounded border
poisondeathray
28th July 2018, 00:39
Why is 32x32 required to be supported ? Looking at the wikipedia link, XP supports 48x48. And it seems like XP support is getting phased out everywhere.
https://en.wikipedia.org/wiki/ICO_(file_format)
lansing
28th July 2018, 01:55
More modification:
https://i.imgur.com/qJJ3tRm.png
videoh
28th July 2018, 03:04
I think this whole concept looks stupid. Vapoursynth deserves much better. IMHO.
Myrsloik
28th July 2018, 15:33
More modification:
https://i.imgur.com/qJJ3tRm.png
Nopenopenopenopenope
poisondeathray
28th July 2018, 17:47
I think the original python logo and colors (blue/yellow) should be retained, at least in a way that makes it still recognizable - that helps with identification and association with the "python" the programming language
a rough idea - maybe the "film" can be fed through the logo, as if you feed film through a projector ? maybe something like this ?
(256x256 animated gif demo)
https://s22.postimg.cc/jxavwkdox/pythonlogo_film_256x256_rough_v1.gif
at 48x48 you can still see sprocket holes and python "eyes" , so they should still be visible as a 48x48 static ico. But 32x32 would require modifications and reframing - I'm still not sure why 32x32 is required to be supported ?
https://s22.postimg.cc/rrbhhvt6p/pythonlogo_film_48x48_rough_v1.gif
what characteristics or ideas makes it "vapoursynth" ? I understand python is important aspect, and I see "vaporware" as a tag below, but we know it's real and works :), but what other things or ideas do you want in a logo ?
ChaosKing
28th July 2018, 19:06
idk why but I immediately thought of this: uuuh yeahhhh, nice infinite ass wipe xD
Maybe it's just my dirty mind :p
TheFluff
29th July 2018, 00:08
well, ffms has a toilet paper roll for its logo so the shoe fits
Sparktank
29th July 2018, 00:36
https://s22.postimg.cc/rrbhhvt6p/pythonlogo_film_48x48_rough_v1.gif
I would start using VS if it had a logo like this.
If this was going to be a movie studio logo before the picture, I can see this turning around to project on the silverscreen: "aVAPOURSYNTHproject"
HuBandiT
29th July 2018, 00:38
(apologies for concepts only and no artwork)
concept #1: the python dudes (as image content) within one very visible film frame
concept #2: python dudes in reduced size in lower right corner of icon (as customary when an icon references a technology employed), with blue python dude's eye shining white (read: consider making "white" darker in other areas of the icon) as it is projecting (with some kind of visible light rays) an image onto one frame a film strip which occupies the main area of the icon; if enough space available, show three (or 0.5 + 1 + 0.5) frames of the film strip, top frame already has a fully formed image, middle frame (where blue dude is projecting with his eye) is forming, bottom frame blank (awaiting to be imaged)
foxyshadis
29th July 2018, 07:13
(256x256 animated gif demo)
This is the first thing that ever made me wish Windows supported animated file icons.
LigH
29th July 2018, 14:14
There is indeed an ANI file format. But hardly compressed, only a stack of DIBs, I believe. It was mainly intended for animated mouse cursors.
poisondeathray
30th July 2018, 21:33
concept #2: python dudes in reduced size in lower right corner of icon (as customary when an icon references a technology employed), with blue python dude's eye shining white (read: consider making "white" darker in other areas of the icon) as it is projecting (with some kind of visible light rays) an image onto one frame a film strip which occupies the main area of the icon; if enough space available, show three (or 0.5 + 1 + 0.5) frames of the film strip, top frame already has a fully formed image, middle frame (where blue dude is projecting with his eye) is forming, bottom frame blank (awaiting to be imaged)
Like austin powers / dr. evil - sharks with fricken laser beams attached to their heads!
"visible light rays" can be done as volumetric lights, but it's difficult to retain as an ico or small logo. A colored light example in the video below. And I don't think you'd be able to fit all that in a small ico.
Also why only blue python with fricken laser beams? It seems yellow python gets no love :(
But you can have different graphics for the logo (e.g. something that you put on a webpage, or use in a video), vs the ico . But I think they should share some themes and traits. eg. Python dudes with their official colors at least. I like them better than Lord Mulder's cute green guy
If this was going to be a movie studio logo before the picture, I can see this turning around to project on the silverscreen: "aVAPOURSYNTHproject"
Maybe something like this, with the python symbol/logo as the "o" some people misspell "vapOursynth". Not suitable for an ico , but an example of how you might use a possible logo. Colored light projection/ volumetric rays
https://www.youtube.com/watch?v=GKELqibwR8A
I don't like the text. But you need something that is synonymous with "vapoursynth". I also apologize for the font, its myriad pro, but I don't know what the official "font" is. Python uses Flux Regular "core.text" uses Terminus but it's an ugly font.
idk why but I immediately thought of this: uuuh yeahhhh, nice infinite ass wipe xD
Maybe it's just my dirty mind :p
maybe it was that ffms2 logo's subliminal effect ? or something Freudian :D
gives new meaning to "clean python code"
https://s22.postimg.cc/4s2tzj6vl/clean_python_code.jpg
hajj_3
5th August 2018, 13:29
It would be nice if you could add support for Python 3.7
ObenS
5th August 2018, 23:17
It would be nice if you could add support for Python 3.7
r45 will support Python 3.7 (https://github.com/vapoursynth/vapoursynth/commit/cb6190d397dc98582a19f8c04ca4b2918f1b5729)
Wolfberry
10th August 2018, 12:35
Internal functions like Binarize() Deflate()/Inflate() Median() Minimum()/Maximum() work in float in R44, but the doc still says they can only work in interger, I think this will confuse some users.
Also, MakeDiff() and MergeDiff() behave differently in float, the output is identical to "x y -" and "x y +" instead of "x y - 0.5 +" and "x y + 0.5 -" that one will normally expect.
Is this the intended behavior? I had implemented some workaround in my script due to this issue.
Myrsloik
10th August 2018, 17:30
Makediff is kinda up for debate. The only reason it's offset in integer is to have zero in the middle. With float there are no concerns like that. Discuss!
Myrsloik
19th August 2018, 19:43
Just a warning for all of you out there. The accept_lowercase option will be removed in the next version. None of you should be using it anyway and I really don't think it has a place in a case sensitive language like python.
unix
24th August 2018, 11:52
Hi guys, I have question.
What does this command mean"planes=[0, 2, 1], planes=[1] or planes=[1,2,3] ??
and values only from 0 to 3 value ?
Thanx
poisondeathray
24th August 2018, 15:21
What does this command mean"planes=[0, 2, 1], planes=[1] or planes=[1,2,3] ??
and values only from 0 to 3 value ?
This usually is a reference to the channels being used , such as Y,U,V,A or R,G,B,A
DJATOM
24th August 2018, 17:48
As I know, alpha channel in VS stored as second video clip, so for RGB and YUV it's always [0,1,2] or so.
edcrfv94
26th August 2018, 03:24
Any way change clip format chroma loction?
After nnedi3 Upscaling if use core.resize.Spline36 fix shiftm chroma loction will be set to center.
WolframRhodium
26th August 2018, 05:06
Any way change clip format chroma loction?
After nnedi3 Upscaling if use core.resize.Spline36 fix shiftm chroma loction will be set to center.
Use std.SetFrameProp (http://www.vapoursynth.com/doc/functions/setframeprop.html):
clip = core.std.SetFrameProp(clip, prop="_ChromaLocation", intval=0)
list of frame properties (http://www.vapoursynth.com/doc/apireference.html#reserved-frame-properties)
edcrfv94
26th August 2018, 08:27
Use std.SetFrameProp (http://www.vapoursynth.com/doc/functions/setframeprop.html):
clip = core.std.SetFrameProp(clip, prop="_ChromaLocation", intval=0)
list of frame properties (http://www.vapoursynth.com/doc/apireference.html#reserved-frame-properties)
Thanks
Anyway can get the chip info/props?
c_cl = clip.props._ChromaLocation
c_range = clip.props._ColorRange
Just idea not working
WolframRhodium
26th August 2018, 09:03
Thanks
Anyway can get the chip info/props?
c_cl = clip.props._ChromaLocation
c_range = clip.props._ColorRange
Just idea not working
Use text.ClipInfo (http://www.vapoursynth.com/doc/functions/clipinfo.html) if you only want to manually read the values. (text.FrameProps (http://www.vapoursynth.com/doc/functions/frameprops.html) is more human-readable.)
Otherwise you might want to use std.FrameEval (http://www.vapoursynth.com/doc/functions/frameeval.html), std.ModifyFrame (http://www.vapoursynth.com/doc/functions/modifyframe.html) or simply clip.get_frame (http://www.vapoursynth.com/doc/pythonreference.html?#VideoNode.get_frame)(n).props['_ChromaLocation'].
edcrfv94
26th August 2018, 10:16
Use text.ClipInfo (http://www.vapoursynth.com/doc/functions/clipinfo.html) if you only want to manually read the values. (text.FrameProps (http://www.vapoursynth.com/doc/functions/frameprops.html) is more human-readable.)
Otherwise you might want to use std.FrameEval (http://www.vapoursynth.com/doc/functions/frameeval.html), std.ModifyFrame (http://www.vapoursynth.com/doc/functions/modifyframe.html) or simply clip.get_frame (http://www.vapoursynth.com/doc/pythonreference.html?#VideoNode.get_frame)(n).props['_ChromaLocation'].
clip.get_frame(0).props['_ChromaLocation']
clip.get_frame(0).props._ChromaLocation
both doesn't work
WolframRhodium
26th August 2018, 12:05
clip.get_frame(0).props['_ChromaLocation']
clip.get_frame(0).props._ChromaLocation
both doesn't work
Why? Maybe the key is not defined?
DJATOM
26th August 2018, 21:41
for prop in clip.get_frame(0).props:
print(prop)
should print a list of valid props.
edcrfv94
27th August 2018, 00:16
Why? Maybe the key is not defined?
text.ClipInfo show Chroma Location: Unknown
But text.FrameProps or print show _ChromaLocation not defined.
Yrosma
3rd September 2018, 07:06
OK this is not a vapoursynth issue but as I read about large pages here maybe some people know.
I few pages back some people mentioned large pages and that it could give some better performance. As I'm doing some 4K material now which is quite slow I thought about trying this out as some people did get some improvement. My systems do have 32GB of memory so that should be fine.
But when I enabled large pages in windows and did some tests only using ffmpeg to convert to h264 and h265 (so no vapoursynth yet) I got a pretty big performance hit. Avarage around 20% slower conversions times just in ffmpeg conversions.
Did other people run into the same issues? Seen it on intel system with 32GB and an AMD system with 32GB
Because if it's like this even if there is an improvement in speed in vapoursynth, if ffmpeg conversion is this much slower there won't be a netto win.
Or could I be doing something wrong?
LigH
3rd September 2018, 08:23
According to StackOverflow (https://stackoverflow.com/questions/2876377/in-what-circumstances-can-large-pages-produce-a-speedup), this is a quite complex topic, much related to the sizes of CPU internal caches (and thus the CPU model), and video encoding may not even deal in general with the kind of RAM access which would benefit from large pages.
Selur
15th September 2018, 18:04
Are there any source filters which support mkv(av1) atm. ?
LigH
15th September 2018, 18:08
FFMS2 would have to be built freshly again.
And DirectShow, if VS could use e.g. LAV Filters, is even more Windows system dependent...
Myrsloik
16th September 2018, 21:48
R45 is almost done. People just keep reporting small bugs that only take a day to fix so it's dragging a little.
Now for the big question:
I've added VSRepo to the installer. Should I offer to install certain scripts or sets of plugins using it from the installer? If so, which ones/which sets?
ChaosKing
16th September 2018, 22:43
Hmm maybe some script collections: havsfunc, muvsfunc, mvsfunc , hnwvsfunc + source filters ffms2, d2v, lsmash. This should be enough.
Myrsloik
16th September 2018, 22:49
Lsmash has no compiled binaries and thus no package definition. The rest sounds reasonable I guess.
I also plan to allow vs to automatically fetch required plugins using vsrepo but that's a later project.
hydra3333
17th September 2018, 04:14
R45 is almost done. Thank you.
I've added VSRepo to the installer. Should I offer to install certain scripts or sets of plugins using it from the installer? If so, which ones/which sets?Not yet having looked into VSRepo ... for those of us that use portable VS, will there also be a portable VSRepo equivalent without an installer ?
Wolfberry
17th September 2018, 06:44
will there also be a portable VSRepo equivalent without an installer ?
commit 46da486 (https://github.com/vapoursynth/vapoursynth/commit/46da486e04898a9f06a10c39f4b5b537d320eb27) had added vsrepo to the portable package
ChaosKing
17th September 2018, 09:39
@hydra VSRepo is not tightly bundled with VS (it can run independently). Btw You can also just download the git version.
Portable mode with custom folders could look like this: .\vsrepo.py -p upgrade-all -b vapoursynth64\plugins -s ..\Scripts
hydra3333
17th September 2018, 10:54
Ah, that is great news. Cheers !
rekweom
22nd September 2018, 20:09
Could somebody help me configure Lut2 so that it works the same way as Avisynth's Overlay function in SoftLight mode? Or maybe there is a better way to do it with some other function? I have a hard time figuring this out.
Boulder
23rd September 2018, 09:21
Here's an interesting concept for an optimizer tool for Avisynth, and I asked about future VS compatibility. The tool has some prerequisites, could someone take a look and guide the author? Thank you :)
https://forum.doom9.org/showthread.php?p=1852583#post1852583
Myrsloik
27th September 2018, 20:23
R45-RC1 (https://www.dropbox.com/s/y22t99kwntcr6rg/VapourSynth-R45-RC1.exe?dl=1)
Go test it. I plan to do more VSRepo integration in R46.
Changes:
r45:
updated to zimg v2.8
updated visual studio runtimes in installer
avfs now uses utf8 filename support when available in avs+
avfs now prints the used mount point
windows binaries now use python 3.7
removed accept_lowecase setting from the python bindings
fixed frame duration calculation in clipinfo (dubhater)
fixed bug that prevented adding vertical margins in subtext (dubhater)
documentation updates
amayra
28th September 2018, 07:27
thank you Myrsloik finally i can say goodbye to filename problem and update my python setup
ca18
30th September 2018, 20:31
Can you please post VS Portable R45 64bit for Python 3.7 64bit Windows? :thanks:
LigH
30th September 2018, 21:37
There is no Release 45 yet. Only a first candidate (RC1 = "Release Candidate 1"). Patience, young padawan.
ca18
30th September 2018, 22:29
Extracted with uniextract2 now ... :rolleyes:
Myrsloik
30th September 2018, 22:30
Final release will be in a day or two. Just have to actually test the avfs changes properly so I didn't break everything.
ca18
30th September 2018, 22:52
NP m8, thank you, great job as always! :thanks: Need to get rid of this python 3.6 + 3.7 mess ASAP, everyone's been waiting for VS with 3.7 so time to finally bury 3.6 ;)
Revan654
17th October 2018, 18:13
Any update on the Final Release? I assume something broke since there no R45 release yet.
DJATOM
17th October 2018, 23:11
I have RC1 installed, no issues on my side.
Myrsloik
17th October 2018, 23:51
Any update on the Final Release? I assume something broke since there no R45 release yet.
Life happened. I'll stop dragging and simply release it tomorrow. It's always tomorrow...
hydra3333
18th October 2018, 09:26
great to hear you have a life :)
Revan654
19th October 2018, 02:06
Life happened. I'll stop dragging and simply release it tomorrow. It's always tomorrow...
Just wondering, Something broke my search path. Nothing in vs is working currently without crashing. I want to uninstall everything and re-install everything and try to get it working again.
Python Path: C:\ProgramData
VS Path: C:\Program Files (x86)
Encoder: Desktop
Myrsloik
20th October 2018, 23:58
R45 finally released. Maintenance and ironically avs+ improvements to avfs so unicode filenames are used.
VSRepo is bundled too but not particularly well integrated.
Changes:
r45:
updated to zimg v2.8
updated visual studio runtimes in installer
avfs now uses utf8 filename support when available in avs+
avfs now prints the used mount point
windows binaries now use python 3.7
removed accept_lowecase setting from the python bindings
fixed frame duration calculation in clipinfo (dubhater)
fixed bug that prevented adding vertical margins in subtext (dubhater)
documentation updates
hydra3333
21st October 2018, 00:57
changes:
windows binaries now use python 3.7
Thank you.
Was that 3.7.0 or 3.7.1 ?
amichaelt
21st October 2018, 02:48
Thank you.
Was that 3.7.0 or 3.7.1 ?
Wasn't 3.7.1 only just released a few hours ago?
hydra3333
21st October 2018, 02:51
Wasn't 3.7.1 only just released a few hours ago?
Just checked, I only see a date of today by the looks, so likely yes.
I guess that means it isn't "compatible" with 3.7.1 ?
Selur
21st October 2018, 05:22
I get 'Failed to initialize VapourSynth' in vsedit with R45 both Python 3.7.0 and 3.7.1 (used the portable version and embeddable download from https://www.python.org/downloads/release/python-370/ and https://www.python.org/downloads/release/python-371/).
-> am I missing something
tuanden0
21st October 2018, 05:41
I get 'Failed to initialize VapourSynth' in vsedit with R45 both Python 3.7.0 and 3.7.1 (used the portable version and embeddable download from https://www.python.org/downloads/release/python-370/ and https://www.python.org/downloads/release/python-371/).
-> am I missing something
I use installer on github and everything is OK with python 3.7.0 :D
Selur
21st October 2018, 05:51
Are you using the portable Python 3.7.0 or are you using a system wide install?
hydra3333
21st October 2018, 05:51
Well, I did the portable install (python 3.7.0 and R45) overwriting everything in the previously successful portable folder, and now when running vsedit:
2018-10-21 15:20:04.069
Failed to initialize VapourSynth environment!
Failed to initialize VapourSynth environment!
Failed to initialize VapourSynth environment!
Failed to initialize VapourSynth environment!
Failed to initialize VapourSynth environment!
Selur
21st October 2018, 05:54
That's what happening here too.
(I tried with a clean folder extracted the portable python 3.7.0, R45 and vsedit into it, same effect).
:(
hydra3333
21st October 2018, 06:12
A quick test with an old test script yields this
"C:\SOFTWARE\Vapoursynth-x64\VSPipe.exe" --y4m "test.vpy" - | "C:\SOFTWARE\ffmpeg\ffmpeg.exe" -threads 0 -i pipe: -threads 0 -an -threads 0 -map_metadata -1 -c:v h264_nvenc blah blah -movflags +faststart -y "test.VS.MP4"
Failed to initialize VapourSynth environment
Selur
21st October 2018, 06:22
Same, here. Hopefully Myrsloik can help. :)
tuanden0
21st October 2018, 06:24
Are you using the portable Python 3.7.0 or are you using a system wide install?
I'm using system wide install python 3.7.0
Selur
21st October 2018, 06:25
Okay, that doesn't help then. Seems to be a problem with portable Python and R45. :(
DJATOM
21st October 2018, 06:39
Yeah, Myrsloik forgot to edit path in the portable generation script, so you can have mine (confirmed working x64 portable): https://mega.nz/#F!6aAUUYwR!EskQeFhetoxTosSQafnTsw
Selur
21st October 2018, 07:13
I can confirm that this version works fine with portable Python.
Thanks DJATOM!
Cu Selur
Revan654
21st October 2018, 07:45
I get 'Failed to initialize VapourSynth' in vsedit with R45 both Python 3.7.0 and 3.7.1 (used the portable version and embeddable download from https://www.python.org/downloads/release/python-370/ and https://www.python.org/downloads/release/python-371/).
-> am I missing something
As nice as VS is, it's still a PIA sometimes to keep everything in the search path.
It doesn't help sometimes when VS2017 gets updates it screws everything up.
Wasn't 3.7.1 only just released a few hours ago?
3.7.1RC1 has been out for awhile. The final version was just released.
ChaosKing
21st October 2018, 09:29
Yeah, Myrsloik forgot to edit path in the portable generation script, so you can have mine (confirmed working x64 portable): https://mega.nz/#F!6aAUUYwR!EskQeFhetoxTosSQafnTsw
But your build is also "incomplete". avisource.dll is missing :D
hydra3333
21st October 2018, 10:26
Oh well, I feel sure Myrsloik will address it in due course. Vapoursynth is a beaut tool (and its name is even spelled in the right way) !
Myrsloik
21st October 2018, 10:46
Uploaded fixed portable binaries.
By python 3.7 I mean the 3.7-series which is ABI compatible.
Selur
28th October 2018, 17:42
Trying to create a blank clip, I tried:
blank = core.std.BlankClip(clip=inputClip, length=1, format=inputClip.format.id)
and
blank = core.std.BlankClip(clip=inputClip, length=1)
both times I get:
vapoursynth.Error: BlankClip: invalid format
-> How to create a BlankClip in the format of the inputClip ?
Cu Selur
poisondeathray
28th October 2018, 17:51
blank = core.std.BlankClip(clip=inputClip, length=1)
This works for me in Windows installed vapoursynth version; and everything is matching correctly in terms of parameters
Selur
28th October 2018, 17:55
Argh,... python cache,.. Thanks!
Wolfberry
14th November 2018, 12:45
Please update the doc (http://vapoursynth.com/doc/) to R45 :thanks:
Myrsloik
14th November 2018, 12:49
Please update the doc (http://vapoursynth.com/doc/) to R45 :thanks:
Done. But not really any big changes...
lansing
24th November 2018, 16:39
I don't know if this is a bug or just me, when I opened a script with avfs.exe, pressing crtl+c did not exit the program.
Myrsloik
24th November 2018, 16:41
I don't know if this is a bug or just me, when I opened a script with avfs.exe, pressing crtl+c did not exit the program.
It's an exciting new bug. Python 3.7 probably changed something about how it's handled.
asarian
5th December 2018, 02:01
Finally upgraded to R45 (from R32 even). I can no longer mount my .vpy scripts, though. :( I have the AV FileSystem, and the Pismo filesystem. What am I missing?
poisondeathray
5th December 2018, 03:09
Finally upgraded to R45 (from R32 even). I can no longer mount my .vpy scripts, though. :( I have the AV FileSystem, and the Pismo filesystem. What am I missing?
is script valid ?
vspipe --info script.vpy -
is there error message?
are you using current avfs.exe that came with vapoursynth?
asarian
5th December 2018, 03:27
is script valid ?
vspipe --info script.vpy -
is there error message?
are you using current avfs.exe that came with vapoursynth?
Thx for the swift reply. :)
Yes, the script is valid:
F:\jobs>vspipe --info test.vpy -
Width: 720
Height: 480
Frames: 6307
FPS: 30000/1001 (29.970 fps)
Format Name: YUV420P8
Color Family: YUV
Alpha: No
Sample Type: Integer
Bits: 8
SubSampling W: 1
SubSampling H: 1
Core freed but 537600 bytes still allocated in framebuffers
Also, I can simply run avfs.exe test.vpy, and it will mount the .vpy file. What I can no longer do, though, is 'contextually' mount it, with the Pismo system (right-click, and mount the script), like I used to be able to.
And yes, I use the 119 KB avfs.exe that the R45 (apparently) installed.
poisondeathray
5th December 2018, 03:56
Also, I can simply run avfs.exe test.vpy, and it will mount the .vpy file. What I can no longer do, though, is 'contextually' mount it, with the Pismo system (right-click, and mount the script), like I used to be able to.
It doesn't use Pismo anymore, or the context menu
The older Pismo context menu still can work for avs scripts (I have it concurrently working for 32bit), I don't think it can run vpy scripts (or maybe it can run 32bit vapoursynth, not sure)
lansing
5th December 2018, 05:31
Yeah the right click->quick mount context menu is missing now, what I do now is make a avfs.exe shortcut and paste it into folders where I need it, and then just drag the vpy into the shortcut to mount it.
asarian
5th December 2018, 05:51
Yeah the right click->quick mount context menu is missing now, what I do now is make a avfs.exe shortcut and paste it into folders where I need it, and then just drag the vpy into the shortcut to mount it.
Aww, too bad that functionality is gone: I really liked it. Thx guys.
Good tip on the shortcut, btw. :) Thx.
kypec
9th December 2018, 12:08
Hi Myrsloik,
I am trying to build vapoursynth from git repo on LinuxMint 19 Tara (distro is based upon Ubuntu 18.04) and followed your instructions carefully. Btw, your required packages are missing one component automake which was easy to discover and install. I also cloned and built latest zimg without problems.
I autogenerated and configured your cloned repo successfully but make process fails with some cython error, complete make log is pasted here (https://pastebin.com/WhNvSqAc). Also, there are lots of warnings too :confused:
Please advice how to rectify this problem, :thanks:
Myrsloik
9th December 2018, 12:47
Hi Myrsloik,
I am trying to build vapoursynth from git repo on LinuxMint 19 Tara (distro is based upon Ubuntu 18.04) and followed your instructions carefully. Btw, your required packages are missing one component automake which was easy to discover and install. I also cloned and built latest zimg without problems.
I autogenerated and configured your cloned repo successfully but make process fails with some cython error, complete make log is pasted here (https://pastebin.com/WhNvSqAc). Also, there are lots of warnings too :confused:
Please advice how to rectify this problem, :thanks:
Cython compilation errors usually mean the cython version is too old. Update cython with pip to the latest version.
kypec
9th December 2018, 15:16
Cython compilation errors usually mean the cython version is too old. Update cython with pip to the latest version.
Thanks for the hint but I don't know how precisely am I supposed to update my cython. I have tried the following:kypec@acer:~/vapoursynth$ pip install Cython
Collecting Cython
Downloading https://files.pythonhosted.org/packages/b3/b8/31ce8eb5fc8dd7a8900d0bc7ed4291fc823e7356c9db136c208d74b04353/Cython-0.29.1-cp27-cp27mu-manylinux1_x86_64.whl (2.0MB)
100% |████████████████████████████████| 2.0MB 600kB/s
Installing collected packages: Cython
Successfully installed Cython-0.29.1
kypec@acer:~/vapoursynth$ cython3 --version
Cython version 0.26.1
Then I tried:kypec@acer:~/vapoursynth$ pip install --upgrade Cython
Collecting Cython
Using cached https://files.pythonhosted.org/packages/b3/b8/31ce8eb5fc8dd7a8900d0bc7ed4291fc823e7356c9db136c208d74b04353/Cython-0.29.1-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: Cython
Successfully installed Cython-0.29.1
kypec@acer:~/vapoursynth$ cython3 --version
Cython version 0.26.1
Although the install/upgrade process reports success, the version check always yields Cython version 0.26.1
How the heck is one supposed to UPGRADE that package then? :angry:
StainlessS
9th December 2018, 18:57
Kypec,
I tried install of VS some time ago, (and eventually gave up as Ubuntu apparently had some packages missing/broken),
but see here (pip3), maybe it helps, no idea (linux/VS virgin):- https://forum.doom9.org/showthread.php?p=1794992#post1794992
EDIT: Ill probably try again on Mint & Gentoo soon.
[pip3 = python v3.xx version of pip(v2.7)]
qyot27
9th December 2018, 20:19
You have to install Cython to the system, not the user area. Use sudo with pip/pip3.
Or just use the package from Ubuntu 18.10 and install it with dpkg. (https://packages.ubuntu.com/cosmic/cython)
kypec
10th December 2018, 12:58
Thank you StainlessS & qyot27 for suggestions. Yes, I fixed the problem by using pip3 install --upgrade cython instead of (legacy?) pip but forgot to reply here. The last obstacle was to resolve issues with environment variables LD_LIBRARY_PATH and PYTHONPATH but finally -> vspipe runs as expected!
Selur
20th January 2019, 15:55
Is there a Vapoursynth plugin which can show the wave front of an audio clip? (I'd like to see the wave front when deciding there to cut/trim a source.)
F1nkster
22nd January 2019, 14:16
Having an issue on Win10 using a custom Python library path with VapourSynth. I add the path to PYTHONPATH and everything works fine from the Python CLI. I then go into VSEdit and add the path in Settings. It works fine only when I run VSEdit as Admin. It fails to find my libraries if I run as my normal user account.
At first, I thought it was an issue with VSEdit. However, I am having the same problem loading a VPY script into VDub2. I have to run VDub2 as Admin for the custom path to work, which makes me think there's something else going on beyond VSEdit.
I gave my user account full rights to the Python37, VapourSynth, and VapourSynth Editor directories and everything in them. And my account already has full access to the custom library path. I reinstalled Python37 with support for All Users. None of this helped.
Btw, my normal user account works fine with the standard Python37\Lib\site-packages\vapoursynth directory. No issues there. So that's my fallback.
Just seeing if anyone else has thoughts.
Revan654
25th January 2019, 04:38
Is there any on going issues currently with Windows 10 that's causing any kind of issues with Python or VapourSynth? It seems like I'm doing nothing but fighting with these two parts. I checked Registry and file locations everything is pointing to the correct path / files. Not even VS Editor wants to load now.
Last night it was fine, then when I booted up today nothing. I know last night Windows updated something, along with VS 2017.
Revan654
25th January 2019, 20:01
Finally Fixed it after hours of Playing around with python. It worked after I installed Numpy & Pillow.
_Al_
26th January 2019, 09:20
Hi, I know this is wrong:
clip = core.resize.Bicubic(clip, vs.RGB24)
but it causes crash for all apps loading script, that error is not caught by script evaluations, perhaps vs.RGB24 is being loaded into wrong place. It gives out legit VideoNode though. RAM overruns even with core.max_cache_size set.
Revan654
26th January 2019, 19:33
Hi, I know this is wrong:
clip = core.resize.Bicubic(clip, vs.RGB24)
but it causes crash for all apps loading script, that error is not caught by script evaluations, perhaps vs.RGB24 is being loaded into wrong place. It gives out legit VideoNode though. RAM overruns even with core.max_cache_size set.
Your missing format syntax. You should only leave out the syntax if you know exactly the order of the variables are.
clip = core.resize.Bicubic(clip, format=vs.RGB24)
You could also Use this:
clip = core.fmtc.resample (clip, css="444")
clip = core.fmtc.matrix (clip, mat="709", col_fam=vs.RGB)
clip = core.fmtc.bitdepth (clip, bits=8)
_Al_
26th January 2019, 22:43
Yes, I wanted to bring up if anyone makes this line it freezes and crashes, because Vapoursynth takes 2000010 (id for vs.RGB24) as width.
Argument width, does not have to be explicitly stated, width=something. But that resize is quite complex thing. Color spaces conversions etc., maybe it should be mandatory to state width=something, format=something. Not gravely important, sure.
This is one of those things to repel newcomers to use Vapoursynth. Resize is almost used in every script. So format has to be specified, but not width, not a consistent somehow. It is hard to understand if you are a video guy, not a programmer. But again, I do not expect this to be fixed, I take it as a flag if someone googles it or whatever.
poisondeathray
26th January 2019, 23:19
No pathway . That's the error message.
If "clip" is YUV, you need to specify matrix_in_s="709" (or whatever matrix) , if it's not already specified in the clip props
_Al_
26th January 2019, 23:40
I understand that. It took me some hours though to figure that out last year. It takes that value from props, if it is usable, it uses it. Sometimes it is in props , sometimes not, it depends if source filter registers that taking it from video. If not , it has to be specified, if it is needed and not specified error is returned. Which in a sense is great, because we do not want to have any defaults in background going on. If those values loaded by source plugin taken from video are correct ones is another issue of course.
Also values in props are numerical (int) and to get corresponding string value, other script lines are needed to put it on screen. Which you of course can mess you up if you are learning it. :-) matrix table of numerical values with corresponding string values:
matrix_ITU = {0:'rgb', 1:'709', 2:'unspec', 3:'reserved', 4:'fcc',
5:'470bg', 6:'170m', 7:'240m', 8:'ycgco', 9:'2020ncl',
10:'2020cl' , 100:'OPP',
}
matrix_USABLE_ITU = ['709', 'fcc', '470bg', '170m', '240m', 'ycgco', '2020ncl', '2020cl', 'OPP']
myrsloik website explains that but those numbers are not matching, I pulled them from here (https://www.itu.int/rec/T-REC-H.265-201802-I/en)
page 430 Table E.5 Matrix coefficients interpretation
lansing
27th January 2019, 00:31
Yes, I wanted to bring up if anyone makes this line it freezes and crashes, because Vapoursynth takes 2000010 (id for vs.RGB24) as width.
Yup the error handling is missing, it should return the error instead of crashing the program.
qyot27
27th January 2019, 01:55
This is one of those things to repel newcomers to use Vapoursynth. Resize is almost used in every script. So format has to be specified, but not width, not a consistent somehow. It is hard to understand if you are a video guy, not a programmer. But again, I do not expect this to be fixed, I take it as a flag if someone googles it or whatever.
The problem was that the parameter order wasn't obeyed, so when you told it width=vs.RGB24 (which is what you did by omitting actual width and height and then not explicitly declaring format=), it did exactly what it was told and interpreted 'vs.RGB24' as an integer.
video,848,480,vs.RGB24 = this will work
video,vs.RGB24 = this won't work
AviSynth works exactly the same way concerning parameter order - if you drop one parameter in the middle, everything after that requires explicitly declaring the parameter name too for the values to be set to the right option.
The actual source of the immediate crash is that resizing to 2 million pixels wide is going to cause problems *somewhere* in the chain.
asarian
1st February 2019, 05:33
Can you set a (vertical) offset to core.sub.ImageFile? Really looking to lower the subs a bit.
jackoneill
1st February 2019, 13:01
Can you set a (vertical) offset to core.sub.ImageFile? Really looking to lower the subs a bit.
No, but if you pass blend=False you get only the subtitles, and you can use Crop and AddBorders to move them. Of course then you have to blend them manually with your video clip.
http://www.vapoursynth.com/doc/plugins/subtext.html
asarian
1st February 2019, 15:11
No, but if you pass blend=False you get only the subtitles, and you can use Crop and AddBorders to move them. Of course then you have to blend them manually with your video clip.
http://www.vapoursynth.com/doc/plugins/subtext.html
Thanks.
I tried to whip out the old SupTitle.dll (as I remembered it can do 'relocation'), but that wouldn't run somehow:
core.avs.LoadPlugin ("C:/VS/plugins/SupTitle.dll")
Should still work, right?!
EDIT: Yeah, that's an old 32-bit filter. :) Nevermind.
lansing
2nd February 2019, 02:25
Would it be a good idea for vapoursynth to implicitly set the value of an argument to its default value when we declared it without giving it a value? Something like this
fm = core.vivtc.VFM(clip, order)
instead of this
fm = core.vivtc.VFM(clip, order=0) # assuming 0 is the default
Sometime when I'm testing a filter, I would display all its arguments with vs editor's autocomplete feature, and I don't want to go into the manual to enter the default value manually for everyone of them.
Boulder
3rd February 2019, 13:07
I was trying to load pinterf's MVTools2 build in Vapoursynth, but the functions don't appear in the avs namespace (using core.avs.MAnalyze just says that the function doesn't exist). I get this error in the VapourSynth Editor log, is it the reason?
Avisynth Compat: varargs not implemented so I'm just gonna skip importing MStoreVect
Myrsloik
3rd February 2019, 18:47
I was trying to load pinterf's MVTools2 build in Vapoursynth, but the functions don't appear in the avs namespace (using core.avs.MAnalyze just says that the function doesn't exist). I get this error in the VapourSynth Editor log, is it the reason?
Avisynth Compat: varargs not implemented so I'm just gonna skip importing MStoreVect
Support for avisynth mvtools was removed in R40 due to the ugly hacks needed that slowed down all avisynth filter creation. And and a native version has existed for a long time now.
You can probably grab the avscompat.dll from R39 and use that if you really want to test things though.
Boulder
3rd February 2019, 19:51
Thanks, looks like I'll skip it then. I was just thinking about testing it in case Zopti starts crashing the native plugin which probably doesn't have all the fixes and tweaks from the AVS version. It's been quite some time since the last commit.
Myrsloik
3rd February 2019, 20:03
Thanks, looks like I'll skip it then. I was just thinking about testing it in case Zopti starts crashing the native plugin which probably doesn't have all the fixes and tweaks from the AVS version. It's been quite some time since the last commit.
Just report the bugs you find and they should probably get fixed quite quickly.
gonca
3rd February 2019, 22:26
https://forum.doom9.org/showthread.php?t=154696Thanks.
I tried to whip out the old SupTitle.dll (as I remembered it can do 'relocation'), but that wouldn't run somehow:
core.avs.LoadPlugin ("C:/VS/plugins/SupTitle.dll")
Should still work, right?!
EDIT: Yeah, that's an old 32-bit filter. :) Nevermind.
zorr
3rd February 2019, 23:04
Thanks, looks like I'll skip it then. I was just thinking about testing it in case Zopti starts crashing the native plugin which probably doesn't have all the fixes and tweaks from the AVS version. It's been quite some time since the last commit.
The latest released version crashes... a lot. :) I recommend using the version jackoneill shared after fixing this issue (https://github.com/dubhater/vapoursynth-mvtools/issues/35) (download link available at that url).
Just report the bugs you find and they should probably get fixed quite quickly.
I have another issue open, hopefully that one can be fixed as well. But I totally understand it can take time, the author is doing this on his free time after all.
Fabulist
4th February 2019, 05:32
Hello,
May I ask if there is some kind of guide or documentation to help me make VapourSynth work with PotPlayer (more specifically, with madVR/SVP)? I have been researching this for days; I run multiple different installations of both VapourSynth and PotPlayer, seemingly appropriate, but I simply cannot make it work with PotPlayer itself, and of course not with anything else - I have no idea what I am missing.
Sorry to bother, and I am sorry if this is not the right place to ask.
Thanks.
hydra3333
12th February 2019, 07:31
Intel claim to speed up python runtime by 20x, for free
https://www.infoworld.com/article/3314716/software/accelerated-python-give-python-an-even-bigger-boost-with-no-code-changes.html?cid=em-elq-43417&utm_source=elq&utm_medium=email&utm_campaign=43417&elq_cid=4495538
Intel’s distribution is a tuned version of the open source Python we all normally use. It’s been prebuilt to deliver much higher performance by a variety of methods, but most importantly by relying on the Intel Performance Libraries to accelerate x86 and x86-64 performance. This means that performance improvements can come without changing our Python code.
I suppose this does not have any relevance to vapoursynth ?
Cheers
asarian
12th February 2019, 11:17
Intel claim to speed up python runtime by 20x, for free
https://www.infoworld.com/article/3314716/software/accelerated-python-give-python-an-even-bigger-boost-with-no-code-changes.html?cid=em-elq-43417&utm_source=elq&utm_medium=email&utm_campaign=43417&elq_cid=4495538
I suppose this does not have any relevance to vapoursynth ?
Cheers
Probably none. :) The real work is done in the filters.
RainyDog
13th February 2019, 14:17
Vapoursynth newbie here.
Can anyone help me get this (https://pastebin.com/YMBnDLE4) bbmod AVS port to work please?
I assume it should be something along the lines of the below syntax but with the correct instruction to replace the *?
clip = core.*.bbmod2(c, cTop = 0, cBottom = 0, cLeft = 0, cRight = 0, thresh = 128, blur = 999)
Thanks.
Selur
13th February 2019, 16:00
assuming you named the file DUMMY.py and placed int into the autoloading folder (http://www.vapoursynth.com/doc/autoloading.html),
# Import the script
import DUMMY
# ... whatever you do otherwise in your script
# call the script
clip = DUMMY.bbmod(c=clip, cTop = 0, cBottom = 0, cLeft = 0, cRight = 0, thresh = 128, blur = 999)
if you keep the file inside another folder than the autoload folder for example e:/vsfilters you need to to use something like:
# Imports
import os
import sys
# Import scripts folder
scriptPath = 'e:/vsfilters'
sys.path.append(os.path.abspath(scriptPath))
# Import script
import DUMMY
# ... whatever you do otherwise in your script
# call the script
clip = DUMMY.bbmod(c=clip, cTop = 0, cBottom = 0, cLeft = 0, cRight = 0, thresh = 128, blur = 999)
DJATOM
13th February 2019, 16:22
It should be DUMMY.py, not vpy.
Selur
13th February 2019, 16:45
Yup, fixed :)
Mystery Keeper
13th February 2019, 19:51
Intel claim to speed up python runtime by 20x, for free
https://www.infoworld.com/article/3314716/software/accelerated-python-give-python-an-even-bigger-boost-with-no-code-changes.html?cid=em-elq-43417&utm_source=elq&utm_medium=email&utm_campaign=43417&elq_cid=4495538
I suppose this does not have any relevance to vapoursynth ?
Cheers
No, it does not. Python scripts are used to build the filters graph and pretty much for nothing else. VapourSynth doesn't really depend on Python. Someone could make a new language for it. But it would be hard to beat Python's vast infrastructure.
Selur
16th February 2019, 08:17
Is there something like Wavefront for Vapoursynth?
I'd like to do something along the (Avisynth) lines of:
LoadPlugin("I:\MkvCutter\ffms2.dll")
LoadPlugin("I:\MkvCutter\waveform.dll")
function m4(float x) {return(x<16?16:int(round(x/4.0)*4))}
V = FFVideoSource("F:\Family.mkv", cachefile="F:\Family.ffindex", threads=1).ConvertToYv12()
A = FFAudioSource("F:\Family.mkv", cache=false).ConvertToMono
V = V.BicubicResize(Ceil(V.Width*1)-(Ceil(V.Width*1)) % 4, V.Height)
AudioDub(V,A).WaveForm(window=1, height=m4(V.Height/4.0))
which is
a. taking audio and video from a source
b. converting the audio to mono
c. overlaying the audio wavefront onto the video
Did some googling, but couldn't find anything.
So does someone know how to do this with Vapoursynth or is it simply not possible atm. ?
Cu Selur
Mystery Keeper
16th February 2019, 21:39
Is there something like Wavefront for Vapoursynth?
I'd like to do something along the (Avisynth) lines of:
LoadPlugin("I:\MkvCutter\ffms2.dll")
LoadPlugin("I:\MkvCutter\waveform.dll")
function m4(float x) {return(x<16?16:int(round(x/4.0)*4))}
V = FFVideoSource("F:\Family.mkv", cachefile="F:\Family.ffindex", threads=1).ConvertToYv12()
A = FFAudioSource("F:\Family.mkv", cache=false).ConvertToMono
V = V.BicubicResize(Ceil(V.Width*1)-(Ceil(V.Width*1)) % 4, V.Height)
AudioDub(V,A).WaveForm(window=1, height=m4(V.Height/4.0))
which is
a. taking audio and video from a source
b. converting the audio to mono
c. overlaying the audio wavefront onto the video
Did some googling, but couldn't find anything.
So does someone know how to do this with Vapoursynth or is it simply not possible atm. ?
Cu SelurLikely not done by anyone. Implementable by making a source filter that reads audio from media files and generates the waveform video.
tebasuna51
17th February 2019, 13:12
@Selur, remember than VapourSynth don't support audio.
Don't exist any xxAudioSource() or AudioDub().
waveform.dll can't read audio data inside VapourSynth.
Like Mystery Keeper say a new source filter must do all the job:
a. taking audio from a source
b. converting the audio to mono
c. supply the waveform converted to video
Selur
17th February 2019, 13:18
Yeah, I hoped I missed something and that there already were filters to do all this. :)
-> Thanks for confirming, that there currently isn't a filter in Vapoursynth to do what I wanted. :)
asarian
17th February 2019, 16:11
@Selur, remember than VapourSynth don't support audio.
Nor should it, IMHO. There's absolutely no point letting VS do audio conversions, when you can just use eac3to to convert/extract your audio outside the VS process.
lansing
17th February 2019, 20:44
Nor should it, IMHO. There's absolutely no point letting VS do audio conversions, when you can just use eac3to to convert/extract your audio outside the VS process.
There can a point when he's trimming the video in the script, there he would have to set the same trim on the audio as well so they can be in sync.
Some audio trimming programs can takes in a cut_list file and trim the audio according to the cut points in that file. It would be nice to have vapoursynth or vs editor to output these cut_list file as well according to the trimming in the script.
Selur
18th February 2019, 20:14
@asrain:
a. for me it's not about doing a conversion, but seeing the wave front in a preview to make decisions about cutting and chapter points.
b. last I checked eac3to is Windows only and only support a few audio formats and no filtering, so at least for me it's hardly useful. (ffmpeg and sox are way more useful for me)
sl1pkn07
19th February 2019, 17:04
eac3to works almost good with wine
poisondeathray
20th February 2019, 17:49
avfs x64 issue with certain x64 avs scripts ? R45
A simple TIVTC script works ok through avisynth+ x64 , verified in avspmod x64, or vdub2 x64 . But when run though avfs x64, it produces "green screen" . avfs x86 ok
MPEG2Source()
TFM().TDecimate()
YV12 working for both avfs x86, x64 with version yv12, and blankclip yv12
version()
converttoyv12()
blankclip(pixel_type="YV12")
Why does avfs x64 TIVTC script in YV12 not work ? But simple "version" or "blankclip" in YV12 work ?
Even if I remove the x86 dgdecode.dll, tivtc.dll from the avisynth x86 plugins folder to "force" x64 pathway, still
does not work
But different source filter works in x64, TIVTC works, so this suggests the x64 dgdecode compatibility issue with avfs ?
dgdecode.dll x64 was from here
https://www.mediafire.com/download/c0wmemj5jam/DGDecode_3-19-2010.rar
http://avisynth.nl/index.php/AviSynth%2B_x64_plugins
FFVideoSource()
TFM().TDecimate()
Selur
20th February 2019, 17:56
@poisondeathray: I don't see the connection between Avisynth and Vapoursynth here,... (this is the Vapoursynth thread,..)
poisondeathray
20th February 2019, 17:57
@poisondeathray: I don't see the connection between Avisynth and Vapoursynth here,... (this is the Vapoursynth thread,..)
newer avfs versions are from vapoursynth . It's distributed that way. Myrsloik updates and compiles it now. If it's more appropriate, perhaps move discussion over to the avfs thread if some mod wants to move it
Selur
20th February 2019, 18:45
ah okay,...
VS_Fan
21st February 2019, 04:02
avfs x64 issue with certain x64 avs scripts ? R45
Why does avfs x64 TIVTC script in YV12 not work ? Have you tried:
Mpeg2DecPlus (source (https://github.com/chikuzen/MPEG2DecPlus) binary (https://kuroko.fushizen.eu/bin/mpeg2decplus-0.1.1.zip)) instead of DGdecode?
The latest TIVTC v1.0.14 (https://github.com/pinterf/TIVTC/releases) from pinterf ?
Setting fps with AssumeFPS("ntsc_video") before TFM ?
poisondeathray
21st February 2019, 04:16
Have you tried:
[LIST]
Mpeg2DecPlus (source (https://github.com/chikuzen/MPEG2DecPlus) binary (https://kuroko.fushizen.eu/bin/mpeg2decplus-0.1.1.zip)) instead of DGdecode?
Thanks, it works ok now with this version
The problem was the version of dgdecode.dll x64 I linked to earlier
Selur
23rd February 2019, 08:45
Using a 1280x720 source and:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DeCrawlFilter/DotKill/dotkill64.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import hysteria
import hnwvsfunc
import mvsfunc
# Loading E:\to convert\test.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="E:\to convert\test.mkv", format="YUV420P8", cache=0)
# making sure input color matrix is set as unspec
clip = core.resize.Point(clip, matrix_in_s="unspec",range_s="limited")
# making sure frame rate is set to 24000/1001
clip = core.std.AssumeFPS(clip, fpsnum=24000, fpsden=1001)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# DeCrawling using DotKill
clip = core.dotkill.DotKill(clip=clip, napply=3)
# removing grain using MLDegrain
clip = hnwvsfunc.MLDegrain(clip=clip, soft=[0,0,0])
# sharpening using FineSharp
clip = hnwvsfunc.FineSharp(clip=clip)
# line darkening using Hysteria
clip = hysteria.Hysteria(clip=clip,highthresh=10)
# Output
clip.set_output()
the memory usage is sky rocketing,... after ~10min, the RAM usage is > 11 GB and still increasing (15min 13GB+, 20min 16G+).
Is this something on my system, a known problem, or should I do some more testing and test these filters one by one?
Cu Selur
Ps.: What's the recommend way to limit the RAM usage?
PPs.: With growing memory usage 18GB+ now the CPU usage also drops, so this probably is one of the filters using more and more RAM and slowing down while handling that RAM.
=> GOT IT, problem is with DotKill, updating to the latest version of DotKill fixed it.
_Al_
24th February 2019, 01:46
Same is hapening with QTGMC (havsfunc) and there might be others. I just simply tell Vapoursynth to limit RAM,
some cross platform method, like in python:
mem = psutil.virtual_memory()
available = int(mem.available/1024/1024) #MB
cache = available - some_wiggle_room_value
core.max_cache_size = cache
Vapoursynth then releases RAM, if I watch usage it goes all the way to the limit and then it is drastically released. It cycles like that for a some short time - filled/released,filled/released but strangely, after some short time, it settles somewhere underneath that set limit. Almost like someone wrote that in some intelligent way, or it is a coincidence, not sure.
Selur
24th February 2019, 08:05
It's probably some filter with a memory leak.
Memory consumption doesn't run amok here when using 'QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True)', stays at around 4.3GB for Blu-ray content.
What QTGMC setting do you use?
Cu Selur
_Al_
24th February 2019, 20:37
Just Preset = "Slow"and TFF=True, but I am not complaining because I test things on my laptops which have ridiculous 4GB RAM. On the contrary by limiting RAM I am surprised that it works. Mostly there is about 1GB available for Vapoursynth. Sure performance is perhaps severely limited. Not sure now about workstation, but anyway for all scripts I limit RAM usage first, checking how much is available and setting available cache as a rule. So I might not even know, if RAM was leaking somewhere. I do not know how much control can Vapoursynth have above all those DLL's out there. Scripts are not crashing so I gather it kind of works.
poisondeathray
25th February 2019, 16:17
Same is hapening with QTGMC (havsfunc) and there might be others. I just simply tell Vapoursynth to limit RAM,
some cross platform method, like in python:
mem = psutil.virtual_memory()
available = int(mem.available/1024/1024) #MB
cache = available - some_wiggle_room_value
core.max_cache_size = cache
Vapoursynth then releases RAM, if I watch usage it goes all the way to the limit and then it is drastically released. It cycles like that for a some short time - filled/released,filled/released but strangely, after some short time, it settles somewhere underneath that set limit. Almost like someone wrote that in some intelligent way, or it is a coincidence, not sure.
I can't reproduce on x64 after 10 min . It just hovers around 1.2-1.3 GB RAM . Does not have characteristics of a memory leak
Maybe a problem with one of your plugin/filter dependencies ?
_Al_
2nd March 2019, 19:06
There might be, I'm also one version behind with Vapoursyth and Python 3.6. Simple script to deinterlace avchd.M2TS with about 1GB available, it takes about couple of seconds to freeze. If cache is limited, no problem.
file = r'C:\vid\avchd.M2TS'
from vapoursynth import core
import havsfunc as haf
#core.max_cache_size = 800 #this works
clip = core.lsmas.LWLibavSource(file)
clip = haf.QTGMC(clip, Preset='Slow', TFF=True)
clip.set_output()
asarian
2nd March 2019, 20:27
It's probably some filter with a memory leak.
Memory consumption doesn't run amok here when using 'QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True)', stays at around 4.3GB for Blu-ray content.
What QTGMC setting do you use?
Cu Selur
No memory leaks here on my end whatsoever. And I use QTGMC on a daily basis.
P.S. I see you're using 'opencl=True'. Interesting. :) Shouldn't be needed when you have 'Denoiser="KNLMeansCL"' in the parameters, though, right? Or does it something else too?
jackoneill
2nd March 2019, 22:29
There might be, I'm also one version behind with Vapoursyth and Python 3.6. Simple script to deinterlace avchd.M2TS with about 1GB available, it takes about couple of seconds to freeze. If cache is limited, no problem.
file = r'C:\vid\avchd.M2TS'
from vapoursynth import core
import havsfunc as haf
#core.max_cache_size = 800 #this works
clip = core.lsmas.LWLibavSource(file)
clip = haf.QTGMC(clip, Preset='Slow', TFF=True)
clip.set_output()
with about 1GB available
VapourSynth's cache will try to use more than that with high resolutions and complex scripts (QTGMC), at least until a few hundred frames have been processed. Then the cache figures out it doesn't need so much memory.
(The default max_cache_size is 4 GB on 64 bit systems and 1 GB on 32 bit systems.)
_Al_
3rd March 2019, 01:39
thanks, did not realize that simple print(core.max_cache_size) could give it away, which indeed gives 4096
Selur
3rd March 2019, 09:04
Shouldn't be needed when you have 'Denoiser="KNLMeansCL"' in the parameters, though, right? Or does it something else too?
OpenCL = True causes QTGMC to use NNEDI3CL instead of znedi3 (not sure atm. whether I did this modification myself in https://github.com/Selur/VapoursynthScriptsInHybrid/blob/master/havsfunc.py or not :))
asarian
3rd March 2019, 11:43
OpenCL = True causes QTGMC to use NNEDI3CL instead of znedi3 (not sure atm. whether I did this modification myself in https://github.com/Selur/VapoursynthScriptsInHybrid/blob/master/havsfunc.py or not :))
:thanks: Every cycle shaved off is one.
Dogway
4th March 2019, 15:31
Is there a way to indicate Script path location? I'm using VS in portable mode but VSEdit can't find the modules. I tried placing vapoursynth_modules.pth and sitecustomize.py in root folder but still no luck.
ChaosKing
4th March 2019, 15:40
One way is to append a path in python in your script:
scriptPath = os.getcwd() + "/../scripts"
sys.path.append(os.path.abspath(scriptPath))
Usually you can place scripts here: C:\Python37\Lib\site-packages\vapoursynth
If you're using a python embedded zip you can set a path in python37._pth
Dogway
4th March 2019, 16:08
I'm unable to load them, my scripts are in "C:\Program Files (x86)\VapourSynth_R45(x64)\vapoursynth64\scripts"
so I write in python37._pth the following.
vapoursynth64\scripts
Scripts
Lib\site-packages
python37.zip
.
# Uncomment to run site.main() automatically
#import site
For the script I write:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = core.ffms2.Source(r'D:\source.mp4')
clip = core.haf.SMDegrain(clip)
clip.set_output()
Edit: I'm the admin, so I have write access to Program Files.
Edit2: Ok, ok, it's clip = haf.SMDegrain(clip) without the core.
ChaosKing
4th March 2019, 16:54
And where is your python installation located? Have you tried with a full path?
Dogway
4th March 2019, 17:27
It's inside VapourSynth_R45(x64), embedded. It worked I just had to omit the core. namespace.
Too bad I didn't find your fatpack earlier, should be sticky. I will probably change to that once you update it to 2019 version.
I have a question though. When you load avisynth plugins or scripts into VapourSynth, will the performance be limited to that of avisynth or you get the benefits of better VS multithreading?
ChaosKing
4th March 2019, 17:34
Depends on the plugin. You will often see a msg with something like using slow method blah blah. Solution: use avsw.Eval() instead.
asarian
13th March 2019, 11:36
Odd. I have a source file of 624x354. But getting the following returned:
... line 3159, in MCTemporalDenoise
return core.std.Crop(smP, **crop_args)
File "src\cython\vapoursynth.pyx", line 1833, in vapoursynth.Function.__call__
vapoursynth.Error: Crop: cropped area needs to have mod 2 height offset
Wait, 354 is mod2, right?! Or am I going crazy? :)
Myrsloik
13th March 2019, 11:38
Odd. I have a source file of 624x354. But getting the following returned:
... line 3159, in MCTemporalDenoise
return core.std.Crop(smP, **crop_args)
File "src\cython\vapoursynth.pyx", line 1833, in vapoursynth.Function.__call__
vapoursynth.Error: Crop: cropped area needs to have mod 2 height offset
Wait, 354 is mod2, right?! Or am I going crazy? :)
You have to add a print at the point where it happens. The internal clip that's cropped in MCTemporalDenoise isn't necessarily the same as the input.
asarian
13th March 2019, 11:47
You have to add a print at the point where it happens. The internal clip that's cropped in MCTemporalDenoise isn't necessarily the same as the input.
Didn't realize that. :) :thanks:
Since this pertains to a pre-cropped area of a larger, 1080p source (so I can 'Oyster' it in several parts), I tried a 356 swatch, which didn't generate the error. So, I'll just go with that (it's mainly an overscan area anyway, as I only need a 346 height).
_Al_
14th March 2019, 22:07
Encoding using clip.output() right from vapoursynth script itself, where input video is ANY anamorphic video like HDV camcorder M2T video or NTSC DV or VOB gives jagged lines. As soon as there is resize involved , say to square pixel it is OK. If some odd resize is given , say 1000,600, again it might fail and jagged lines appear. That is not that important though because square pixel , resize to 16:9 (M2T video) or 4:3 (DVavi, VOB) seem to work. It encodes alright. Point is, without resize, just using SAR flag in encoder, gives jagged lines as presented in attachment.
Interlacing seem have nothing to do with it, using QTGMC or even assuming it as progressive using setFrameProp would not help. This behavior is also same using different source plugins.
import vapoursynth as vs
from vapoursynth import core
d2v_file = r"path to file ..."
clip = core.d2v.Source(d2v_file) #sourse was mpeg2 HDV camcorder video
import subprocess
import shutil
output = r'F:/Destination/test.264'
x264 = shutil.which('x264')
x264_cmd = [x264, '--frames', f'{len(clip)}',
'--input-csp', 'i420',
'--demuxer', 'raw',
'--sar', '4:3',
'--input-depth', '8',
'--input-res', f'{clip.width}x{clip.height}',
'--fps', f'{clip.fps_num}/{clip.fps_den}',
'--crf', '18',
'--colorprim', 'bt709',
'--transfer', 'bt709',
'--colormatrix', 'bt709',
'--output', output,
'-']
process = subprocess.Popen(x264_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
clip.output(process.stdin)
process.communicate()
for x265 the same:
x265_cmd = [x265, '--frames', f'{len(clip)}',
#'--input-csp', 'i420',
'--y4m',
'--input-depth', f'{clip.format.bits_per_sample}',
'--output-depth', f'{clip.format.bits_per_sample}',
'--input-res', f'{clip.width}x{clip.height}',
'--fps', f'{clip.fps_num}/{clip.fps_den}',
'--crf', f'{str(crf)}',
'--output', output,
'-']
process = subprocess.Popen(x265_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
clip.output(process.stdin, y4m = True, progress_update=progressupdate)
process.communicate()
Previewing script is always ok, encoding within VSEditor also, just not directly using that output() function.
_Al_
15th March 2019, 07:00
I might found a culprit, but not sure what to do with it or how to fix it.
for example NTSC video there is 1 byte per sample, if I get_stride for all three planes:
f = clip.get_frame(0)
print(f.get_stride(0),f.get_stride(1),f.get_stride(2))
I get:
736 384 384 (expected: 720 360 360)
for HDV video from HDV tape camcorder (shooting 1440x1080) I get:
1440 736 736 (expected: 1440 720 720)
after resize I get even values, like resizing NTSC video to 640x480 I'd get:
640 320 320
or resizing that HDV video to 1920x1080, I'd get:
1920 960 960
Those are expected numbers and encoding is also ok, so this looks like a cause to offset the output if resizing is not done. If I resize to the same resolution values stay the same, it would not help.
Is there any way to get those values even without resizing? What are those data that are trailing (or preceding) each line in plane array? If it is not stride itself (wrong value) that offsets things.
jackoneill
15th March 2019, 13:16
I might found a culprit, but not sure what to do with it or how to fix it.
for example NTSC video there is 1 byte per sample, if I get_stride for all three planes:
f = clip.get_frame(0)
print(f.get_stride(0),f.get_stride(1),f.get_stride(2))
I get:
736 384 384 (expected: 720 360 360)
for HDV video from HDV tape camcorder (shooting 1440x1080) I get:
1440 736 736 (expected: 1440 720 720)
after resize I get even values, like resizing NTSC video to 640x480 I'd get:
640 320 320
or resizing that HDV video to 1920x1080, I'd get:
1920 960 960
Those are expected numbers and encoding is also ok, so this looks like a cause to offset the output if resizing is not done. If I resize to the same resolution values stay the same, it would not help.
Is there any way to get those values even without resizing? What are those data that are trailing (or preceding) each line in plane array? If it is not stride itself (wrong value) that offsets things.
This is a known bug which will be fixed in the next release.
There was a bit of code in clip.output() which assumed that the width multiplied by bytes_per_sample is the same as the stride. This is only true when the width multiplied by bytes_per_sample is a multiple of 32.
This is why you have a problem with 720x___ but not with 1280x___, 1440x____ or 1920x____. 720 / 32 = 22.5; 1280 / 32 = 40; 1440 / 32 = 45; 1920 / 32 = 60.
The stride (the distance between two consecutive rows) is not always the same as the width multiplied by bytes_per_sample in order to make every row start at a memory location which is a multiple of 32. (The first row starts at a multiple of 32 because that's what VapourSynth requests from the memory allocator.) This apparently makes filters run faster. The extra (stride - width * bytes_per_sample) bytes are left unused.
_Al_
15th March 2019, 18:50
Thank you for explanation, now when it is clear it is even workable.
Width for output() function now has to be any even number x 32. Multiple of odd number would not work. So any width divided by 32 with even result would work.
Thank you.
Myrsloik
15th March 2019, 21:24
Thank you for explanation, now when it is clear it is even workable.
Width for output() function now has to be any even number x 32. Multiple of odd number would not work. So any width divided by 32 with even result would work.
Thank you.
This will be fixed in the next release
_Al_
15th March 2019, 21:36
Thank you,
that direct export is a fantastic feature where even progress update is available
asarian
16th March 2019, 00:14
Encoding using clip.output() right from vapoursynth script itself, where input video is ANY anamorphic video like HDV camcorder M2T video or NTSC DV or VOB gives jagged lines....
Some interesting script files you have there. :) Speaking of which, is there a variable for the running script name itself?
_Al_
16th March 2019, 01:02
Not sure if I understand, do you want to give it output name as script name?
You'd use __file__ variable, if you want just basename, you'd do something like:
import os
output_dir = r'F:\Destination'
output = os.path.join(output_dir, os.path.basename(__file__)+'.264')
In practical terms you'd perhaps always import your modul for encoding, you'd put that encoding part as a separate py file and put it in Python\Lib\vapoursynth directory and just import it as a modul in each script and run it. You couldpass the whole cmd line as a variable string and let that sorted out in that modul with shlex.split(cmd as a string) etc.
asarian
16th March 2019, 01:38
Not sure if I understand, do you want to give it output name as script name?
You'd use __file__ variable, if you want just basename, you'd do something like:
import os
output_dir = r'F:\Destination'
output = os.path.join(output_dir, os.path.basename(__file__)+'.264')
^^ That's exactly what I wanted to do! :) :thanks:
asarian
16th March 2019, 11:16
Thank you,
that direct export is a fantastic feature where even progress update is available
So, how do you call the script?! When I just try
'VSPipe f:\jobs\test.vpy'
It tells me 'No output file specified'
I must be doing it wrong. :)
_Al_
16th March 2019, 20:22
vspipe is another (perhaps preferred) way how to encode your script. It pipes frames into an encoder of your choice from OUTSIDE of vapoursynth script *.vpy or *.py,
but method from above, vapoursynth outpus raw frames directly from script itself, you bypass vspipe, but you need to have *.py, not *.vpy because you run Python basically , vapoursynth does its wrapping part in Python and serving frames with clip.output(). You just run script itself with this method and it will start encoding, you can choose a python consol of your choice (IDLE for example came with Python, so you should have it) and pressing F5 or even using VSEditor, but VS Editor needs clip.set_output(), otherwise it would not let script run, therefore encode (and then showing preview). If you want to avoid preview popup after encoding, you'd just evaluate script.
if you do not use a console and prefer windows command line, you'd need to run:
python3 "test.py"
or
python "test.py"
ChaosKing
17th March 2019, 14:36
Why is the avisynth RemoveDirt.dll only availible if the RemoveDirtVS_x64.dll is not autoloaded.
My steps
core.avs.LoadPlugin(r"D:\avs_plugins64\RemoveDirt.dll") # no loading error
But clip = core.avs.RestoreMotionBlocks(clip) is not availible
Checking with print(core.get_plugins()) confirms that com.fakeurl.removedirtvs is loaded but nothing with avisynth.
Now without RemoveDirtVS_x64.dll
core.avs.LoadPlugin(r"D:\avs_plugins64\RemoveDirt.dll")
print(core.get_plugins()) -> RestoreMotionBlocks is available 'com.vapoursynth.avisynth': {'namespace': 'avs', 'identifier': 'com.vapoursynth.avisynth', 'name': 'VapourSynth Avisynth Compatibility', 'functions': {'LoadPlugin': 'path:data;', 'RestoreMotionBlocks': 'c1:clip;c2:clip ...
So why is VS-RemoveDirt blocking the avisynth RemoveDirt functions?
VS and AVS dlls: https://www.dropbox.com/s/nkho8s2pjeuydqq/RemoveDirtVS.zip?dl=1
Iron_Mike
18th March 2019, 04:24
is it possible to output the version number of a loaded VS plugin ? if so, what is the command ?
Thanks.
Myrsloik
18th March 2019, 10:39
is it possible to output the version number of a loaded VS plugin ? if so, what is the command ?
Thanks.
There are no exported version numbers
asarian
18th March 2019, 22:47
vspipe is another (perhaps preferred) way how to encode your script. It pipes frames into an encoder of your choice from OUTSIDE of vapoursynth script *.vpy or *.py,
but method from above, vapoursynth outpus raw frames directly from script itself, you bypass vspipe, but you need to have *.py, not *.vpy because you run Python basically , vapoursynth does its wrapping part in Python and serving frames with clip.output(). You just run script itself with this method and it will start encoding, you can choose a python consol of your choice (IDLE for example came with Python, so you should have it) and pressing F5 or even using VSEditor, but VS Editor needs clip.set_output(), otherwise it would not let script run, therefore encode (and then showing preview). If you want to avoid preview popup after encoding, you'd just evaluate script.
if you do not use a console and prefer windows command line, you'd need to run:
python3 "test.py"
or
python "test.py"
Thank you! :)
ChaosKing
19th March 2019, 01:16
I have this "prop transfer" code:
def _Transfer(n, f):
fout = f[0].copy()
fout.props['_Diff'] = f[1].props['_Diff']
return fout
alt_clip = core.std.ModifyFrame(alt_clip, [alt_clip, alt_clip_butt], selector=_Transfer)
Is it possible to make _Transfer() more universal, like this _Transfer(n, f, prop_name), so I can pass any prop -> f[1].props[prop_name] ? If yes, how to call/pass it?
@Myrsloik have you seen my RemoveDirt post? https://forum.doom9.org/showthread.php?p=1869151#post1869151
WolframRhodium
19th March 2019, 05:13
I have this "prop transfer" code:
def _Transfer(n, f):
fout = f[0].copy()
fout.props['_Diff'] = f[1].props['_Diff']
return fout
alt_clip = core.std.ModifyFrame(alt_clip, [alt_clip, alt_clip_butt], selector=_Transfer)
Is it possible to make _Transfer() more universal, like this _Transfer(n, f, prop_name), so I can pass any prop -> f[1].props[prop_name] ? If yes, how to call/pass it?
from functools import partial
def _Transfer(n, f, prop_name):
fout = f[0].copy()
fout.props[prop_name] = f[1].props[prop_name]
return fout
alt_clip = core.std.ModifyFrame(alt_clip, [alt_clip, alt_clip_butt], selector=partial(_Transfer, prop_name="_Diff"))
ChaosKing
19th March 2019, 10:44
Exactly what I wanted, perfect :thanks:
lansing
19th March 2019, 15:07
When I try to extract planes and merge them back together, I got error "ShufflePlanes: Plane 1 and 2 are not subsampled multiples of first plane"?
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV420P16)
y_clip = core.std.ShufflePlanes(clip_yuv16 , planes=0, colorfamily=vs.YUV)
u_clip = core.std.ShufflePlanes(clip_yuv16 , planes=1, colorfamily=vs.YUV)
v_clip = core.std.ShufflePlanes(clip_yuv16 , planes=2, colorfamily=vs.YUV)
yuv16_new = core.std.ShufflePlanes(clips=[y_clip, u_clip, v_clip], planes=[0,0,0], colorfamily=vs.YUV)
Wolfberry
19th March 2019, 15:35
When I try to extract planes and merge them back together, I got error "ShufflePlanes: Plane 1 and 2 are not subsampled multiples of first plane"?
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV420P16)
y_clip = core.std.ShufflePlanes(clip_yuv16 , planes=0, colorfamily=vs.YUV) ←
u_clip = core.std.ShufflePlanes(clip_yuv16 , planes=1, colorfamily=vs.YUV) ←
v_clip = core.std.ShufflePlanes(clip_yuv16 , planes=2, colorfamily=vs.YUV) ←
yuv16_new = core.std.ShufflePlanes(clips=[y_clip, u_clip, v_clip], planes=[0,0,0], colorfamily=vs.YUV)
You need to use GRAY (not YUV) if you want to extract individual planes.
lansing
19th March 2019, 15:51
You need to use GRAY (not YUV) if you want to extract individual planes.
Thanks it works
Selur
27th March 2019, 20:17
I'm wondering could someone adjust https://github.com/HENDRIX-ZT2/Deep-Video-Deinterlacing to be used as a Vapoursynth filter? sounds interesting,..
lansing
30th March 2019, 00:40
When I use the vcmove rotate function, vs doesn't flush the memory after I close the preview in the editor.
clip = core.ffms2.Source(video_file)
rotate = core.vcmove.Rotate(clip, clip, angle=45)
rotate.set_output()
I got this message
Core freed but 4838400 bytes still allocated in framebuffers
Myrsloik
30th March 2019, 00:54
When I use the vcmove rotate function, vs doesn't flush the memory after I close the preview in the editor.
clip = core.ffms2.Source(video_file)
rotate = core.vcmove.Rotate(clip, clip, angle=45)
rotate.set_output()
I got this message
Core freed but 4838400 bytes still allocated in framebuffers
It's a vcmove bug. Report it to the author. The frame reference bkg in line 144 of moveRotate.cpp is never freed. Other operations may have the same typo so check all filters.
lansing
30th March 2019, 00:59
It's a vcmove bug. Report it to the author. The frame reference bkg in line 144 of moveRotate.cpp is never freed. Other operations may have the same typo so check all filters.
Okay.
thedangle
7th April 2019, 21:18
Not sure if this is a VS or waifu2x caffe thing, but using scripts with caffe seems to cause large amounts of virtual memory to be committed, even with core.max_cache_size set to 5124. Physical memory use seems to adhere to the memory limit, though, even if there's about 6gb of "available" physical memory and 3gb free VRAM.
I'd just ignore it since memory is meant to be used anyway but when it hits my commit cap virtualdub64 crashes. Example script (source res is 720x480):
import vapoursynth as vs
import havsfunc as haf
import adjust
from vapoursynth import core
core.num_threads = 8
core.max_cache_size = 5124
clp = core.lsmas.LWLibavSource(r'test.avi',threads=8)
clp = adjust.Tweak(clp,sat=1.05)
clp = core.fft3dfilter.FFT3DFilter(clp, sigma = 2.2, planes=[1,2])
clp = core.pp7.DeblockPP7(clp, qp=1.8, mode=2)
clp = core.fmtc.matrix (clp, mat="601",col_fam=vs.RGB)
clp = core.fmtc.bitdepth (clp,bits=32,dmode=0)
clp = core.caffe.Waifu2x(clp, noise=2, model=6, scale=2, block_w=320, block_h=240, cudnn=True, tta=False, batch=3) # crashes at 720 wblock
clp = core.fmtc.bitdepth(clp, bits=16,dmode=0)
clp = core.knlm.KNLMeansCL(clp, d=0, a=12, s=0, h=.23, wmode=0)
clp = core.f3kdb.Deband(clp,random_algo_ref=2,random_algo_grain=2,blur_first=True,dynamic_grain=True,sample_mode=1,range=16,dither_algo=1,y=64,cb=80,cr=80,grainy=0,grainc=0,output_depth=16)
clp.set_output()
Looking at it further it seems windows 10 considers vram use as part of total usable memory, but does not add it to the calculation of max memory available. For example if I have 16gb ram, 6gb virtual memory and 8gb vram, my commit max is only 22gb, but if I use 8gb of vram and 1gb of ram windows considers 9gb of memory committed. Maybe this is working as intended? Not sure how separate pools are handled.
Tima
16th April 2019, 15:05
DoubleWeave doesn't seem to pick up field props:
DoubleWeave: field order could not be determined from frame properties
import vapoursynth as vs
import havsfunc as haf
import nextfunc as nextf
core = vs.get_core()
std = core.std
clip = core.avisource.AVISource(src)
clip = std.SetFieldBased(clip, 2)
woven = std.DoubleWeave(clip)
clip = std.SelectEvery(woven, 2, 0)
clip.set_output()
poisondeathray
16th April 2019, 15:17
@Tima - if your AVI clip doesn't have field order in the file metadata, you can set the frame props
clip = core.std.SetFrameProp(clip, prop="_FieldBased", intval=0) #0=frame based (progressive), 1=bottom field first, 2=top field first.
jackoneill
16th April 2019, 20:42
Until R46 you will have to avoid using DoubleWeave's tff parameter. If you use it and the _Field property is not present/usable, DoubleWeave will swap the fields. Or I guess you can say tff=1 when you mean tff=0, and vice versa, but then your script will break when R46 appears.
A solution that will work both before and after R46 is to set the _Field property:
clip = core.avisource.AVISource(src)
tff = True
even = clip.std.SelectEvery(cycle=2, offsets=0)
even = even.std.SetFrameProp(prop="_Field", intval=tff)
odd = clip.std.SelectEvery(cycle=2, offsets=1)
odd = odd.std.SetFrameProp(prop="_Field", intval=not tff)
clip = std.Interleave(clips=[even, odd])
clip = clip.DoubleWeave()
zorr
16th April 2019, 22:07
Would it be possible to add 'pop' or some other means to remove the top of the stack in Expr. I'm trying to make a sorting algorithm and it's kinda hard without that instruction. Well, it's not exactly easy with it either, sorting 5 values will take about 100 instructions, but at least it would be possible... :D
Myrsloik
17th April 2019, 10:44
Would it be possible to add 'pop' or some other means to remove the top of the stack in Expr. I'm trying to make a sorting algorithm and it's kinda hard without that instruction. Well, it's not exactly easy with it either, sorting 5 values will take about 100 instructions, but at least it would be possible... :D
At this point I'm surprised you don't propose a special sorting instruction. Something like "v1 v2 v3 v4 <number of previous values to sort on the stack> sortasc/sortdesc".
Also consider using a real compiler. If you have the patience to sort things using Expr then you should find that plugin writing isn't that bad.
zorr
18th April 2019, 00:12
At this point I'm surprised you don't propose a special sorting instruction. Something like "v1 v2 v3 v4 <number of previous values to sort on the stack> sortasc/sortdesc".
Yes, that would be awesome! :D I did consider it but I know you're a busy guy. But if you're willing to entertain the idea of aggregate functions then I do think they would make Expr more... Expressive and useful. Median would be useful too (hard to implement), perhaps even a reverse (of top n values). The syntax you proposed seems good. Or you could do it in the style of SwapN and there would be Sort2, Sort3 etc.
Also consider using a real compiler. If you have the patience to sort things using Expr then you should find that plugin writing isn't that bad.
Not knowing much about the plugin development I think that would be quite a lot more time consuming endeavour than fiddling with the stack. But yeah, 100 instructions is not going to be too hot performance-wise when applied to every pixel... Are there good tutorials / introductions to VapourSynth plugin development? There was a reference to SDK directory, is that part of the full installation package only (didn't find it in the FATPACK)?
AzraelNewtype
21st April 2019, 00:10
Until R46 you will have to avoid using DoubleWeave's tff parameter. If you use it and the _Field property is not present/usable, DoubleWeave will swap the fields. Or I guess you can say tff=1 when you mean tff=0, and vice versa, but then your script will break when R46 appears.
A solution that will work both before and after R46 is to set the _Field property:
clip = core.avisource.AVISource(src)
tff = True
even = clip.std.SelectEvery(cycle=2, offsets=0)
even = even.std.SetFrameProp(prop="_Field", intval=tff)
odd = clip.std.SelectEvery(cycle=2, offsets=1)
odd = odd.std.SetFrameProp(prop="_Field", intval=not tff)
clip = std.Interleave(clips=[even, odd])
clip = clip.DoubleWeave()
Using SetFrameProp in this manner is throwing the exact error it was supposed to be avoiding. DoubleWeave only does anything at all if I set tff explicitly.
jackoneill
21st April 2019, 11:21
Using SetFrameProp in this manner is throwing the exact error it was supposed to be avoiding. DoubleWeave only does anything at all if I set tff explicitly.
I can't see any problem there. What does your script look like?
AzraelNewtype
21st April 2019, 17:48
res = core.std.Interleave(clips=[re, ro])
res = res.std.SeparateFields(True)
res = res.std.SelectEvery(cycle=4, offsets=[2, 1])
res = res.std.SetFrameProp(prop="_Field", intval=1)
# res = res.text.FrameProps()
# res = res.std.SetFrameProp(prop="_FieldBased", intval=2)
# res = res.std.SetFieldBased(2)
res = res.std.DoubleWeave(tff=False)[::2]
It sets the prop just fine, but taking out the explicit tff=False and or using any of the commented lines instead/in addition just reports that it can't figure out field order from frame properties.
Edit: and of course I've just realized that I probably should have set this at the re/ro level one top and one bottom, because _Field and _FieldBased aren't really saying the same thing.
jackoneill
28th April 2019, 16:24
VapourSynth works in Wine now. Maybe this is of interest to someone.
I was able to use 64 bit VSEdit r19 with VapourSynth r45 portable and Python 3.7.3 portable in Wine 4.3.
ChaosKing
29th April 2019, 13:09
How fast/slow is it compared to Windows?
jackoneill
29th April 2019, 17:09
How fast/slow is it compared to Windows?
I don't know. I don't have Windows on this computer. I assume it's mostly the same once it's started. Wine takes a second or two to start up.
lansing
10th May 2019, 09:21
I'm trying to mass apply hundreds of lut files to segments of a clip. I ran a test loading 100 lut files in the script, each lut file is about 8MB, and it took a minute 45 seconds to load, that is not good. Considering the size of 300/400 lut will take over 5 minutes and more. Can I improve the loading speed with some lazy loading?
path = r"my file path"
file_list = os.listdir(path) # saving the lut file names to an array
clip = core.lsmas.LWLibavSource(file)
clip = clip[0:990]
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGBS)
accu_file = core.std.BlankClip(rgb_clip, length=1) #dummy initial file for concat
for cube_file, frame in zip(file_list, range(0, 991, 10)):
cube_file_path = path + '//' + cube_file
accu_file += core.timecube.Cube(rgb_clip[frame: frame+10], cube=cube_file_path)
accu_file.set_output()
WolframRhodium
10th May 2019, 11:32
I'm trying to mass apply hundreds of lut files to segments of a clip. I ran a test loading 100 lut files in the script, each lut file is about 8MB, and it took a minute 45 seconds to load, that is not good. Considering the size of 300/400 lut will take over 5 minutes and more. Can I improve the loading speed with some lazy loading?
path = r"my file path"
file_list = os.listdir(path) # saving the lut file names to an array
clip = core.lsmas.LWLibavSource(file)
clip = clip[0:990]
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGBS)
accu_file = core.std.BlankClip(rgb_clip, length=1) #dummy initial file for concat
for cube_file, frame in zip(file_list, range(0, 991, 10)):
cube_file_path = path + '//' + cube_file
accu_file += core.timecube.Cube(rgb_clip[frame: frame+10], cube=cube_file_path)
accu_file.set_output()
Does FrameEval() work?
from functools import partial
def apply_lut(n, f, clip, file_list):
cube_file = file_list[n % 10]
cube_file_path = path + '//' + cube_file
return core.timecube.Cube(clip, cube=cube_file_path)
accu_file = core.std.FrameEval(rgb_clip, partial(apply_lut, clip=rgb_clip, file_list=file_list))
lansing
10th May 2019, 17:26
Does FrameEval() work?
from functools import partial
def apply_lut(n, f, clip, file_list):
cube_file = file_list[n % 10]
cube_file_path = path + '//' + cube_file
return core.timecube.Cube(clip, cube=cube_file_path)
accu_file = core.std.FrameEval(rgb_clip, partial(apply_lut, clip=rgb_clip, file_list=file_list))
Thanks, this works when take out the "f" from the function. Each frame took about a second to load now. But can I make it even more faster? Since one cube file would be applied to a range of frames, so the same cube doesn't have to be reloaded again on frames that lie within that range.
WolframRhodium
10th May 2019, 19:03
Thanks, this works when take out the "f" from the function. Each frame took about a second to load now. But can I make it even more faster? Since one cube file would be applied to a range of frames, so the same cube doesn't have to be reloaded again on frames that lie within that range.
One of the solutions is to stack frames together:
from functools import partial
rgb_clip_stacked = core.std.StackVertical([rgb_clip[i::10] for i in range(10)])
h = rgb_clip.height
sh = rgb_clip_stacked.height
def apply_lut(n, clip, file_list):
cube_file = file_list[n]
cube_file_path = path + '//' + cube_file
return core.timecube.Cube(clip, cube=cube_file_path)
accu_file_stacked = core.std.FrameEval(
rgb_clip_stacked,
partial(apply_lut, clip=rgb_clip_stacked, file_list=file_list)
)
accu_file = core.std.Interleave(
[core.std.Crop(accu_file_stacked, top=h*i, bottom=sh-h*(i+1)) for i in range(10)]
)
lansing
10th May 2019, 20:34
One of the solutions is to stack frames together:
from functools import partial
rgb_clip_stacked = core.std.StackVertical([rgb_clip[i::10] for i in range(10)])
h = rgb_clip.height
sh = rgb_clip_stacked.height
def apply_lut(n, clip, file_list):
cube_file = file_list[n]
cube_file_path = path + '//' + cube_file
return core.timecube.Cube(clip, cube=cube_file_path)
accu_file_stacked = core.std.FrameEval(
rgb_clip_stacked,
partial(apply_lut, clip=rgb_clip_stacked, file_list=file_list)
)
accu_file = core.std.Interleave(
[core.std.Crop(accu_file_stacked, top=h*i, bottom=sh-h*(i+1)) for i in range(10)]
)
This will explode the memory in seconds. Stacking 10 frames of 1920x1080 here already took up 1GB of memory. In real life each segments would have around 200 frames.
jackoneill
11th May 2019, 07:45
Can I improve the loading speed with some lazy loading?
path = r"my file path"
file_list = os.listdir(path) # saving the lut file names to an array
clip = core.lsmas.LWLibavSource(file)
clip = clip[0:990]
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGBS)
accu_file = core.std.BlankClip(rgb_clip, length=1) #dummy initial file for concat
for cube_file, frame in zip(file_list, range(0, 991, 10)):
cube_file_path = path + '//' + cube_file
accu_file += core.timecube.Cube(rgb_clip[frame: frame+10], cube=cube_file_path)
accu_file.set_output()
Instead of using vspipe, maybe you could use clip.output() in a loop. Then you might achieve lazy loading.
lansing
11th May 2019, 14:18
Instead of using vspipe, maybe you could use clip.output() in a loop. Then you might achieve lazy loading.
WolframRhodium's solution with FrameEval() is lazy loading, but what kills it is the startup time for the timecube, as each call took a second to load.
What I'm thinking now is maybe I can have a temp clip file on the top level and then inside the callback function use "global" to get that file into the function and update it on some logic? Something like this:
temp_clip = clip
def apply_lut(n, clip, file_list):
global temp_clip
if n > blah:
temp_clip = core.timecube.Cube(clip, cube=cube_file_path)
return core.timecube.Cube(clip, cube=cube_file_path)
if n < blah and n > blah:
return temp_clip
else:
return clip
accu_file = core.std.FrameEval(rgb_clip, partial(apply_lut, clip=rgb_clip, file_list=file_list))
lansing
12th May 2019, 16:56
How can I print out log right in the script for debugging? I called print(some_string) and it's not outputting anything in the log of the editor.
LoRd_MuldeR
12th May 2019, 17:54
After learning, the hard way, that VapourSynth (vspipe.exe) requires the environment variable %USERPROFILE% to be set correctly – otherwise loading of plugins that have been installed via VSRepo will fail – I was wondering why VapourSynth relies on %USERPROFILE% to deduce the location of the <AppData> directory. Wouldn't it be more obvious and more reliable to look at %APPDATA% instead? Sure, most of the time the path of <AppData> will be equal to "<UserProfile>\AppData\Roaming", but I think we can not really rely on that. If there exists a dedicated environment variable for <AppData>, why not make use of it? And, maybe, fall back "<UserProfile>\AppData\Roaming", if either %APPDATA% is not set or the specified path does not exist. Or even better: Don't rely on environment variables at all (you never know what some user has set up here!), but rather use the SHGetKnownFolderPath() system function?
https://i.imgur.com/09jRinm.png
How can I print out log right in the script for debugging? I called print(some_string) and it's not outputting anything in the log of the editor.
naming script *.py, not *.vpy and running that script from any Python console, like IDLE etc.
Myrsloik
12th May 2019, 20:45
...
I don't use environment variables. I only use this code to retrieve the path:SHGetFolderPath(nullptr, CSIDL_APPDATA, nullptr, SHGFP_TYPE_CURRENT, appDataBuffer.data());
Of course it doesn't mean windows itself won't implement it by using %USERPROFILE% behind the scenes anyway. I guess.
LoRd_MuldeR
12th May 2019, 22:29
Of course it doesn't mean windows itself won't implement it by using %USERPROFILE% behind the scenes anyway. I guess.
You are right. My test shows that SHGetFolderPath() with parameters CSIDL_APPDATA and SHGFP_TYPE_CURRENT fails, if environment variable %USERPROFILE% is set to the wrong directory.
There is no such problem, if %USERPROFILE% is not set at all. Furthermore, if %USERPROFILE% is set to the wrong directory, SHGetFolderPath() with parameters CSIDL_APPDATA and SHGFP_TYPE_DEFAULT works.
Interestingly, SHGetFolderPath() with parameters CSIDL_PROFILE does not seem to care about %USERPROFILE% at all :confused:
My conclusion for now: If call SHGetFolderPath() with parameters CSIDL_APPDATA and SHGFP_TYPE_CURRENT has failed, then we should retry with SHGFP_TYPE_DEFAULT flag.
lansing
13th May 2019, 00:16
naming script *.py, not *.vpy and running that script from any Python console, like IDLE etc.
It doesn't work when I'm calling print inside a callback function that was used in FrameEval().
WolframRhodium
13th May 2019, 01:00
It doesn't work when I'm calling print inside a callback function that was used in FrameEval().
You can print values in vsedit by raising an exception.
lansing
13th May 2019, 01:43
You can print values in vsedit by raising an exception.
How do I do that?
It doesn't work when I'm calling print inside a callback function that was used in FrameEval().
you have to request actual frames, because if you do not preview it, nothing is happening, so at the end of your script you can add:
for frame in range(0, len(accu_file)):
accu_file.get_frame(frame)
lansing
13th May 2019, 09:43
you have to request actual frames, because if you do not preview it, nothing is happening, so at the end of your script you can add:
for frame in range(0, len(accu_file)):
accu_file.get_frame(frame)
This is only for sequential reading, I'm trying to find out a problem caused by reading backward.
that loop could be reversed
for frame in reversed(range(0, len(accu_file))):
accu_file.get_frame(frame)
or just clip could be reversed before that loop:
accu_file=accu_file[::-1]
Natty
17th May 2019, 00:08
is there a function in vs similar to avs's function setmemorymax()
i read http://www.vapoursynth.com/doc/ but couldn't find.
having issues of very high ram usage
gonca
17th May 2019, 00:39
is there a function in vs similar to avs's function setmemorymax()
i read http://www.vapoursynth.com/doc/ but couldn't find.
having issues of very high ram usage
Try
core.max_cache_size =xxxx
aldix
17th May 2019, 01:50
dear all,
been away for long, but figured i'll finally take up python/vapoursynth.
however, been messing around and having problems with an avisynth encoding script i'm trying to port over whole day.
and now i just can't wrap my head around what i'm doing wrong. script itself is pieced together from what i've found here based on the plugins i need to use.
import os
import sys
import vapoursynth as vs
scriptPath = "C:/vapoursynth editor r19 64bit/scripts/"
sys.path.append(os.path.abspath(scriptPath)
import finesharp as finesharp
import dehalo_alpha as dehalo_alpha
core = vs.get_core()
clip = core.ffms2.Source("c:/temp/video.mkv")
clip = core.fmtc.resample(clip,w="1280",h="720", kernel="blackmanminlobe", taps="4")
src_clip = core.mv.Super(clip,pel="1", sharp="2", rfilter="2")
shp = finesharp.sharpen(src_clip,mode=3)
bv1 = core.mv.analyse(src_clip,isb="True",delta="1",overlap="8",blksize="16",truemotion="False",search="5",chroma="True")
fv1 = core.mv.analyse(src_clip,isb="False",delta="1",overlap="8",blksize="16",truemotion="False",search="5",chroma="True")
video = core.mv.Degrain1(clip,src_clip,bv1,fv1,thsad="85")
video = dehalo_alpha(self,video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
video = core.f3kdb.Deband(video,sample_mode="2",dynamic_grain="False",keep_tv_range="False",dither_algo="3",input_depth="8",output_depth="8",y="48",cb="48",cr="48",grainY="48",grainC="48")
video.set_output()
Failed to evaluate the script:
Python exception: invalid syntax (C:/vapoursynth editor r19 64bit/GoT_python_test.vpy, line 6)
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1924, in vapoursynth.vpy_evaluateScript
File "C:/vapoursynth editor r19 64bit/test.vpy", line 6
import finesharp as finesharp
^
SyntaxError: invalid syntax
thank you so much in advance!
gonca
17th May 2019, 02:32
scriptPath = "C:/vapoursynth editor r19 64bit/scripts/"
This might be an issue "/"
aldix
17th May 2019, 02:47
right. i also started to think that maybe spaces shouldn't be there so i made a new folder.
however, even if i remove the "/" i still get an error, just a different one now. any idea?
Failed to evaluate the script:
Python exception: No module named 'finesharp'
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 "C:/vapoursynth editor r19 64bit/test.vpy", line 6, in
import finesharp as finesharp
ModuleNotFoundError: No module named 'finesharp'
sys.path.append(os.path.abspath(scriptPath)) # parentheses is missing
aldix
17th May 2019, 03:14
yup, i've meanwhile spotted that, too, and corrected.
this is the most recent script:
import os
import sys
import vapoursynth as vs
scriptPath = "C:/vapoursynth_scripts"
sys.path.append(os.path.abspath(scriptPath))
import finesharp as finesharp
import dehalo_alpha as dehalo_alpha
core = vs.get_core()
clip = core.ffms2.Source("c:/temp/video.mkv")
clip = core.fmtc.resample(clip,w="1280",h="720", kernel="blackmanminlobe", taps="4")
src_clip = core.mv.Super(clip,pel="1", sharp="2", rfilter="2")
shp = finesharp.sharpen(src_clip,mode=3)
bv1 = core.mv.analyse(src_clip,isb="True",delta="1",overlap="8",blksize="16",truemotion="False",search="5",chroma="True")
fv1 = core.mv.analyse(src_clip,isb="False",delta="1",overlap="8",blksize="16",truemotion="False",search="5",chroma="True")
video = core.mv.Degrain1(clip,src_clip,bv1,fv1,thsad="85")
video = dehalo_alpha(self,video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
video = core.f3kdb.Deband(video,sample_mode="2",dynamic_grain="False",keep_tv_range="False",dither_algo="3",input_depth="8",output_depth="8",y="48",cb="48",cr="48",grainY="48",grainC="48")
video.set_output()
i'm still getting the error cited above.
thanks!
stax76
17th May 2019, 03:21
Maybe you can install finesharp with vsrepo or vsrepogui.
finesharp.py has to exist and be either in working directory or put it in Lib\site-packages directory
you can put all py moduls into that directory so they are always available for Python for any script:
C:\Users\your-user-name\AppData\Local\Programs\Python\Python37\Lib\site-packages\vapoursynth
aldix
17th May 2019, 03:39
finesharp.py has to exist and be either in working directory or put it in Lib\site-packages directory
you can put all py moduls into that directory so they are always available for Python for any script:
C:\Users\your-user-name\AppData\Local\Programs\Python\Python37\Lib\site-packages\vapoursynth
hmm, interesting, thank you a lot. this did help me move past those errors but on toward new ones.
script with newest corrections. (e.g., should be Analyse, not analyse). also removed chroma="True" cos for some reason it shouted at that. it does keep at it with other stuff, though, so. o.O
import os
import sys
import vapoursynth as vs
scriptPath = "C:/vapoursynth_scripts"
sys.path.append(os.path.abspath(scriptPath))
import finesharp as finesharp
import dehalo_alpha as dehalo_alpha
core = vs.get_core()
clip = core.ffms2.Source("c:/temp/video.mkv")
clip = core.fmtc.resample(clip,w="1280",h="720", kernel="blackmanminlobe", taps="4")
src_clip = core.mv.Super(clip,pel="1", sharp="2", rfilter="2")
shp = finesharp.sharpen(src_clip,mode=3)
bv1 = core.mv.Analyse(src_clip,isb="True",delta="1",overlap="8",blksize="16",truemotion="False",search="5")
fv1 = core.mv.Analyse(src_clip,isb="False",delta="1",overlap="8",blksize="16",truemotion="False",search="5")
video = core.mv.Degrain1(clip,src_clip,bv1,fv1,thsad="85")
video = dehalo_alpha(self,video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
video = core.f3kdb.Deband(video,sample_mode="2",dynamic_grain="False",keep_tv_range="False",dither_algo="3",input_depth="8",output_depth="8",y="48",cb="48",cr="48",grainY="48",grainC="48")
video.set_output()
...and new error.
2019-05-17 05:37:16.593
Failed to evaluate the script:
Python exception: invalid literal for int() with base 10: 'True'
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 "C:/vapoursynth editor r19 64bit/test.vpy", line 13, in
bv1 = core.mv.Analyse(src_clip,isb="True",delta="1",overlap="8",blksize="16",truemotion="False",search="5")
File "src\cython\vapoursynth.pyx", line 1813, in vapoursynth.Function.__call__
File "src\cython\vapoursynth.pyx", line 638, in vapoursynth.typedDictToMap
ValueError: invalid literal for int() with base 10: 'True'
2019-05-17 05:37:16.698
Core freed but 6 filter instance(s) still exist
Core freed but 6 filter instance(s) still exist
wut now? :/
aldix
17th May 2019, 03:44
huh.
looks like it didn't like quotes in the core.mv.Analyse call. removing them fixed this particular issue. fascinating stuff!
bv1 = core.mv.Analyse(src_clip,isb=True,delta=1,overlap=8,blksize=16,truemotion=False,search=5,chroma=True)
fv1 = core.mv.Analyse(src_clip,isb=False,delta=1,overlap=8,blksize=16,truemotion=False,search=5,chroma=True)
shouted at the "self" in the dehalo_alpha call. removed it. and now it's this:
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 "C:/vapoursynth editor r19 64bit/test.vpy", line 16, in
video = dehalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
TypeError: 'module' object is not callable
Python can use argument values as :
string, value ="something"
bool, value =True or value=False
int, (integer) value=2
float, value=0.8
so you can fix your script accordingly removing those quotes, only string uses quotes
also if you find "self" in a code it is a sort of giveaway there might be a class constructed within that modul
if this is the modul https://github.com/darealshinji/vapoursynth-plugins/blob/master/scripts/dehalo_alpha.py
you need to instantiate Python class DeHalo_alpha first to access dehalo_alpha function:
my_dehalo = dehalo_alpha.DeHalo_alpha() #DeHalo_alpha is attribute of that dehalo_alpha py script
video = my_dehalo.dehalo_alpha(video,rx=1.1,ry=1.1,brightstr=0.8,ss=1.5) #now dehalo_alpha is an attribute of DeHalo_alpha script
not knowing if it is functional, just trying to get Python syntax straight,
note: there is three different things called the same: Python modul, then class name (first letter is upper case) and then that class attribute(function). Python is case sensitive so as far Python is concerned, it is not the same, classes usually have first letter upper case.
stax76
17th May 2019, 12:44
In this thread there is someone who is not able to get VapourSynth running:
https://forum.doom9.org/showthread.php?p=1874637#post1874637
Is there any diagnostic tool like avsmeter?
ChaosKing
17th May 2019, 12:48
I made a simple wrapper around LoadPlugin() https://github.com/theChaosCoder/vapoursynth-plugin-check/blob/master/vs_plugin_check.py
error 193 means a 32bit dll is used with VS 64bit, in this case ffms2.dll
stax76
17th May 2019, 13:26
@ChaosKing
Thanks, I suggested running the script and hope he can make it work.
aldix
17th May 2019, 15:10
thank you for the replies.
i'm not sure what i'm supposed to do with the wrapper thing, though. add it to the script?
i did do what @_AI_ suggested, with the addition of "core" at front (and changing the calling of core earlier than before), but it just ends up showing new error msgs... any more advice?
import os
import sys
import vapoursynth as vs
scriptPath = "C:/vapoursynth_scripts"
sys.path.append(os.path.abspath(scriptPath))
import finesharp as finesharp
import dehalo_alpha as dehalo_alpha
core = vs.get_core()
my_dehalo = core.dehalo_alpha.DeHalo_alpha()
clip = core.ffms2.Source("c:/temp/video.mkv")
clip = core.fmtc.resample(clip,w="1280",h="720", kernel="blackmanminlobe", taps="4")
src_clip = core.mv.Super(clip,pel="1", sharp="2", rfilter="2")
shp = finesharp.sharpen(src_clip,mode=3)
bv1 = core.mv.Analyse(src_clip,isb=True,delta=1,overlap=8,blksize=16,truemotion=False,search=5,chroma=True)
fv1 = core.mv.Analyse(src_clip,isb=False,delta=1,overlap=8,blksize=16,truemotion=False,search=5,chroma=True)
video = core.mv.Degrain1(clip,src_clip,bv1,fv1,thsad="85")
video = my_dehalo.dehalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
video = core.f3kdb.Deband(video,sample_mode="2",dynamic_grain="False",keep_tv_range="False",dither_algo="3",input_depth="8",output_depth="8",y="48",cb="48",cr="48",grainY="48",grainC="48")
video.set_output()
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 "C:/vapoursynth editor r19 64bit/test.vpy", line 9, in
my_dehalo = core.dehalo_alpha.DeHalo_alpha()
File "src\cython\vapoursynth.pyx", line 1522, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name dehalo_alpha exists. Did you mistype a plugin namespace?
ChaosKing
17th May 2019, 15:23
Just download/install this https://github.com/HomeOfVapourSynthEvolution/havsfunc/blob/master/havsfunc.py and use it like this
import havsfunc as haf
clip = haf.DeHalo_alpha(clip)
aldix
17th May 2019, 17:39
thank you so much! it's really fascinating to build this new 'system' up from scratch, as it were, hehe.
now i'm so far, there are still new errors, though:
import os
import sys
import vapoursynth as vs
core = vs.get_core()
#scriptPath = "C:/vapoursynth_scripts"
#sys.path.append(os.path.abspath(scriptPath))
#my_dehalo = core.DeHalo_alpha.dehalo_alpha()
import finesharp as finesharp
import mvsfunc as mvsfunc
import adjust as adjust
import havsfunc as haf
#import dehalo_alpha as dehalo_alpha
clip = core.ffms2.Source("c:/temp/video.mkv")
clip = core.fmtc.resample(clip,w="1280",h="720", kernel="blackmanminlobe", taps="4")
src_clip = core.mv.Super(clip,pel="1", sharp="2", rfilter="2")
shp = finesharp.sharpen(src_clip,mode=3)
bv1 = core.mv.Analyse(src_clip,isb=True,delta=1,overlap=8,blksize=16,truemotion=False,search=5,chroma=True)
fv1 = core.mv.Analyse(src_clip,isb=False,delta=1,overlap=8,blksize=16,truemotion=False,search=5,chroma=True)
video = core.mv.Degrain1(clip,src_clip,bv1,fv1,thsad="85")
video = haf.DeHalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
video = core.f3kdb.Deband(video,sample_mode=2,dynamic_grain=False,keep_tv_range=False,dither_algo=3,output_depth=8,y=48,cb=48,cr=48,grainY=48,grainC=48)
video.set_output()
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 "C:/vapoursynth editor r19 64bit/test.vpy", line 20, in
video = haf.DeHalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\vapoursynth\havsfunc.py", line 408, in DeHalo_alpha
halos = core.resize.Bicubic(clp, m4(ox / rx), m4(oy / ry)).resize.Bicubic(ox, oy, filter_param_a=1, filter_param_b=0)
TypeError: unsupported operand type(s) for /: 'int' and 'str'
am i doing something wrong, or what?
stax76
17th May 2019, 17:51
video = haf.DeHalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
you are passing strings instead of floats
edit:
try:
video = haf.DeHalo_alpha(video, rx = 1.1, ry = 1.1, brightstr = 0.8, ss = 1.5)
aldix
17th May 2019, 20:14
video = haf.DeHalo_alpha(video,rx="1.1",ry="1.1",brightstr="0.8",ss="1.5")
you are passing strings instead of floats
edit:
try:
video = haf.DeHalo_alpha(video, rx = 1.1, ry = 1.1, brightstr = 0.8, ss = 1.5)
hah. thank you!!
i knew it had to be something simple like that. removed the quotes and it worked (extra spaces weren't even necessary). just for the sake of learning, though, why do the quotes go through with the mv.super/analyse? i now removed those, as well, but even if i kept it, the script still ran when checked?
aldix
17th May 2019, 20:25
it'd be fantastic if i'd get a few more things from the old script integrated also, so.
how to deal with these in vs?
some_source_plugin("video.mkv").ConvertToYV12(matrix="rec709")
maskstars=source.mt_binarize(upper=false)
mt_merge(last,maskstars)
z = 2 # z = zero point
p = 0.9 # p = power
str = 0.9 # str = strength
rad = 1.0 # radius for "gauss"
o = last
g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)
mt_lutxy(o,g,"x x y - abs "+string(z)+" / 1 "+string(p)+" / ^ "+string(z)+" * "+string(str)+" * x y - x y - abs 0.001 + / * +",U=2,V=2)
YLevels(3, 1.0, 255, 1, 255)
thank you a bunch in advance!
also, there's no port of the Seesaw script for vs, right, or?
ChaosKing
17th May 2019, 20:41
also, there's no port of the Seesaw script for vs, right, or?
These two have it:
http://vsdb.top/plugins/muvsfunc
http://vsdb.top/plugins/G41fun
You are using dehalo from havsfunc.py now, so good,
but as for that previous dehalo_alpha.py, you do not involve core. If you import modul, you do not use Vapoursynths' core attributes.
import dehalo_alpha
my_dehalo = dehalo_alpha.DeHalo_alpha()
video = my_dehalo.dehalo_alpha(video,rx=1.1,ry=1.1,brightstr=0.8,ss=1.5)
aldix
18th May 2019, 00:34
These two have it:
http://vsdb.top/plugins/muvsfunc
http://vsdb.top/plugins/G41fun
thank you!! this is awesome.
aldix
18th May 2019, 00:36
You are using dehalo from havsfunc.py now, so good,
but as for that previous dehalo_alpha.py, you do not involve core. If you import modul, you do not use Vapoursynths' core attributes.
import dehalo_alpha
my_dehalo = dehalo_alpha.DeHalo_alpha()
video = my_dehalo.dehalo_alpha(video,rx=1.1,ry=1.1,brightstr=0.8,ss=1.5)
right, thank you. i'll keep this in mind for the future :)
think i never tried it with "import dehalo_alpha." initially you posted the two lines following that and this threw up some errors, as observed from the previous posts.
in any case, it's very good to know that there's a number of ways to do things now. great!
aldix
18th May 2019, 00:54
think i've almost everything fixed and set up now the way i need to. sorry about being so dense.
i'm still struggling with core.std.Interleave tho. what's the correct way using it?
i'm getting
vapoursynth.Error: Interleave: the clips' formats don't match
using:
...
src = core.fmtc.resample(clip,w=1280,h=720, kernel="blackmanminlobe", taps=4)
...
video = core.f3kdb.Deband(video,sample_mode=2,dynamic_grain=False,keep_tv_range=False,dither_algo=3,output_depth=8,y=48,cb=48,cr=48,grainy=48,grainc=48)
int = core.std.Interleave(clips=[src,video])
int.set_output()
and both are 1280/720.
resolution is not enough, comment out that interleave line and add:
src = src.text.ClipInfo()
src.set_output()
to see parameters of that clip and then delete those two lines and add other clip:
video = video.text.ClipInfo()
video.set_output()
aldix
18th May 2019, 02:25
| Format: YUV420P16
...
Format: YUV420P8
hmm, so src clip is 16-bit and filtered is 8? but how do i change the src clip to 8-bit right at the beginning?
and will it mess all the rest up again, or what?
don't know , you can change it right after loading src source or just before interleaving
src = core.resize.Bicubic(src, format = vs.YUV420P8)
aldix
18th May 2019, 02:51
think i fixed it with these changes.
src = core.fmtc.resample(clip,w=1280,h=720, kernel="blackmanminlobe", taps=4,css=420)
src = core.fmtc.bitdepth(clip,bits=8,dmode=1)
at least the script runs now. but, um, when i initiate the preview, i've no idea which frames from which i'm looking at?
too used to moving back and forth with keyboard arrows with the regular interleave. what's the how-to here?
aldix
18th May 2019, 02:54
hmm, never mind.
think it does work the same way, though. just the changes are too negligible with finesharp. oh well.
gotta try to get seesaw to work now :D
You could switch to zimg - Vapoursynth's resize (http://www.vapoursynth.com/doc/functions/resize.html), like in my example, that changes resolutions, color spaces and much more. fmtconv is another way to do it though. Zimg is written by myrsloik I think so I'm sure it sits well within Vapoursynth.
edcrfv94
18th May 2019, 04:28
Will vivtc.VFM support ovr text file like tivtc?
If anyone can answer,
why there is kernel or resize method set as resize attribute and not just an argument in core.resize ?
example: clip = core.resize(clip, kernel = Bicubic, ......)
DJATOM
24th May 2019, 11:03
Something like that will work:
resizer = {
'bicubic': core.resize.Bicubic,
'bilinear': core.resize.Bilinear,
'spline36': core.resize.Spline36,
'spline16': core.resize.Spline16
}
clip = resizer['bicubic'](clip, 960, 540, format=vs.YUV420P8)
I meant why is that, if author wanted that to look more like Avisynth command, to keep a pattern. Not that it matters.
That example is cool, yes tables with dictionaries, tuples, lists, that's the way to go. :-).
Or checking if kernel exists might be done by checking if it exists as a resize attribute:
my_cool_function(clip, kernel='Bicubic', miracle_settings=True)
try:
getattr(vs.core.resize, kernel)
except:
print("Wrong kernel")
edit: fixed missing quotes , because that's the whole point in this example with getattr , getting an object from a string name
aldix
26th May 2019, 02:21
ok, i'm back again so please bear with me here.
...
maskstars=src.mt_binarize(upper=false)
...
mt_merge(last,maskstars)
...
so i went ahead and tried
...
maskstars = core.std.Binarize(src,threshold=0)
...
video = core.std.Merge(video,maskstars)
...
but think i'm doing something wrong, cos "threshold=0" doesn't seem to equal "upper=false" for video picture changes color in weird ways etc. so how should i use the vs binarize? is it even what i'm after here?
merge seems to be mt_merge, though, so at least that is straightforward.
z = 2 # z = zero point
p = 0.9 # p = power
str = 0.9 # str = strength
rad = 1.0 # radius for "gauss"
o = last
g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)
mt_lutxy(o,g,"x x y - abs "+string(z)+" / 1 "+string(p)+" / ^ "+string(z)+" * "+string(str)+" * x y - x y - abs 0.001 + / * +",U=2,V=2)
still don't know what to do with ^. as much as i googled, there seems to be some alternative for mt_lutxy under vs, but not like i'd know how to use it.
the resize can be done with core.std.resize etc i suppose. as far as the following calculation goes though, i've no idea. as much as i can recall, this
script snippet is something Didee wrote ages ago (if that helps any).
thanks!
WolframRhodium
26th May 2019, 18:18
maskstars=src.mt_binarize(upper=false)
in AVS is equivalent to
maskstars=src.std.Binarize(threshold=128+1, planes=[0])
in Vapoursynth.
still don't know what to do with ^.
The equivalent in std.Expr() is "pow".
there seems to be some alternative for mt_lutxy under vs, but not like i'd know how to use it.
It could be implemented through std.Lut2() or std.Expr(). The semantics of the later one is more close to mt_lutxy(), e.g.
core.std.Expr([o, g], [f"x x y - abs {z} / 1 {p} / pow {z} * {strength} * x y - x y - abs 0.001 + / * +", ""])
Avisynth functions and their VapourSynth equivalents (http://vapoursynth.com/doc/avisynthcomp.html) may be helpful to you.
aldix
27th May 2019, 02:13
maskstars=src.mt_binarize(upper=false)
in AVS is equivalent to
maskstars=src.std.Binarize(threshold=128+1, planes=[0])
in Vapoursynth.
The equivalent in std.Expr() is "pow".
It could be implemented through std.Lut2() or std.Expr(). The semantics of the later one is more close to mt_lutxy(), e.g.
core.std.Expr([o, g], [f"x x y - abs {z} / 1 {p} / pow {z} * {strength} * x y - x y - abs 0.001 + / * +", ""])
Avisynth functions and their VapourSynth equivalents (http://vapoursynth.com/doc/avisynthcomp.html) may be helpful to you.
awesome! thank you so much, i've the maskstars part sorted now. :thanks:
how would i write this in vs though? with a bunch of different core.resize.Bicubic calls or what? hmm, and what's the equivalent in vs for "round" and "rad"?
g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)
thanks a lot in any case. really loving the community here!
WolframRhodium
27th May 2019, 03:19
how would i write this in vs though? with a bunch of different core.resize.Bicubic calls or what? hmm, and what's the equivalent in vs for "round" and "rad"?
g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)
g = o.resize.Bicubic(round(o.width/rad/4)*4, round(o.height/rad/4)*4).resize.Bicubic(o.width, o.height, filter_param_a=1, filter_param_b=0)
"rad" is a variable in your code,
rad = 1.0 # radius for "gauss"
(Actually "round" should be implemented like this)
_round = lambda x: -int(-x+0.5) if x < 0 else int(x+0.5)
g = o.resize.Bicubic(_round(o.width/rad/4)*4, _round(o.height/rad/4)*4).resize.Bicubic(o.width, o.height, filter_param_a=1, filter_param_b=0)
aldix
28th May 2019, 02:58
g = o.resize.Bicubic(round(o.width/rad/4)*4, round(o.height/rad/4)*4).resize.Bicubic(o.width, o.height, filter_param_a=1, filter_param_b=0)
"rad" is a variable in your code,
rad = 1.0 # radius for "gauss"
(Actually "round" should be implemented like this)
_round = lambda x: -int(-x+0.5) if x < 0 else int(x+0.5)
g = o.resize.Bicubic(_round(o.width/rad/4)*4, _round(o.height/rad/4)*4).resize.Bicubic(o.width, o.height, filter_param_a=1, filter_param_b=0)
thank you so very much!! yes! this works.
and now i've whole of my old avs script working!
:thanks: :cool:
bjoker
28th May 2019, 13:01
Could anyone please advise on how to link ffms2 plugin to VapourSynth on Ubuntu linux? As there is no VapourSynth FATPACK for linux i had to compile/build ffms2. Please see below and advise, thanks!
vspipe /root/MyMovie.vpy - --y4m | x265 --crf 22 --preset slow --output-depth 10 --ctu 32 --max-tu-size 16 --analysis-reuse-level 8 --no-rect --b-intra --aq-mode 3 --subme 5 --merange 60 --max-merge 4 --weightb --bframes 8 --rc-lookahead 80 --ref 5 --colorprim bt709 --colormatrix bt709 --transfer bt709 --deblock -2:-1 --no-sao --no-strong-intra-smoothing --y4m --output /root/MyMovie-out.mkv -
Script evaluation failed:
Python exception: No attribute with the name ffms2 exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1937, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1938, in vapoursynth.vpy_evaluateScript
File "/root/MyMovie.vpy", line 8, in <module>
clip = core.ffms2.Source(r"/root/MyMovie-1min.mkv", cachefile = r"/root/MyMovie-1min.mkv.ffindex")
File "src/cython/vapoursynth.pyx", line 1532, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name ffms2 exists. Did you mistype a plugin namespace?
x265 [error]: unable to open input file <->
root@ubuntu19:~# cat MyMovie.vpy
import os
import sys
ScriptPath = '/root/VS/Scripts'
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source(r"/root/MyMovie-1min.mkv", cachefile = r"/root/MyMovie-1min.mkv.ffindex")
clip.set_output()
root@ubuntu19:~# python -V
Python 3.7.3
root@ubuntu19:~#
root@ubuntu19:~# vspipe --version
VapourSynth Video Processing Library
Copyright (c) 2012-2018 Fredrik Mellbin
Core R45
API R3.5
Options: -
root@ubuntu19:~# x265 --version
x265 [info]: HEVC encoder version 2.9
x265 [info]: build info [Linux][GCC 8.2.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
root@ubuntu19:~# ffmpeg --version
ffmpeg version 4.1.3-0ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Ubuntu 8.3.0-6ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Unrecognized option '-version'.
Error splitting the argument list: Option not found
root@ubuntu19:~#
root@ubuntu19:~# uname -a
Linux ubuntu19 5.0.0-15-generic #16-Ubuntu SMP Mon May 6 17:41:33 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu19:~#
I did set these below:
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
PYTHONPATH=/usr/local/lib/python3.7/site-packages/; export PYTHONPATH
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig; export PKG_CONFIG_PATH
LD_RUN_PATH=$LD_RUN_PATH:/usr/local/lib; export LD_RUN_PATH
and tried this too..
root@ubuntu19:~/.config/vapoursynth# cat /root/.config/vapoursynth/vapoursynth.conf
SystemPluginDir=/usr/local/lib/pkgconfig
root@ubuntu19:~/.config/vapoursynth#
fms2 install log:
root@ubuntu19:~/ffms2# make install
make[1]: Entering directory '/root/ffms2'
/usr/bin/mkdir -p '/usr/local/lib'
/bin/bash ./libtool --mode=install /usr/bin/install -c src/core/libffms2.la '/usr/local/lib'
libtool: install: /usr/bin/install -c src/core/.libs/libffms2.so.4.0.0 /usr/local/lib/libffms2.so.4.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libffms2.so.4.0.0 libffms2.so.4 || { rm -f libffms2.so.4 && ln -s libffms2.so.4.0.0 libffms2.so.4; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libffms2.so.4.0.0 libffms2.so || { rm -f libffms2.so && ln -s libffms2.so.4.0.0 libffms2.so; }; })
libtool: install: /usr/bin/install -c src/core/.libs/libffms2.lai /usr/local/lib/libffms2.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/mkdir -p '/usr/local/bin'
/bin/bash ./libtool --mode=install /usr/bin/install -c src/index/ffmsindex '/usr/local/bin'
libtool: install: /usr/bin/install -c src/index/.libs/ffmsindex /usr/local/bin/ffmsindex
/usr/bin/mkdir -p '/usr/local/share/doc/ffms2'
/usr/bin/install -c -m 644 doc/ffms2-api.md doc/ffms2-changelog.md '/usr/local/share/doc/ffms2'
/usr/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 ./include/ffms.h ./include/ffmscompat.h '/usr/local/include'
/usr/bin/mkdir -p '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 ffms2.pc '/usr/local/lib/pkgconfig'
make[1]: Leaving directory '/root/ffms2'
root@ubuntu19:~/ffms2#
ChaosKing
28th May 2019, 13:33
Maybe someone could make a flatpack / appimage / snap version with vsedit, vapoursynth and some plugins.
bjoker
28th May 2019, 15:14
I solved issue of loading plugins by
root@ubuntu19:~# cat MyMovie.vpy
import os
import sys
ScriptPath = '/root/VS/Scripts'
#LoadPlugin(path='/usr/local/lib/pkgconfig/ffms2.pc')
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(path='/usr/local/lib/vapoursynth/libffms2.so')
clip = core.ffms2.Source(r"/root/eega-1min.mkv", cachefile = r"/root/eega-1min.mkv.ffindex")
clip.set_output()
root@ubuntu19:~#
But do I need to load each one manually that I need?
The problem is /usr/local/lib is not in your path.
You can pass it to configure when you build ffms2 and then install to the common path:
./configure --prefix=/usr --libdir=/usr/lib64
Ops, and then soft-link in "/usr/lib64/vapoursynth" I guess.
bjoker
28th May 2019, 20:07
Ok I will do that but for now ffms2 issue is solved.
and a new problem..
Could anyone please point out what mistake I'm doing here? Thanks!
root@ubuntu19:~# vspipe /root/MyMovie-all.vpy - --y4m | x265 --crf 22 --preset slow --output-depth 10 --ctu 32 --max-tu-size 16 --analysis-reuse-level 8 --no-rect --b-intra --aq-mode 3 --subme 5 --merange 60 --max-merge 4 --weightb --bframes 8 --rc-lookahead 80 --ref 5 --colorprim bt709 --colormatrix bt709 --transfer bt709 --deblock -2:-1 --no-sao --no-strong-intra-smoothing --y4m --output /root/MyMovie-out.mkv -
Script evaluation failed:
Python exception: No attribute with the name mv exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1937, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1938, in vapoursynth.vpy_evaluateScript
File "/root/MyMovie-all.vpy", line 15, in <module>
denoise = havsfunc.SMDegrain(clip, tr=3, thSAD=300, thSADC=150, contrasharp=True, pel=2, Str=2, prefilter=2, hpad=32, vpad=32)
File "/usr/local/share/vsscripts/havsfunc.py", line 3335, in SMDegrain
super_search = core.mv.Super(pref, chroma=chroma, sharp=subpixel, rfilter=4, **super_args)
File "src/cython/vapoursynth.pyx", line 1670, in vapoursynth._CoreProxy.__getattr__
File "src/cython/vapoursynth.pyx", line 1532, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name mv exists. Did you mistype a plugin namespace?
x265 [error]: unable to open input file <->
root@ubuntu19:~#
root@ubuntu19:~# cat MyMovie-all.vpy
import os
import sys
ScriptPath = '/usr/local/share/vsscripts'
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(path='/usr/local/lib/vapoursynth/libffms2.so')
import importlib.machinery
mvsfunc = importlib.machinery.SourceFileLoader('mvsfunc', r"/usr/local/share/vsscripts/mvsfunc.py").load_module()
adjust = importlib.machinery.SourceFileLoader('adjust', r"/usr/local/share/vsscripts/adjust.py").load_module()
havsfunc = importlib.machinery.SourceFileLoader('havsfunc', r"/usr/local/share/vsscripts/havsfunc.py").load_module()
core.std.LoadPlugin(path='/usr/local/lib/vapoursynth/scenechange.so')
clip = core.ffms2.Source(r"/root/MyMovie-1min.mkv", cachefile = r"/root/MyMovie-1min.mkv.ffindex")
clip = core.std.Crop(clip, 0, 0, 132, 132)
denoise = havsfunc.SMDegrain(clip, tr=3, thSAD=300, thSADC=150, contrasharp=True, pel=2, Str=2, prefilter=2, hpad=32, vpad=32)
clip.set_output()
ChaosKing
28th May 2019, 20:17
No attribute with the name mv exists. => you need to load mvtools (and a bunch of other plugins)
bjoker
28th May 2019, 21:08
Thanks, could load mvtools & few others but stuck with ...
root@ubuntu19:~# vspipe /root/eega-all.vpy - --y4m | x265 --crf 22 --preset slow --output-depth 10 --ctu 32 --max-tu-size 16 --analysis-reuse-level 8 --no-rect --b-intra --aq-mode 3 --subme 5 --merange 60 --max-merge 4 --weightb --bframes 8 --rc-lookahead 80 --ref 5 --colorprim bt709 --colormatrix bt709 --transfer bt709 --deblock -2:-1 --no-sao --no-strong-intra-smoothing --y4m --output /root/eega-out.mkv -
Script evaluation failed:
Python exception: No attribute with the name rgvs exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1937, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1938, in vapoursynth.vpy_evaluateScript
File "/root/eega-all.vpy", line 17, in <module>
denoise = havsfunc.SMDegrain(clip, tr=3, thSAD=300, thSADC=150, contrasharp=True, pel=2, Str=2, prefilter=2, hpad=32, vpad=32)
File "/usr/local/share/vsscripts/havsfunc.py", line 3416, in SMDegrain
return ContraSharpening(output, CClip, planes=planes)
File "/usr/local/share/vsscripts/havsfunc.py", line 5259, in ContraSharpening
ssDD = core.rgvs.Repair(ssD, allD, [rep if i in planes else 0 for i in range(denoised.format.num_planes)]) # limit the difference to the max of what the denoising removed locally
File "src/cython/vapoursynth.pyx", line 1670, in vapoursynth._CoreProxy.__getattr__
File "src/cython/vapoursynth.pyx", line 1532, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name rgvs exists. Did you mistype a plugin namespace?
x265 [error]: unable to open input file <->
root@ubuntu19:~#
Can't find this plugin on my machine nor online, please advise!
root@ubuntu19:~# find / -name "*[rR][gG][vV][sS]*" -ls
48632 8 -rw-r--r-- 1 root root 7794 May 27 23:40 /root/vapoursynth/doc/plugins/rgvs.rst
root@ubuntu19:~#
Removegrain comes with vapoursynth itself, you compiled it without it.
bjoker
28th May 2019, 21:34
Thanks Are_ - but there's no mention of such things in their site = http://www.vapoursynth.com/doc/installation.html
All they mentioned is -
./autogen.sh
./configure
make
make install
please advise what is my choice now? how to recompile with all default-incl plugins?
qyot27
28th May 2019, 21:50
As I said in the other thread:
sudo ldconfig
Which should be interpreted to mean both 'use ldconfig after make install' and 'stop using the root account'.
bjoker
28th May 2019, 22:14
Hi qyot27
I already ran ldconfig (in fact few times) and now again but the same issue. Do you mean to say that I should recompile/build vapoursynth again and then run ldconfig immediately after that?
As for the root, I don't see any issue using it as it's NOT a production server and i want to use it until I get this setup done. AFter that I will continue using with normal user account.
qyot27
29th May 2019, 01:46
If you drop down to the normal account, do the errors with autoloading remain?
bjoker
29th May 2019, 03:16
Awesome! Many thanks qyot27. :thanks:
As normal user, Everything worked straightaway without having to load any plugins in the code (had to delete all the core.std.LoadPlugin entries from my vpy script).
It's very weird that there were issues running as root user but not as normal user.
bjoker
30th May 2019, 20:40
Hi,
I have a bit weird problem with Vapoursynth on my machine which hangs during encoding. It doesn't respond all of a sudden with keyboard/mouse and also no HDD/SDD activity so I had to power cycle the machine.
My HW config:
Threadripper 1950x (16 core/32 threads)
DDR4 32GB
Gigabyte x399 Motherboard.
Samsug EVO850 M.2
SW config:
1) Windows 10 Pro
StaxRip 2.0.2.1
VapourSynth64Portable_2019_03_11
Since avisynth using only <20% CPU I had to goto Vapoursynth. I tried multiple BD's but all of them caused system hang at some stage. If I do NOT use Vapoursynth, instead using x265 directly/ffmpeg/handbrake (with VS), it did not hang even once for number on encodes.
To further narrow down the problem, I did setup Ubuntu 19 with Vapoursynth which also hanged my machine during encoding. Again everything (x265 cli, ffmpeg/HB etc.) works just fine on Ubuntu as well as long as I do't use Vapoursynth.
During the encode, I monitored both CPU usage (which is around 80%) and CPU temp (less than threshold - under control). Could anyone please advise me on how to troubleshoot this issue of my machine with VS? Are there any logs? (I tried to investigate OS logs & StaxRip'ss logs but none of them gave any useful info int this regard).
Many thanks!!
Boulder
30th May 2019, 20:44
It sounds a lot like some overheating issue, but then again, x265 should also make the CPU work real hard.
Maybe you could install some CPU temp monitoring tool to verify when it hangs.
bjoker
30th May 2019, 20:49
It sounds a lot like some overheating issue, but then again, x265 should also make the CPU work real hard.
Maybe you could install some CPU temp monitoring tool to verify when it hangs.
Yes, I monitored both CPU usage (70-80%) and it's temperatures (~ 80 degrees whereas MAX temp threshold shown as 92 degrees) which seem to be under control. I also think that if there's is too much CPU temp that should cause server to power OFF, not hang? (not sure).
I'm using only the SMDegrain plugin with VS (other than x265 encoding and cropping). I also tried same settings with NLMEans denoiser with Handbrake that never caused this issue. I see 10% more CPU usage with StaxRip/VS vs HB/NLmeans.
None of the other encoding methods (other than using VS) causes system hang.
Thanks for your reply.
Myrsloik
30th May 2019, 22:02
Yes, I monitored both CPU usage (70-80%) and it's temperatures (~ 80 degrees whereas MAX temp threshold shown as 92 degrees) which seem to be under control. I also think that if there's is too much CPU temp that should cause server to power OFF, not hang? (not sure).
I'm using only the SMDegrain plugin with VS (other than x265 encoding and cropping). I also tried same settings with NLMEans denoiser with Handbrake that never caused this issue. I see 10% more CPU usage with StaxRip/VS vs HB/NLmeans.
None of the other encoding methods (other than using VS) causes system hang.
Thanks for your reply.
I recommen using occt (https://www.ocbase.com/) to really test stability. I think it changed a bit in the most recent version but avx2 linpack is what I like to use to test stability. Note that the CPU usage percentage isn't a perfect indicator of actual load. It's actually really shit.
jackoneill
30th May 2019, 22:20
Hi,
I have a bit weird problem with Vapoursynth on my machine which hangs during encoding.
What happens if you remove the VapourSynth plugin KNLMeansCL?
Boulder
31st May 2019, 09:01
Yes, I monitored both CPU usage (70-80%) and it's temperatures (~ 80 degrees whereas MAX temp threshold shown as 92 degrees) which seem to be under control. I also think that if there's is too much CPU temp that should cause server to power OFF, not hang? (not sure).
Usually the safety shutdown temp is much higher than where some CPU-intensive application causes hangs. It's what any overclocker sees when they start finding the limits of the chip.
Myrsloik
1st June 2019, 14:35
R46 test1 (https://www.dropbox.com/s/v2mgw0t91d9nu3j/VapourSynth-R46-test1.exe?dl=1)
Everything is changed! There could be installer bugs, compiler bugs and code bugs at the same time!
Test the new unprivileged install mode a bit extra.
r46:
updated windows projects to use vs2019, inno setup 6 and latest zimg
the windows installer now supports installs without administrator privileges
the windows installer no longer puts a copy of vsscript.dll in the system directory and no longer writes the legacy registry entries, deprecated since r31
the portable install now includes all the sdk files
added a fallback to how the appdata path is retrieved which works even if %USERPROFILE% isn't set
added an option to vspipe to make it not modify the current working directory
added a better equality check for the Format class in python
fixed doubleweave sometimes using the opposite field order (dubhater)
fixed broken output when stride wasn't equal to width in the python output function (stuxcrystal)
relaxed mask clip requirements in maskedmerge (dubhater)
fixed overflow with int16 in maskedmerge (dubhater)
fixed swapped fields in doubleweave (dubhater)
fixed selectevery breaking and leaking when there are no frames to return
stax76
1st June 2019, 15:39
StaxRip needed an adjustment to find the dll in unprivileged per user setup, other than that it's working so far.
ChaosKing
1st June 2019, 15:49
If I click on "install for me only" it says "no python 3.7 installation is not found". But finds python 3.7 for "all users".
EDIT: So I guess I need also a per user python installation then!?
stax76
1st June 2019, 16:02
I've only one per user Python installed and it was found.
C:\Users\frank\AppData\Local\Programs\Python\Python37\python.exe
Myrsloik
1st June 2019, 17:55
If I click on "install for me only" it says "no python 3.7 installation is not found". But finds python 3.7 for "all users".
EDIT: So I guess I need also a per user python installation then!?
Yes, obviously a per user Python installation is needed. You don't even have write permissions to install a module otherwise most of the time.
bjoker
6th June 2019, 20:32
Usually the safety shutdown temp is much higher than where some CPU-intensive application causes hangs. It's what any overclocker sees when they start finding the limits of the chip.
Thank you! You are right, it IS CPU heating issue as I solved it by disabling Overclocking my CPU (its base clock is 3.4GHz and i did OC'ed to 4GHz earlier).
Now after disabling OC, there're no more hangs. Everything works perfectly! Perhaps I could do OC to 3.7GHz again and retry.
I recommen using occt (https://www.ocbase.com/) to really test stability. I think it changed a bit in the most recent version but avx2 linpack is what I like to use to test stability. Note that the CPU usage percentage isn't a perfect indicator of actual load. It's actually really shit.
when I run occt on my AMD threadripper, it tries to open/run but closes on its own without any error. It does NOT run. Is this tool for Intel CPUs only? It ran fine on my Intel CPU laptop.
lansing
7th June 2019, 01:17
Thank you! You are right, it IS CPU heating issue as I solved it by disabling Overclocking my CPU (its base clock is 3.4GHz and i did OC'ed to 4GHz earlier).
Now after disabling OC, there're no more hangs. Everything works perfectly! Perhaps I could do OC to 3.7GHz again and retry.
I'm suspecting a thermal paste issue. You'll need to apply new thermal paste every couple of years to keep it fresh.
bjoker
7th June 2019, 01:27
I'm suspecting a thermal paste issue. You'll need to apply new thermal paste every couple of years to keep it fresh.
Bought it less than a year ago, also not much used until last April.
Myrsloik
7th June 2019, 12:17
I'm suspecting a thermal paste issue. You'll need to apply new thermal paste every couple of years to keep it fresh.
Those familiar with the 1950x will instead say that hitting 4ghz on air is rare. As someone who has one I can say that "overclocking" on air is a mostly pointless exercise since it at the same time disables the turbo when only a few cores are active.
This is about unrealistic expectations and not thermal paste.
Myrsloik
7th June 2019, 13:08
R46 RC1 is here (https://www.dropbox.com/s/wisb4gasos4ngdi/VapourSynth-R46-RC1.exe?dl=1)!
Go test the installer that no longer needs admin privileges. Everything except AVFS should work as expected with it (pismo runtime requires admin rights to install).
r46:
updated windows projects to use vs2019, inno setup 6 and zimg 2.9
the windows installer now supports installs without administrator privileges
the windows installer no longer puts a copy of vsscript.dll in the system directory and no longer writes the legacy registry entries, deprecated since r31
the windows installer will no longer offer to install the visual studio 2013 runtime since it hasn't been required by vapoursynth for a very long time
the portable install now includes all the sdk files
added a fallback to how the appdata path is retrieved which works even if %USERPROFILE% isn't set
the default number of threads used is now based on the process affinity on windows, linux and bsd
added an option to vspipe to make it not modify the current working directory
added a better equality check for the Format class in python
fixed doubleweave sometimes using the opposite field order (dubhater)
fixed broken output when stride wasn't equal to width in the python output function (stuxcrystal)
relaxed mask clip requirements in maskedmerge (dubhater)
fixed overflow with int16 in maskedmerge (dubhater)
fixed swapped fields in doubleweave (dubhater)
fixed selectevery breaking and leaking when there are no frames to return
ChaosKing
7th June 2019, 13:42
vapoursynth.get_core().version() still shows R45
Myrsloik
7th June 2019, 14:38
vapoursynth.get_core().version() still shows R45
You must have an old dll lying around somewhere. It prints the right version for me.
ChaosKing
7th June 2019, 15:11
Figured it out. I had vapoursynth also installed via pip and VS R45 dlls were in python site-packages. pip uninstall vapoursynth fixed it.
lansing
7th June 2019, 23:27
Those familiar with the 1950x will instead say that hitting 4ghz on air is rare. As someone who has one I can say that "overclocking" on air is a mostly pointless exercise since it at the same time disables the turbo when only a few cores are active.
This is about unrealistic expectations and not thermal paste.
Oh I misread, I thought he was talking about intel chip.
masterkivat
8th June 2019, 07:44
I'm trying to install R46-RC1, but...
https://puu.sh/DDb9B/1a147f13a1.png
...am I doing something wrong? :confused: :(
EDIT: I had no other way but to install using the "install to this user only" option, Myrsloik told me on IRC that I certainly installed Python for not all users... derp :rolleyes:
Myrsloik
8th June 2019, 20:26
R46-RC2 (https://www.dropbox.com/s/fzj9ou2qjafynj9/VapourSynth-R46-RC2.exe?dl=1) (probably final RC)
The installer now has more informative error messages so dudes like the one in the post before won't have to ask me.
tuanden0
9th June 2019, 13:46
R46-RC2 (https://www.dropbox.com/s/fzj9ou2qjafynj9/VapourSynth-R46-RC2.exe?dl=1) (probably final RC)
The installer now has more informative error messages so dudes like the one in the post before won't have to ask me.
After install this version, I got this error and x265 can't read vpy file because the plugins's path but I can preview vpy file on VSEdit :(
Script evaluation failed:
Python exception: No attribute with the name lsmas exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1942, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 1943, in vapoursynth.vpy_evaluateScript
File "e:\Download\test.vpy", line 6, in <module>
clip = core.lsmas.LWLibavSource(r"E:\Download\test.mkv")
File "src\cython\vapoursynth.pyx", line 1675, in vapoursynth._CoreProxy.__getattr__
File "src\cython\vapoursynth.pyx", line 1537, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name lsmas exists. Did you mistype a plugin namespace?
x265 [error]: unable to open input file <->
mkvmerge v34.0.0 ('Sight and Seen') 64-bit
Error: The file 'e:\Download\test.hevc' could not be opened for reading: open file error.
# Edit: I install vapoursynth via pip and it work, but the version is 45
C:\Users\Home>pip install vapoursynth
Collecting vapoursynth
Downloading https://files.pythonhosted.org/packages/b0/0c/8c18ec1db6c8cd3be0caadb2901b06161dd3117ba5bee39a6e9e369815e2/VapourSynth-45-cp37-cp37m-win_amd64.whl (817kB)
|████████████████████████████████| 819kB 819kB/s
Installing collected packages: vapoursynth
Successfully installed vapoursynth-45
ChaosKing
9th June 2019, 19:51
Where is you lsmas plugin located? pip doesn't install the RC version.
@Myrsloik Is there a way to see which vapoursynth dll is loaded?
Feature request for VS: print all plugin search paths AND/OR show also a full path to plugin dlls in core.get_plugins()
Myrsloik
9th June 2019, 20:36
Where is you lsmas plugin located? pip doesn't install the RC version.
@Myrsloik Is there a way to see which vapoursynth dll is loaded?
Feature request for VS: print all plugin search paths AND/OR show also a full path to plugin dlls in core.get_plugins()
What do you mean by which vapoursynth dll? The full path? Version? It's unclear what you want. If you simply want the path I believe GetModuleFileName() and GetModuleHandle() in the windows API is what you want.
I won't print the path to the dlls ever. The plugins are managed by VS and nothing else. Why do you even need to know this?
Myrsloik
9th June 2019, 21:10
After install this version, I got this error and x265 can't read vpy file because the plugins's path but I can preview vpy file on VSEdit :(
# Edit: I install vapoursynth via pip and it work, but the version is 45
Did you do a per user install? Did you check if it could load other plugins correctly?
ChaosKing
9th June 2019, 21:41
What do you mean by which vapoursynth dll? The full path? Version? It's unclear what you want. If you simply want the path I believe GetModuleFileName() and GetModuleHandle() in the windows API is what you want.
The location of the dll, so yes the full path. It seems a vapoursynth.__file__ in python does what I want, it shows the full path to vapoursynth.cp37-win_amd64.pyd and the vapoursynhs.dll is next to it. So this one is solved.
I won't print the path to the dlls ever. The plugins are managed by VS and nothing else. Why do you even need to know this?
Two reasons: 1. To easily find plugin duplicates. If the abc.dll is in "AppData\plugins" and the same file (or a different version) is in "vapoursynth\plugins64" only one of them is loaded (or the other ignored). But now what I re-checked the docs this is also a feature...
2. if I use get_plugins() I can't know which dll file corresponds to which plugin in the output string. I wanted to automatically track if a plugin function is changed or a new one is added (only the dll name would be enough for me).
I mean, yes, I could also build a "file to identifier connection" list I just think it is a usefull feature to have.
tuanden0
10th June 2019, 11:13
Did you do a per user install? Did you check if it could load other plugins correctly?
Yes, I did use a per user install.
I can load all plugin via VSEdit to preview but can't encode with x265 :devil:
Myrsloik
10th June 2019, 15:01
Yes, I did use a per user install.
I can load all plugin via VSEdit to preview but can't encode with x265 :devil:
NEW INFORMATION! Apparently I completely messed up the per user registry entries and will need to rework things. This probably explains some of the plugin related problems.
All user installs and portable still works so just test that for now.
stax76
10th June 2019, 17:09
I avoid x86 like the plague and would like to request a separate setup for x86 and x64. :)
Example:
https://github.com/stax76/mpv.net/blob/master/setup.iss
https://github.com/stax76/mpv.net/blob/master/setup.ps1
Myrsloik
10th June 2019, 22:03
I avoid x86 like the plague and would like to request a separate setup for x86 and x64. :)
Example:
https://github.com/stax76/mpv.net/blob/master/setup.iss
https://github.com/stax76/mpv.net/blob/master/setup.ps1
I've split it into separate 32 and 64 bit installers simply because it's so much easier. Now I just have to test everything again which is super boring.
stax76
11th June 2019, 05:05
I've split it into separate 32 and 64 bit installers simply because it's so much easier. Now I just have to test everything again which is super boring.
Maybe writing a test script in a language you want to learn could be fun?
I didn't expect that you like the idea. :)
Will be testing it once it's done.
Myrsloik
16th June 2019, 13:11
R46 RC3/4:
64bit (https://www.dropbox.com/s/pcpnwstvniwzric/VapourSynth64-R46-RC3.exe?dl=1)
32bit (https://www.dropbox.com/s/ai7kt0ecmgvauvk/VapourSynth32-R46-RC4.exe?dl=1)
The installer was reworked quite a bit to split it into two parts. The registry entries for the 32 bit version are now under a key called Vapoursynth-32 instead so they don't overlap in HKCU.
So test all the different combinations of options and report if it works/doesn't work. Especially for the 32 bit version.
ChaosKing
16th June 2019, 13:28
Typo?
https://i.imgur.com/mEvaUXC.png
EDIT
I can't install VS 32bit on 64bit windows?
https://i.imgur.com/mkshr9z.png
Myrsloik
16th June 2019, 13:36
Typo?
https://i.imgur.com/mEvaUXC.png
EDIT
I can't install VS 32bit on 64bit windows?
https://i.imgur.com/mkshr9z.png
Fixed, use the same download link.
Not a typo, just a stylistic choice.
ChaosKing
16th June 2019, 13:51
32 bit (per user install) works great. 64 Bit installer also installed without problems and VS seems to work as usual.
Suggestion: change "Python 3.7" to "Python 3.7 (32-Bit)" in 32 bit installer, as a hint for newbies.
https://i.imgur.com/reve9Ku.png
Myrsloik
16th June 2019, 14:31
32 bit (per user install) works great. 64 Bit installer also installed without problems and VS seems to work as usual.
Suggestion: change "Python 3.7" to "Python 3.7 (32-Bit)" in 32 bit installer, as a hint for newbies.
https://i.imgur.com/reve9Ku.png
Makes sense. I've updated the installers with this small change now.
stax76
16th June 2019, 14:45
For me it works (x64 all users), thanks for improving it.
tuanden0
17th June 2019, 12:17
R46 RC3:
64bit (https://www.dropbox.com/s/pcpnwstvniwzric/VapourSynth64-R46-RC3.exe?dl=1)
32bit (https://www.dropbox.com/s/r0jdtijw4d8nulb/VapourSynth32-R46-RC3.exe?dl=1)
The installer was reworked quite a bit to split it into two parts. The registry entries for the 32 bit version are now under a key called Vapoursynth-32 instead so they don't overlap in HKCU.
So test all the different combinations of options and report if it works/doesn't work. Especially for the 32 bit version.
I installed R46 RC 64bit
I got same error with previous version when installed with per user :eek:
Script evaluation failed:
Python exception: No attribute with the name lsmas exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1942, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 1943, in vapoursynth.vpy_evaluateScript
File "e:\Download\Source\test.vpy", line 6, in <module>
clip = core.lsmas.LWLibavSource(r"E:\Download\Source\test.mkv")
File "src\cython\vapoursynth.pyx", line 1675, in vapoursynth._CoreProxy.__getattr__
File "src\cython\vapoursynth.pyx", line 1537, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name lsmas exists. Did you mistype a plugin namespace?
Myrsloik
17th June 2019, 13:55
I installed R46 RC 64bit
I got same error with previous version when installed with per user :eek:
Did you install VS R45 using my installer and did that work?
If you installed it through pip you have a portable version and it autoloads from another directory.
tuanden0
17th June 2019, 15:00
Did you install VS R45 using my installer and did that work?
If you installed it through pip you have a portable version and it autoloads from another directory.
I installed VS R45 and it work.
I tried to install R46 and can only preview on VSEdit.
So I have to install vapoursynth via pip to get it work again :confused:
And the autoload after install via pip is correct at "C:\Program Files (x86)\VapourSynth\plugins64"
VS_Fan
19th June 2019, 20:46
R46 RC3:
64bit (https://www.dropbox.com/s/pcpnwstvniwzric/VapourSynth64-R46-RC3.exe?dl=1)
32bit (https://www.dropbox.com/s/r0jdtijw4d8nulb/VapourSynth32-R46-RC3.exe?dl=1)
I have tested 64bit without problems. But 32bit installer won't work: After doing some progress installing, it will pop a new window:
https://imgur.com/a/XL5LvAm
Error creating registry key:
HKEY_LOCAL_MACHINE\'SOFTWARE\Vapoursynth'
RegCreateKeyEx failed; code 87.
The parameter is incorrect.
It will repeatedly pop the same error window if you click on "retry" or "ignore". Leaving "cancel" as the only option, which will rollback any changes made.
Myrsloik
19th June 2019, 22:09
R46 RC3/4:
64bit (https://www.dropbox.com/s/pcpnwstvniwzric/VapourSynth64-R46-RC3.exe?dl=1)
32bit (https://www.dropbox.com/s/ai7kt0ecmgvauvk/VapourSynth32-R46-RC4.exe?dl=1)
The installer was reworked quite a bit to split it into two parts. The registry entries for the 32 bit version are now under a key called Vapoursynth-32 instead so they don't overlap in HKCU.
So test all the different combinations of options and report if it works/doesn't work. Especially for the 32 bit version.
Link updated with an RC4 installer for 32 bit. Fixes the invalid registry entries when doing all user installs... and shows just how little attention I paid to 32 bit stuff.
VS_Fan
20th June 2019, 16:27
Link updated with an RC4 installer for 32 bit. Fixes the invalid registry entries when doing all user installs... and shows just how little attention I paid to 32 bit stuff.
Thanks, they are both working. 64bit and 32bit are autoloading plugins respectively from:
%ProgramFiles%\VapourSynth\plugins
%ProgramFiles(x86)%\VapourSynth-32\plugins
ChaosKing
20th June 2019, 16:46
How about a function to report autoloading paths in their respective order? Similar to vsrepo paths.
Myrsloik
20th June 2019, 21:39
How about a function to report autoloading paths in their respective order? Similar to vsrepo paths.
I don't understand the request. Basically you should only ever use the user autoload dir unless you have some environment set up in advance for lots of people.
ChaosKing
20th June 2019, 22:42
For easier debugging. For example the user tuanden0, with his R45/R46 plugin loading problem, could quickly check which folder is used. I also had 1-2 cases where I just didn't know which of my vapoursynth versions (or which plugin folder, portable+installed) are currently "active".
EDIT:
Basically you should only ever use the user autoload dir unless you have some environment set up in advance for lots of people.
user autoload dir = the folder in appdata?
I for example use the plugins64 folder (and custom VS installation). It is a bit annoying to always open the appdata folder. And for newbies even more since appdata is hidden by default.
vsrepo "fixes" it for us, but not for all plugins.
Myrsloik
21st June 2019, 16:08
Yes, the one in appdata where vsrepo also puts things by default. I've added a convenient shortcut in the start menu in R46.
lansing
25th June 2019, 08:14
If I'm converting a dvd source to rgb, should I be using matrix_in_s="170m" instead of "709"?
clip = core.resize.Bicubic(clip, matrix_in_s="170m", format=vs.RGBS)
Keiyakusha
27th June 2019, 15:00
If I'm converting a dvd source to rgb, should I be using matrix_in_s="170m" instead of "709"?
Short answer: yes (if this is NTSC (US, JP) DVD though)
Longer answer: you shouldn't be using matrix_in_s at all, unless your input clip does not have this property for some reason (which would result in an error) or you are sure your clip is wrong and you want to correct that.
lansing
27th June 2019, 15:39
Short answer: yes (if this is NTSC (US, JP) DVD though)
Longer answer: you shouldn't be using matrix_in_s at all, unless your input clip does not have this property for some reason (which would result in an error) or you are sure your clip is wrong and you want to correct that.
I want to apply a lut on the clip inside vs, so I need to make sure I convert it correctly, as I always got confuse with matrix_s and matrix_in_s.
Myrsloik
27th June 2019, 22:14
R46 is released. Here's the usual blog post (http://www.vapoursynth.com/2019/06/r46-windows-installer-fun/) with a summary of the important changes.
fAy01
27th June 2019, 23:01
R46 is released. Here's the usual blog post (http://www.vapoursynth.com/2019/06/r46-windows-installer-fun/) with a summary of the important changes.
https://i.imgur.com/7ampSAo.png
Could you please label the 32bit and 64bit packages.
https://i.imgur.com/MzBe4OF.png
Do I have to reinstall Python? Can I bypass it somehow?
stax76
27th June 2019, 23:29
It should be OK when you re-run the VS installer and select 'Install for me only'.
fAy01
28th June 2019, 20:52
It should be OK when you re-run the VS installer and select 'Install for me only'.
Doesn't work for 64bit installer.
~ VEGETA ~
1st July 2019, 00:28
I want to encode a bluray interlaced material in vapoursynth but I cannot use the .dgm file generated by dgavcindex. I even always fail to LoadPlugin it as avs plugin for no obvious reason (I tried all path shapes).
Is there anyway I can do it?
Here is my script: https://pastebin.com/VmenRNmh
BTW, I am trying to solve combing issue which is why I got to the IVTC function in there...
DJATOM
1st July 2019, 09:41
Just pick LWLibavSource for interlaced blu-rays if you can't use DGSource.
jackoneill
1st July 2019, 11:03
I want to encode a bluray interlaced material in vapoursynth but I cannot use the .dgm file generated by dgavcindex. I even always fail to LoadPlugin it as avs plugin for no obvious reason (I tried all path shapes).
You should get an error message from avs.LoadPlugin, though. What does it say?
Pat357
4th July 2019, 19:55
I've some problems with the update from R45 -> R46.
After installing R46 (for single user), none of the applications like VSEdit R19, VSRepoGUI can find my vapoursynth install.
My own compiled ffmpeg (--enable-vapoursynh) give my an error like "can not find VSScript.dll" upon starting.
VirtDUP can no longer open a .vpy script.
My Registry contains the correct keys as far as I know :
[HKEY_CURRENT_USER\Software\VapourSynth]
"Version"="R46"
"Path"="C:\\Users\\patri\\AppData\\Local\\Programs\\VapourSynth"
"CorePlugins"="C:\\Users\\patri\\AppData\\Local\\Programs\\VapourSynth\\core\\plugins"
"Plugins"="C:\\Users\\patri\\AppData\\Local\\Programs\\VapourSynth\\plugins"
"VapourSynthDLL"="C:\\Users\\patri\\AppData\\Local\\Programs\\VapourSynth\\core\\vapoursynth.dll"
"VSScriptDLL"="C:\\Users\\patri\\AppData\\Local\\Programs\\VapourSynth\\core\\vsscript.dll"
"PythonPath"="C:\\Users\\patri\\AppData\\Local\\Programs\\Python\\Python37\\"
Never had any problems with any previous updates, so I don't know what to do next ....
After adding "C:\Users\patri\AppData\Local\Programs\VapourSynth\core" to my PATH, I can run my own compiled FFmpeg & MPV again.
Also VSPIPE is working fine : I get correct output from my scripts.
Python 3.70 is in my path and produces a correct list from all my plugins.
Also the normal vsrepo can install plugins and list the available plugins versus the installed.
Where do things like VSRepoGUI/VSEdit look for the installation ? Apparently not at my registry key .....
Also why is the VFW module not working ? It looks like the system is unable to find it...
Any clues to continue from here ?
I've already uninstalled and reinstalled several times, but no avail..
stax76
4th July 2019, 20:15
I would like to request a setup option (enabled by default for user setup) to add vspipe to the PATH environment variable on Windows if it's not already available. As far as I know modifying user PATH does not require elevated privileges, nor does it require a reboot.
Myrsloik
4th July 2019, 23:01
I've some problems with the update from R45 -> R46.
After installing R46 (for single user), none of the applications like VSEdit R19, VSRepoGUI can find my vapoursynth install.
My own compiled ffmpeg (--enable-vapoursynh) give my an error like "can not find VSScript.dll" upon starting.
VirtDUP can no longer open a .vpy script.
My Registry contains the correct keys as far as I know :
...
Never had any problems with any previous updates, so I don't know what to do next ....
After adding "C:\Users\patri\AppData\Local\Programs\VapourSynth\core" to my PATH, I can run my own compiled FFmpeg & MPV again.
Also VSPIPE is working fine : I get correct output from my scripts.
Python 3.70 is in my path and produces a correct list from all my plugins.
Also the normal vsrepo can install plugins and list the available plugins versus the installed.
Where do things like VSRepoGUI/VSEdit look for the installation ? Apparently not at my registry key .....
Also why is the VFW module not working ? It looks like the system is unable to find it...
Any clues to continue from here ?
I've already uninstalled and reinstalled several times, but no avail..
You installed for the current user only. This puts the registry entries in HKCU instead of HKLM which most likely is why they can't be found by existing applications. You'll simply have to wait for them to be updated and point out this (optional on install) change to them.
Myrsloik
5th July 2019, 19:15
I would like to request a setup option (enabled by default for user setup) to add vspipe to the PATH environment variable on Windows if it's not already available. As far as I know modifying user PATH does not require elevated privileges, nor does it require a reboot.
Create an issue for it and maybe I'll do it.
ChaosKing
7th July 2019, 14:46
Hmm so installed R46 32+64bit in a vm, only per user installation. 32 first then 64. But only the 32bit version seems to work. (I also restarted the pc)
See here: https://i.imgur.com/QFUOxBu.png
What can I do to "debug" this further?
EDIT
vs 32 has no vsvfw.dll?
https://i.imgur.com/2m1WwyT.png
Re-install of VS64 didn't help.
gonca
7th July 2019, 16:17
I uninstalled Vapoursynth and Python completely.
Then installed Python 3.7.1 followed by Vapoursynth 64-R46
Worked fine
Then I upgraded Python to 3.7.3
This way you get to select per user or all users mode
Myrsloik
8th July 2019, 13:44
Hmm so installed R46 32+64bit in a vm, only per user installation. 32 first then 64. But only the 32bit version seems to work. (I also restarted the pc)
See here: https://i.imgur.com/QFUOxBu.png
What can I do to "debug" this further?
EDIT
vs 32 has no vsvfw.dll?
https://i.imgur.com/2m1WwyT.png
Re-install of VS64 didn't help.
I tested this in a clean VM and vsvfw.dll is installed properly.
Loading the module also worked fine in both cases. I have no idea what you're doing wrong.
Myrsloik
8th July 2019, 14:13
Import notice regarding installs:
PYTHON FROM THE MS STORE DOES NOT WORK
Installing the Python module with the "--user" option in pip ALSO DOES NOT WORK (for example if you want to have VapourSynth in multiple Python environments)
I think I'll finally look into the possibility of (optionally) installing python.
Boulder
9th July 2019, 07:37
Because of the "not installed for all users" problem, I uninstalled Python, reinstalled 3.7.3 for all users and then updated VS to R46 (64-bit). Now when I try to import a function, I just get an error "Python exception: No module named 'resamplehq'". In registry, the Python path seems ok and also all my .py files are in their usual location, in C:\Program Files\Python37\Lib\site-packages\vapoursynth.
EDIT: Looks like it's missing the __init__.py file from that Python directory?
ChaosKing
9th July 2019, 12:01
I tested this in a clean VM and vsvfw.dll is installed properly.
Loading the module also worked fine in both cases. I have no idea what you're doing wrong.
I tested it again. Fresh installation in a VM with windows Pro 1903 x64 (created by the MediaCreationTool1903.exe tool from ms)
Vapoursynth 32 didn't work after installing it as a per user installation.
See video here: https://www.dropbox.com/s/a2humc9d4lb7h3q/vs32err.mp4?dl=0
(watch with 1.5x speed ;-))
Myrsloik
9th July 2019, 13:29
I tested it again. Fresh installation in a VM with windows Pro 1903 x64 (created by the MediaCreationTool1903.exe tool from ms)
Vapoursynth 32 didn't work after installing it as a per user installation.
See video here: https://www.dropbox.com/s/a2humc9d4lb7h3q/vs32err.mp4?dl=0
(watch with 1.5x speed ;-))
I tried exactly the same thing on win10 1903 x64 home and it worked. I did install all updates first but that's the only thing that's possibly different.
Can you verify that you have the vs2019 (or possibly 2017) installed? Not having it could make it fail to load I guess.
ChaosKing
9th July 2019, 14:44
Yep that was it. After installing vcredist x86 2019 (14.21.xxx) it worked.
EDIT0:
And the runtimes are not shown in this installer bcs they can't be installed with user, rights!?
EDIT1
And I think there is a python installer bug or maybe I'm understanding it wrong. Vapoursynth detects it as a "per user installation" and not "for everyone".
https://i.imgur.com/IS3xRjF.png
EDIT2:
OK I can click on "Install for all users" in customize installation. So python launcher and python are two seperate things I guess!?
The thing is, on my PC it shows always the "for all users" option by default.
https://i.imgur.com/Hn4VZac.png
Boulder
13th July 2019, 13:21
Because of the "not installed for all users" problem, I uninstalled Python, reinstalled 3.7.3 for all users and then updated VS to R46 (64-bit). Now when I try to import a function, I just get an error "Python exception: No module named 'resamplehq'". In registry, the Python path seems ok and also all my .py files are in their usual location, in C:\Program Files\Python37\Lib\site-packages\vapoursynth.
EDIT: Looks like it's missing the __init__.py file from that Python directory?
Is there any way to make the 64-bit R46 installation work properly? R45 also seems to create a symlink to that Python directory and installs a .pyd file there as well. Installation of R46 didn't do either of those things.
ChaosKing
13th July 2019, 13:46
It seems that r46 just copies the dll instead of linking it. A reinstall does not help? You could try the diagnose function in vsrepogui to see which plugin folder is used and if it shows any problems.
Myrsloik
13th July 2019, 17:56
It seems that r46 just copies the dll instead of linking it. A reinstall does not help? You could try the diagnose function in vsrepogui to see which plugin folder is used and if it shows any problems.
I stopped linking because:
1. You need elevated privileges to create links
2. The Python bits are now installed as a normal package using pip and it doesn't really do links either
Myrsloik
13th July 2019, 17:58
Is there any way to make the 64-bit R46 installation work properly? R45 also seems to create a symlink to that Python directory and installs a .pyd file there as well. Installation of R46 didn't do either of those things.
You should never have put things in the vapoursynth subdir. That was reserved for VS and nothing else. Make your own directory if you want to do things that way or simply let VSRepo stuff everything into the right place...
Boulder
13th July 2019, 19:32
You should never have put things in the vapoursynth subdir. That was reserved for VS and nothing else. Make your own directory if you want to do things that way or simply let VSRepo stuff everything into the right place...
I think that once it was required to put your .py files containing your own VS functions under site-packages to get them to autoload so you could just import them in your script. It has worked perfectly fine until R46, hence the confusion.
Selur
14th July 2019, 14:36
Anyone maintaining some build script for all the plugins for Linux (Debian based systems)?
ChaosKing
14th July 2019, 18:48
There was a ppa by djcj but it seem to be gone. See here (and sublinks) https://github.com/vapoursynth/vapoursynth/issues/455
EDIT his git repo: https://github.com/darealshinji/vapoursynth-plugins
Selur
16th July 2019, 04:10
@ChaosKing: I know about djcjs repository problem is it doesn't get updated any more (even the repository is 'archived'), I spoke with him and he's trying to make a 'build' script for all the filters, but I was wondering if somebody already did that and may be shared it with others. :)
---
For those interested in the issue: https://github.com/darealshinji/scripts/tree/master/Hybrid (currently not 'finished' or 'well tested', but probably helpful)
Selur
24th July 2019, 03:50
Got an issue on Linux, regarding:
VSFilter https://github.com/HomeOfVapourSynthEvolution/VSFilter
VsFilterMod: https://github.com/sorayuki/VSFilterMod
xy-VSFilter: https://github.com/HomeOfVapourSynthEvolution/
all of them seem to be Windows only. Does anyone know how and if theses can be compiled on Linux?
Cu Selur
Myrsloik
24th July 2019, 09:48
Got an issue on Linux, regarding:
VSFilter https://github.com/HomeOfVapourSynthEvolution/VSFilter
VsFilterMod: https://github.com/sorayuki/VSFilterMod
xy-VSFilter: https://github.com/HomeOfVapourSynthEvolution/
all of them seem to be Windows only. Does anyone know how and if theses can be compiled on Linux?
Cu Selur
VSFilter will always be windows only due to how it's coded. Use Subtext which is included or any other libass based alternative (if there is one).
Selur
24th July 2019, 18:15
okay, thanks for the info.
lansing
26th July 2019, 20:18
Is there a max speed limit set in vapoursynth? I'm testing out my new cpu with source filter like ffms2 on my dvd source, and the max speed I got is 1800 fps, while the same ffms2 (https://forum.doom9.org/showthread.php?p=1879001#post1879001) in avisynth reaches 5200 fps.
Myrsloik
26th July 2019, 21:15
Is there a max speed limit set in vapoursynth? I'm testing out my new cpu with source filter like ffms2 on my dvd source, and the max speed I got is 1800 fps, while the same ffms2 (https://forum.doom9.org/showthread.php?p=1879001#post1879001) in avisynth reaches 5200 fps.
How did you test the speed?
lansing
26th July 2019, 21:41
How did you test the speed?
I open the script in vs editor and run the benchmark function, for avs+ I use avsmeter.
Myrsloik
26th July 2019, 22:17
I open the script in vs editor and run the benchmark function, for avs+ I use avsmeter.
"vspipe script.vpy ." <- try that
If it's still slow lower the number of threads. You're effectively creating a worst possible scenario if you throw a lot of threads at only one source filter with no processing.
lansing
27th July 2019, 01:16
"vspipe script.vpy ." <- try that
If it's still slow lower the number of threads. You're effectively creating a worst possible scenario if you throw a lot of threads at only one source filter with no processing.
Using vspipe gives 4200 fps, though it is still 25% slower than avs+.
Then I ran another test on a longer sd video (2 hours), avs+ got 4700 fps and vs got 4400 fps, the difference is much closer, while both took less than 25% cpu usage.
ChaosKing
27th July 2019, 10:45
Using different tools (avsmeter and vspipe) for performance comparison won't give you very precise result, since the mechanism for measuring the speed in each application is not the same. You can't really conclude your result unless the mechanism in each application is identical.
I can confirm it. It just tested via vspipe, vsedit, avsmeter and vdub2 with a 1h h264 DV res video.
vsedit is the "slowest" (always ~220fps slower). avsmeter always wins by a couple of sec (3-5sec) or 1586fps vs 1404fps in vspipe. This is also confirmed with a stopwatch in powershell.
In vdub2 on the other hand, avsiynth takes 58sec while vapoursynth is done in 54sec.
Conclusion: ffms2 is more or less equally fast in VS and AVS+ and the tools to measure the speed can have a significant impact on the speed and/or the results.
Myrsloik
27th July 2019, 23:53
Using vspipe gives 4200 fps, though it is still 25% slower than avs+.
Then I ran another test on a longer sd video (2 hours), avs+ got 4700 fps and vs got 4400 fps, the difference is much closer, while both took less than 25% cpu usage.
Go back a few years and you'll see similar questions to this. Anyway...
The 25% cpu usage is because you reach the multithreading limit of ffmpeg. This is a very artificial experiment.
The remaining speed difference is due to differences in how memory allocation works. You're basically benchmarking the respective memory pools in the most artificial way possible. This is an extremely artificial experiment.
Actually I think the ffmpeg binary would win this competition if you just find the right options. I'm generally not interested in benchmarks like these since people rarely even get the options right. See my first answer.
Go benchmark something meaningful next time.
lansing
28th July 2019, 21:36
Something weird I just noticed after more testings, in the beginning of my benchmarks, task manager shows all drives at 0% read/write activity while the cpu was running. But some 30 seconds in, the drive that contains the source video began to have some read activities for no reason. And this had effectively bottlenecked my speed. In my script here, it was running at 100+ fps with 100% cpu load for the first 30 seconds, then it had dropped to 70 fps when the drive started to have some 40% reading.
clip = core.ffms2.Source(file)
clip = core.dfttest.DFTTest(clip)
I have tested on both vs and avs+, same behavior.
Can anyone reproduce it?
ChaosKing
28th July 2019, 21:42
Something weird I just noticed after more testings, in the beginning of my benchmarks, task manager shows all drives at 0% read/write activity while the cpu was running. But some 30 seconds in, the drive that contains the source video began to have some read activities for no reason. And this had effectively bottlenecked my speed. In my script here, it was running at 100+ fps with 100% cpu load for the first 30 seconds, then it had dropped to 70 fps when the drive started to have some 40% reading.
clip = core.ffms2.Source(file)
clip = core.dfttest.DFTTest(clip)
I have tested on both vs and avs+, same behavior.
Can anyone reproduce it?
Sound like (os) caching...
Need more info: ram size, file size, ssd or hdd?
lansing
28th July 2019, 22:21
Sound like (os) caching...
Need more info: ram size, file size, ssd or hdd?
ram is 32GB, source video is 6.5G and I tested on both 5400rpm and 7200rpm hdd.
littlepox
31st July 2019, 02:38
Encoders typically encode the video in a percentage of that 4000 fps speed. If you are talking about difference between avs/vs to the actual encoding, it is becoming a basis point.
For a 1 hour encode you save not more than 10 seconds.
It might be the way avs/vs fetching and caching the data.
It might be the advantage that avs is C++ compiled while vs is dependent on Python, which in turn depends on the explainator.
It might be ... wait I'm wasting too much time than that 10 seconds.
VapourSynth is powerful for many reasons, but raw speed on absolutely simplest script doesn't fall into the list.
Myrsloik
31st July 2019, 21:33
R47 RC1
Test it so it's stable. Especially the makediff/mergediff/merge/maskedmerge filters since they were converted to intrinsics from asm.
64bits (https://www.dropbox.com/s/40yed0njm05lhvr/VapourSynth64-R47-RC1.exe?dl=1)
32bits (https://www.dropbox.com/s/gbs3t5kh4bfz8u9/VapourSynth32-R47-RC1.exe?dl=1)
Changes:
fixed a crash in vdecimate when both dryrun and clip2 is set (no1d)
updated zimg to 2.9.2 to fix a crash that would happen on certain invalid input combinations
improved message handler api and core info api
removed dependency on nasm
various installer improvements including a warning if the vs2019 runtimes aren't installed
Myrsloik
4th August 2019, 22:20
R47 has been released. The usual blog post here (http://www.vapoursynth.com/2019/08/r47-fixing-small-issues/).
Boulder
7th August 2019, 15:48
You should never have put things in the vapoursynth subdir. That was reserved for VS and nothing else. Make your own directory if you want to do things that way or simply let VSRepo stuff everything into the right place...
I think that once it was required to put your .py files containing your own VS functions under site-packages to get them to autoload so you could just import them in your script. It has worked perfectly fine until R46, hence the confusion.
So what is the proper way of doing things in R47?
Myrsloik
7th August 2019, 20:52
So what is the proper way of doing things in R47?
Use vsrepo to install things. Then it's always in the right place.
_Al_
8th August 2019, 04:38
I think that once it was required to put your .py files containing your own VS functions under site-packages to get them to autoload so you could just import them in your script. It has worked perfectly fine until R46, hence the confusion.
It should still work, it is python thing. Your .py file within site-packages of the same Python version you are running. Then it could be imported as module.
With new Python version installed , you move those files as well. So organize it well, always gather them in one directory, like site-packages/vapoursynth/.
I do not know where vsrepo puts those .py files, maybe somewhere else, into AppData.
Boulder
8th August 2019, 07:34
It should still work, it is python thing. Your .py file within site-packages of the same Python version you are running. Then it could be imported as module.
With new Python version installed , you move those files as well. So organize it well, always gather them in one directory, like site-packages/vapoursynth/.
I do not know where vsrepo puts those .py files, maybe somewhere else, into AppData.
I thought so as well, but it doesn't work. The exact same Python version installed (3.7.3) and Vapoursynth R45 works but R47 doesn't.
Using VSRepo is fine, but my own custom .py files need to be taken care of as well and the problem lies there.
_Al_
8th August 2019, 23:25
For example put just that line into your script:
import os
That would mean you can import standard library modules but not yours? Seems odd. Or it still pulls from somewhere else than you think.
Maybe domain conflict? For example you cannot name your module as subprocess.py, because there is already standard library modul named subprocess, I did it once and error message was not particularly clear about that.
poisondeathray
12th August 2019, 02:25
I thought so as well, but it doesn't work. The exact same Python version installed (3.7.3) and Vapoursynth R45 works but R47 doesn't.
Using VSRepo is fine, but my own custom .py files need to be taken care of as well and the problem lies there.
I just upgraded, and it complained something about python not being installed for all users
Short version - I reinstalled python for all users now, but it's in a different location now; so that's where you have to copy over the scripts to the new site-packages location . When you install for "all users" it's Program Files => Python37 => Lib => site-packages (at least on Windows , for x64)
Boulder
12th August 2019, 04:49
The only easy way to make it work was to use the folder which VSRepo uses (%appdata%\Roaming\Python\Python37\site-packages). I've had Python installed in that mentioned directory under Program Files for a long time now but I don't know why it stopped working now.
poisondeathray
12th August 2019, 05:13
The only easy way to make it work was to use the folder which VSRepo uses (%appdata%\Roaming\Python\Python37\site-packages). I've had Python installed in that mentioned directory under Program Files for a long time now but I don't know why it stopped working now.
At least you have a workaround . The site-packages in the Program Files seems works for me, but my old Vapoursynth Plugins64 directory changed to the AppData\Roaming\VapourSynth\plugins64 directory . Not sure why all the changes.
Myrsloik
12th August 2019, 15:06
At least you have a workaround . The site-packages in the Program Files seems works for me, but my old Vapoursynth Plugins64 directory changed to the AppData\Roaming\VapourSynth\plugins64 directory . Not sure why all the changes.
1. It never changed. There's always been a per user directory for plugins but people on doom9 hate the idea of not manually stuffing things into program files. That's still doable if you want to though.
2. Unprivileged installs. Try reading the changelog. Program files isn't writable for everyone.
Txico
13th August 2019, 15:59
Sorry to ask this here, I haven't seen it anywhere else. So ... HELP!
Where can I get Vapoursynth packages? Ubuntu PPAs is not active any more and doesn't seem to be any viable alternative...
I already tried to compile it myself, but after compiling from sources zimg and vapoursynth R47.1, after solving the Python environmental variable (In Ubuntu Python 3.7 is not in the same place), now I can't load the ffsm2 plug-in. I tried to download and compile it myself, but I don't know where to copy the plug-in, or which file it is ... ffmsindex is working from that sources after "make install", but don't know where the plug-in is or goes.
Something as simple as:
import vapoursynth as vs
core = vs.get_core()
video = core.ffms2.Source(source="Lol.mp4")
video.set_output()
returns me using vspipe: "AttributeError: No attribute with the name ffms2 exists. Did you mistype a plugin namespace?"
Something I forget in the vapoursynth compilation?
Selur
13th August 2019, 16:47
Have you tried explicitly loading the plugin?
core.std.LoadPlugin(path="path to ffms library")
Txico
13th August 2019, 18:16
Yep! That solved it!
So, Ubuntu is installing everything in the wrong places or Vapoursynth is looking always where it shouldn't. Grrrr!
And what about having a working Ubuntu PPA? That will had been so much easy, as it was before! Now I don't have a working vsedit ...
Myrsloik
13th August 2019, 20:43
Yep! That solved it!
So, Ubuntu is installing everything in the wrong places or Vapoursynth is looking always where it shouldn't. Grrrr!
And what about having a working Ubuntu PPA? That will had been so much easy, as it was before! Now I don't have a working vsedit ...
We're looking for people who will actually maintain linux packages and not just disappear. Applications welcome.
george84
14th August 2019, 07:05
Downloaded VapourSynth64-R47.exe double click and get Message Setup, Python 3.7 (64-bit) is installed for the current user only. ... . After clicking OK installation exits.
Uninstalled Python and Python Launcher and reinstalled it. Tried reinstall for All users as well as not. But still get same message and cannot install.
Running Windows10 with newest updates.
poisondeathray
14th August 2019, 17:52
Downloaded double click and get Message . After clicking OK installation exits.
Uninstalled Python and Python Launcher and reinstalled it. Tried reinstall for as well as not. But still get same message and cannot install.
Running Windows10 with newest updates.
Where did you get Python ? MS STORE ?
According to this
PYTHON FROM THE MS STORE DOES NOT WORK
https://forum.doom9.org/showthread.php?p=1878822#post1878822
LoRd_MuldeR
14th August 2019, 19:20
Downloaded double click and get Message . After clicking OK installation exits.
Uninstalled Python and Python Launcher and reinstalled it. Tried reinstall for as well as not. But still get same message and cannot install.
Running Windows10 with newest updates.
When installing Python via "official" installer, it is very important to select "Customize installation", not "Install now" ;)
Then, skip over the "Optional Features" page that comes next (you can keep defaults here) and, on the "Advanced Options" page, be sure to enable the "Install for all users" option.
If you installed Python before and missed to do this, then you'll have to uninstall first and then install again.
(Also be sure to download and use the "Windows x86-64 executable installer" of Python, if you intend to use VapourSynth64. The Python website tries to trick you into downloading the "x86" version)
george84
15th August 2019, 05:26
When installing Python via "official" installer, it is very important to select "Customize installation", not "Install now" ;)
Thank you. This worked.
Myrsloik
15th August 2019, 20:08
R47.2 released. You should definitely update if you use a previous R47 version since it fixes the merge bug introduced when converting everything to intrinsics.
chipxtreme
22nd August 2019, 22:13
R47.2 released. You should definitely update if you use a previous R47 version since it fixes the merge bug introduced when converting everything to intrinsics.
When I go to update I get Python 3.7 (64 bit) is installed for the current user only. Run the installer again and select "Install for me only" or install Python for all users.
I only have one user on my PC and when I installed Python I selected install for all users. What am I doing wrong?
Myrsloik
23rd August 2019, 19:10
When I go to update I get Python 3.7 (64 bit) is installed for the current user only. Run the installer again and select "Install for me only" or install Python for all users.
I only have one user on my PC and when I installed Python I selected install for all users. What am I doing wrong?
Update from which version? Does it actually work if you select to install for the current user only?
Do you have any registry entries in HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.7?
chipxtreme
23rd August 2019, 20:51
Update from which version? Does it actually work if you select to install for the current user only?
Do you have any registry entries in HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.7?
I uninstalled previous version and have since deleted it so not sure which version I had previously. I don't have any registry entries there?
Myrsloik
23rd August 2019, 21:04
I uninstalled previous version and have since deleted it so not sure which version I had previously. I don't have any registry entries there?
Then you've most likely installed python only for the current user...
cyaoeu
24th August 2019, 03:12
The only easy way to make it work was to use the folder which VSRepo uses (%appdata%\Roaming\Python\Python37\site-packages). I've had Python installed in that mentioned directory under Program Files for a long time now but I don't know why it stopped working now.
Thanks! A bit strange that it's %appdata%\Roaming\Python\Python37\site-packages and not %appdata%\Roaming\Python\Python37\site-packages\vapoursynth ... :scared:
chipxtreme
24th August 2019, 09:51
Then you've most likely installed python only for the current user...
Install for all users is selected by default and I didn't unselect it.
Myrsloik
25th August 2019, 10:30
Optimized VSynth build for Expr: https://www.sendspace.com/file/xleugj
Benefits of Exprt build:
Higher framerate in Exprt-intensive scripts
Higher framerate in MaskTools-intensive scripts
Lower electricity bill
Lower CPU temperature
As a reminder: you need to replace vapoursynth.dll both in the installation path AND in the python module directory (where vapoursynth*.pyd is located)
Typically:
C:\Program Files\VapourSynth\core
AND
C:\Program Files\Python37\Lib\site-packages
Go test this so it can be included in the next official release. And test the MVToolz optimizations too.
lansing
26th August 2019, 21:27
Did the image reader plugin got removed in the newer version? I couldn't call it in vs editor.
Myrsloik
26th August 2019, 21:34
Did the image reader plugin got removed in the newer version? I couldn't call it in vs editor.
It's not included in the installer so maybe you don't have it...
lansing
26th August 2019, 21:54
It's not included in the installer so maybe you don't have it...
What package is it in now? The vs documentation still listed it as included plugin from the installer.
ChaosKing
27th August 2019, 10:19
Optimised VSynth build for Expr: https://www.sendspace.com/file/xleugj
Benefits of Exprt build:
Higher framerate in Exprt-intensive scripts
Higher framerate in MaskTools-intensive scripts
Lower electricity bill
Lower CPU temperature
Here are some numbers:
Tested like this
PS D:\> vspipe.exe -p -e 5000 D:\del.vpy .
on a Ryzen 2600, 16GB ram, DVD 720x480 clip
Vinverse seems to consist only of Expr+MakeDiff and therefore has the biggest speedup of ~22%
https://github.com/HomeOfVapourSynthEvolution/havsfunc/blob/master/havsfunc.py#L2375
import havsfunc as haf
clip=haf.DeHalo_alpha(clip)
clip=haf.FineDehalo(clip)
# new build
Output 5001 frames in 16.87 seconds (296.39 fps)
Output 5001 frames in 16.73 seconds (298.98 fps)
Output 5001 frames in 16.84 seconds (296.98 fps)
# old build
Output 5001 frames in 17.04 seconds (293.43 fps)
Output 5001 frames in 17.07 seconds (292.99 fps)
Output 5001 frames in 17.04 seconds (293.51 fps)
clip=haf.srestore(clip)
# new build
Output 5001 frames in 35.41 seconds (141.24 fps)
Output 5001 frames in 35.12 seconds (142.42 fps)
Output 5001 frames in 35.74 seconds (139.94 fps)
# old build
Output 5001 frames in 35.20 seconds (142.07 fps)
Output 5001 frames in 35.24 seconds (141.91 fps)
Output 5001 frames in 35.09 seconds (142.53 fps)
clip=haf.SmoothLevels(clip)
# new build
Output 5001 frames in 10.41 seconds (480.28 fps)
Output 5001 frames in 10.34 seconds (483.86 fps)
Output 5001 frames in 10.33 seconds (484.30 fps)
# old build
Output 5001 frames in 10.66 seconds (469.29 fps)
Output 5001 frames in 10.64 seconds (469.96 fps)
Output 5001 frames in 10.66 seconds (468.97 fps)
clip=haf.Vinverse2(clip)
# new build
Output 5001 frames in 5.12 seconds (977.57 fps)
Output 5001 frames in 5.17 seconds (967.26 fps)
Output 5001 frames in 5.13 seconds (974.39 fps)
# old build
Output 5001 frames in 5.85 seconds (855.08 fps)
Output 5001 frames in 5.86 seconds (853.31 fps)
Output 5001 frames in 5.86 seconds (853.19 fps)
lansing
27th August 2019, 17:13
I have notice a new problem with Python 3.7.4 installer that's affecting vs installer. When I'm doing a clean install, if I choose "install now" in python installer, the default installation path would be something like "users\username\appdata\roaming\...", and the default installation path for the vs installer would be "users\username\appdata\local\programs\vapoursynth". But if I choose "custom installation" in python installer, its installation path would be changed to "c:\program files\python37", and the vs installer would also be changed to "c:\program files\vapoursynth".
Selur
31st August 2019, 06:23
Is there an alternative to AutoAdjust for Vapoursynth?
Myrsloik
31st August 2019, 17:52
Is there an alternative to AutoAdjust for Vapoursynth?
Not that I know of. Avisynth compatiblity should work though.
Selur
31st August 2019, 18:21
Not that I know of. Avisynth compatiblity should work though.
Only on Windows, or should this also work on Linux and I simply don't know how to get it working?
feisty2
6th September 2019, 19:59
why is vsscript.dll required to be placed in the same folder with vspipe.exe for the new release?
Myrsloik
6th September 2019, 20:17
why is vsscript.dll required to be placed in the same folder with vspipe.exe for the new release?
I stopped putting a copy of vsscript.dll in the system directory in R46. Putting things into the system directory is bad.
Changing the vsscript api to match the style of the rest of vs so importing it becomes trivial is on my todo list and will fix it. Some day.
Jukus
10th September 2019, 15:56
Is there a detailed user guide? Of course, I am happy to use QTGMC and other plugins, but there is very little knowledge and information.
jackoneill
10th September 2019, 18:53
Is there a detailed user guide? Of course, I am happy to use QTGMC and other plugins, but there is very little knowledge and information.
There is some documentation: http://www.vapoursynth.com/doc/
Jukus
10th September 2019, 19:39
There is some documentation: http://www.vapoursynth.com/doc/
Thank you, I know. But I'm interested, for example, the sequence of applications of filters, I think it is not always obvious. Changing the brightness and color need before QTGMC or after, maybe there is no difference? And other nuances of video processing that I don't know about.
MeteorRain
10th September 2019, 23:18
That sounds a bit more than a guide, but more of lesson(s) (of being an encoder).
QTGMC is a deinterlacer so it always comes at early stage (probably after delogo, but that depends also.)
And to us, we never change brightness and color of a mastered work (e.g. when backing up bluray discs). But if it's your own recording, things can be a lot different.
stax76
12th September 2019, 04:09
I've been studying some tutorials at realpython.com and noticed the tutorial and vs code format code like so:
def foo(a=1, b=1):
foo(a=1, b=1)
In staxrip there is much avs/vs code that use spaces:
def foo(a = 1, b = 1):
foo(a = 1, b = 1)
What is more common? Is both OK or is one officially discouraged and what about AviSynth?
ChaosKing
12th September 2019, 08:29
This looks like the official style guide https://www.python.org/dev/peps/pep-0008/
Seems like def foo(a=1, b=1, ...) is recommended.
Myrsloik
12th September 2019, 08:51
I've been studying some tutorials at realpython.com and noticed the tutorial and vs code format code like so:
def foo(a=1, b=1):
foo(a=1, b=1)
In staxrip there is much avs/vs code that use spaces:
def foo(a = 1, b = 1):
foo(a = 1, b = 1)
What is more common? Is both OK or is one officially discouraged and what about AviSynth?
Use whatever you like as long as you're consistent.
aegisofrime
13th September 2019, 15:58
Gonna post this here as I don't think it deserves it's own thread, but what happen to Stephen R. Savage's post about his optimized MVTools?
Myrsloik
13th September 2019, 16:16
Gonna post this here as I don't think it deserves it's own thread, but what happen to Stephen R. Savage's post about his optimized MVTools?
It got merged into normal mvtools and will be in the next release.
ChaosKing
18th September 2019, 13:20
Does get_read_array() return only "video data" without "meta data or something"?
I was comparing different source filters (ffms2, d2vsource, lsmash, dgdecnv) and noticed something strange with VOB files. I save every hash in a list. If the video file passes the "seek-test" the hashes of every source filters should the same. This was the case with many files.
But for vob files the hashes differ with every source filter. Is there something special with VOB files? I mean they can only be decoded in "one correct" way, right? They look all ok in vsedit...
example log
Seek linear order (hash, PicType, n-Frame)
d653d648d8e6407e507c6eaa0116ebe5 I 0
30ad6c41b89dfd8880a12bde6952e7b2 B 1
5e0cb8bad4ba2ec37b4f4db0d4a65691 P 2
...
#from seek-test.py
def hash_frame(frame):
md5 = hashlib.md5()
for plane in range(frame.format.num_planes):
for line in frame.get_read_array(plane):
md5.update(line)
return md5.hexdigest()
Myrsloik
18th September 2019, 13:47
Does get_read_array() return only "video data" without "meta data or something"?
I was comparing different source filters (ffms2, d2vsource, lsmash, dgdecnv) and noticed something strange with VOB files. I save every hash in a list. If the video file passes the "seek-test" the hashes of every source filters should the same. This was the case with many files.
But for vob files the hashes differ with every source filter. Is there something special with VOB files? I mean they can only be decoded in "one correct" way, right? They look all ok in vsedit...
example log
Seek linear order (hash, PicType, n-Frame)
d653d648d8e6407e507c6eaa0116ebe5 I 0
30ad6c41b89dfd8880a12bde6952e7b2 B 1
5e0cb8bad4ba2ec37b4f4db0d4a65691 P 2
...
#from seek-test.py
def hash_frame(frame):
md5 = hashlib.md5()
for plane in range(frame.format.num_planes):
for line in frame.get_read_array(plane):
md5.update(line)
return md5.hexdigest()
It's not strange at all. It wasn't until h.264 the standard required (or even specified for that matter) how the DCT transforms should be done in a bit exact manner.
ChaosKing
18th September 2019, 13:54
It's not strange at all. It wasn't until h.264 the standard required (or even specified for that matter) how the DCT transforms should be done in a bit exact manner.
Aha, ok good to know. :thanks:
Jukus
18th September 2019, 14:17
What is the difference between ffms2 and lsmas?
I already realized that for mpeg 2 need to use only d2v.
ChaosKing
18th September 2019, 15:31
What is the difference between ffms2 and lsmas?
I already realized that for mpeg 2 need to use only d2v.
Both are based on ffmpeg. In addition lsmash has GPU support and can open MP4, MOV, ISO Base Media without creating an extra index.
From experience I would say lsmash is more often frame accurate then ffms2.
Jukus
18th September 2019, 22:13
How to specify the path to create the index file for ffms2 and lsmas? That is, if I mount the ISO, then I can not write anything in the same directory.
ChaosKing
18th September 2019, 22:43
How to specify the path to create the index file for ffms2 and lsmas? That is, if I mount the ISO, then I can not write anything in the same directory.
It's all explained in the readme https://github.com/FFMS/ffms2/blob/master/doc/ffms2-vapoursynth.md#source
ffms2.Source("video.mp4", cachefile="video.mp4.ffindex")
I think lsmash does not support a custom cache file path.
EDIT
Seems to be supported https://github.com/HolyWu/L-SMASH-Works/tree/master/VapourSynth
cachefile (default : source + ".lwi")
The filename of the index file (where the indexing data is saved).
Jukus
19th September 2019, 19:36
@ChaosKing
Unfortunately, it’s still not clear how this should work, can a specific example be provided?
ChaosKing
19th September 2019, 19:41
@ChaosKing
Unfortunately, it’s still not clear how this should work, can a specific example be provided?
import vapoursynth as vs
core = vs.core
clip = core.lsmas.LWLibavSource(source=r"D:\video.mkv", cachefile=r"C:\folderxy\myCacheFile.iwi")
clip.set_output()
Jukus
19th September 2019, 19:47
@ChaosKing
vapoursynth.Error: LWLibavSource: Function does not take argument(s) named cachefile
ChaosKing
19th September 2019, 19:56
@ChaosKing
Use this version https://github.com/HolyWu/L-SMASH-Works/releases
Jukus
19th September 2019, 20:19
Use this version https://github.com/HolyWu/L-SMASH-Works/releases
Ok, thanks. But is it possible to make an index without Vapour, as it is done for d2v?
ChaosKing
19th September 2019, 20:29
Ok, thanks. But is it possible to make an index without Vapour, as it is done for d2v?
Only ffms2 has an indexer: ffmsindex.exe
Latest version: https://forum.doom9.org/showthread.php?p=1883905#post1883905
Jukus
19th September 2019, 20:56
Also, can create a label file. Only now I thought of it :) But not a very elegant solution, yes.
LigH
23rd September 2019, 07:48
List of all known plugins and scripts (http://www.vapoursynth.com/doc/pluginlist.html)
contains a link to VirtualDub1 a.k.a. VirtualDub2 :rolleyes:
Another link to be updated: https://github.com/woshin/hnwvsfunc
ChaosKing
23rd September 2019, 08:39
contains a link to VirtualDub1 a.k.a. VirtualDub2 :rolleyes:
Another link to be updated: https://github.com/woshin/hnwvsfunc
hnwvsfunc is dead, use: https://github.com/Helenerineium/G41Fun
patxitron
28th September 2019, 15:13
Hello.
I'm trying to compile vapoursynth in ubuntu 18.04. First I installed development packages for libav*, iconv, pango, freetype, fonconfig, tesseract and another libraries. I downloaded, compiled and installed zimg v2.9 branch and ImageMagick 7. Then when compiling vapoursynth I get this error:
CXXLD libvapoursynth.la
/usr/bin/ld: ./.libs/libexprfilter.a(libexprfilter_la-exprfilter.o): relocation R_X86_64_PC32 against undefined symbol `_ZN12_GLOBAL__N_115ExprCompiler1289constDataE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:1166: recipe for target 'libvapoursynth.la' failed
make: *** [libvapoursynth.la] Error 1
What am I doing wrong?
Thank you.
I've tried passing --enable-shared --disable-static --with-pic to configure without success.
The configure output is:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ZIMG... yes
checking for library containing dlopen... -ldl
checking for sched_getaffinity... yes
checking for cpuset_getaffinity... no
checking for a Python interpreter with version >= 3... python3
checking for python3... /usr/bin/python3
checking for python3 version... 3.6
checking for python3 platform... linux
checking for python3 script directory... ${prefix}/lib/python3.6/site-packages
checking for python3 extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking for PYTHON3... yes
checking for cython3... cython3
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for library containing libiconv_open... no
checking for library containing iconv_open... none required
checking for LIBASS... yes
checking for FFMPEG... yes
checking for IMAGEMAGICK... yes
checking whether imagemagick is usable... yes
checking for TESSERACT... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pc/vapoursynth.pc
config.status: creating pc/vapoursynth-script.pc
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
Are_
28th September 2019, 18:38
Autotools build system is broken in current master, use 47.2 release for now.
EDIT: Now that I remember, the you only need to pass -std=c++17 to your CXXFLAGS to make it compile.
patxitron
29th September 2019, 10:02
Now that I remember, the you only need to pass -std=c++17 to your CXXFLAGS to make it compile.
This worked! Thank you. however now it fails in another point:
CYTHON src/cython/vapoursynth.c
Error compiling Cython file:
------------------------------------------------------------
...
# If we are not using VSScript, do nothing.
if self.single:
return
_environment_state.current = _env_current_stack().pop()
def __eq__(self, other):
^
------------------------------------------------------------
src/cython/vapoursynth.pyx:133:4: Special method __eq__ must be implemented via __richcmp__
Error compiling Cython file:
------------------------------------------------------------
...
core = kwargs.pop("core", None) or get_core()
vals = self._as_dict()
vals.update(**kwargs)
return core.register_format(**vals)
def __eq__(self, other):
^
------------------------------------------------------------
src/cython/vapoursynth.pyx:710:4: Special method __eq__ must be implemented via __richcmp__
Makefile:2217: recipe for target 'src/cython/vapoursynth.c' failed
make: *** [src/cython/vapoursynth.c] Error 1
EDIT: I solved it changing:
def __eq__(self, other):
{BODY}
by
def __richcmp__(self, other, op):
if op == 2:
{BODY}
else:
err_msg = "op {0} isn't implemented yet".format(op)
raise NotImplementedError(err_msg)
as the error message suggest.
qyot27
29th September 2019, 17:55
http://vapoursynth.com/doc/installation.html#linux-and-os-x-compilation-instructions:
Cython 0.28 or later installed in your Python 3 environment
https://packages.ubuntu.com/bionic/cython:
Package: cython (0.26.1-0.4) [universe]
That is your problem. Update Cython. Or just scroll up a little bit where VapourSynth is now available directly through pip.
poisondeathray
2nd October 2019, 15:34
MaskedMerge bug in R47 ?
Overlay issue
See post 486 and the replies. Works in R46
https://forum.doom9.org/showpost.php?p=1886331&postcount=486
https://forum.doom9.org/showthread.php?p=1886366
Myrsloik
2nd October 2019, 17:16
MaskedMerge bug in R47 ?
Overlay issue
See post 486 and the replies. Works in R46
https://forum.doom9.org/showpost.php?p=1886331&postcount=486
https://forum.doom9.org/showthread.php?p=1886366
Did you try R47.2?
poisondeathray
2nd October 2019, 17:25
Did you try R47.2?
Yes, same problem. That's actually the one I was using, but I tried R47.0 too . So it suggests something introduced between R46 to R47.0 that is causing it
Myrsloik
3rd October 2019, 22:01
R48-test1 64bit (https://www.dropbox.com/s/njngo2q2z1rsd87/VapourSynth64-R48-test1.exe?dl=1)
Changes:
r48:
it's now possible to select which optimized code path is used for internal filters (sekrit-twc)
avx2 optimization in many filters, previously the internal ones were mostly sse2 (sekrit-twc)
expr filter can now better optimize expressions (sekrit-twc)
the portable version now includes all the plugins bundled with the normal installer again
Go test it so there can be a faster release soon. Should fix all known bugs in merge filters.
Btw, official audio support is probably coming soon as well.
poisondeathray
3rd October 2019, 22:09
Overlay / maskedmerge works as expected now with R48test1
Great to "hear" :D about the upcoming audio support
_Al_
4th October 2019, 01:29
Btw, official audio support is probably coming soon as well.
Christmas is coming early this year? :) ,wow
~ VEGETA ~
4th October 2019, 03:49
I have this problem: https://imgur.com/a/76QEOYb
My system is windows 10 pro x64 with vapoursynth x64 the 47.2 version (latest from website).
Seems like Tcanny and EEDI3 can't be loaded for some reason.
~ VEGETA ~
4th October 2019, 11:11
Does the latest NNEDI3CL load successfully?
Here is the log:
/!\ Only Plugins and no Scripts are tested /!\
VapourSynth Video Processing Library
Copyright (c) 2012-2019 Fredrik Mellbin
Core R47
API R3.6
Options: -
OS: Microsoft Windows 10 Pro
Is 64Bit OS?: True
CPU: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
CPU Cores: 8
Python location: C:\python37\python.exe
Loaded VapourSynth dll: C:\python37\lib\site-packages\vapoursynth.dll
Found an installation in HKEY_LOCAL_MACHINE\SOFTWARE\VapourSynth
- Path: C:\Program Files\VapourSynth
- PythonPath: C:\python37\
- Version: R47.2
============================================================
Checked Plugins: 54, Notices: 5, Errors: 2
Plugin Paths:
• C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64
• C:\Program Files\VapourSynth\plugins
🔥 Error unknown:
------------------------------------------------------------
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\EEDI3m.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\TCanny.dll
🤨 Unidentified DLLs (maybe also Plugin dependencies?):
------------------------------------------------------------
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\cudart64_80.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\libfftw3-3.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\libfftw3f-3.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\libmfxsw64.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\w2xc.dll
👍 Successfully loaded Plugins:
------------------------------------------------------------
AddGrain.dll
Bilateral.dll
BM3D.dll
CTMF.dll
d2vsource.dll
DCTFilter.dll
Deblock.dll
DFTTest.dll
DGMVCSourceVS.dll
EdgeFixer.dll
EEDI2.dll
ffms2.dll
fft3dfilter.dll
FFTSpectrum.dll
flash3kyuu_deband.dll
fmtconv.dll
KNLMeansCL.dll
libawarpsharp2.dll
libbifrost.dll
libdecross.dll
libdescale.dll
libfluxsmooth.dll
libhqdn3d.dll
libmedian.dll
libmsmoosh.dll
libmvtools.dll
libmvtools_sf_em64t.dll
libnnedi3.dll
libsangnom.dll
libtcomb.dll
libtedgemask.dll
LSMASHSource.dll
NNEDI3CL.dll
Retinex.dll
RGSF_x64.dll
TColorMask.dll
TDeintMod.dll
tonemap.dll
TTempSmooth.dll
vapoursynth-dpid.dll
VSFilter.dll
VSFilterMod.dll
vslsmashsource.dll
vsznedi3.dll
Waifu2x-w2xc.dll
xy-VSFilter.dll
Yadifmod.dll
So I guess yes it does but what about TCanny also? and why this issue to begin with since the dlls are there?
ChaosKing
4th October 2019, 11:33
Here is the log:
/!\ Only Plugins and no Scripts are tested /!\
VapourSynth Video Processing Library
Copyright (c) 2012-2019 Fredrik Mellbin
Core R47
API R3.6
Options: -
OS: Microsoft Windows 10 Pro
Is 64Bit OS?: True
CPU: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
CPU Cores: 8
Python location: C:\python37\python.exe
Loaded VapourSynth dll: C:\python37\lib\site-packages\vapoursynth.dll
Found an installation in HKEY_LOCAL_MACHINE\SOFTWARE\VapourSynth
- Path: C:\Program Files\VapourSynth
- PythonPath: C:\python37\
- Version: R47.2
============================================================
Checked Plugins: 54, Notices: 5, Errors: 2
Plugin Paths:
• C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64
• C:\Program Files\VapourSynth\plugins
Error unknown:
------------------------------------------------------------
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\EEDI3m.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\TCanny.dll
Unidentified DLLs (maybe also Plugin dependencies?):
------------------------------------------------------------
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\cudart64_80.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\libfftw3-3.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\libfftw3f-3.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\libmfxsw64.dll
C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\w2xc.dll
Successfully loaded Plugins:
------------------------------------------------------------
AddGrain.dll
Bilateral.dll
BM3D.dll
CTMF.dll
d2vsource.dll
DCTFilter.dll
Deblock.dll
DFTTest.dll
DGMVCSourceVS.dll
EdgeFixer.dll
EEDI2.dll
ffms2.dll
fft3dfilter.dll
FFTSpectrum.dll
flash3kyuu_deband.dll
fmtconv.dll
KNLMeansCL.dll
libawarpsharp2.dll
libbifrost.dll
libdecross.dll
libdescale.dll
libfluxsmooth.dll
libhqdn3d.dll
libmedian.dll
libmsmoosh.dll
libmvtools.dll
libmvtools_sf_em64t.dll
libnnedi3.dll
libsangnom.dll
libtcomb.dll
libtedgemask.dll
LSMASHSource.dll
NNEDI3CL.dll
Retinex.dll
RGSF_x64.dll
TColorMask.dll
TDeintMod.dll
tonemap.dll
TTempSmooth.dll
vapoursynth-dpid.dll
VSFilter.dll
VSFilterMod.dll
vslsmashsource.dll
vsznedi3.dll
Waifu2x-w2xc.dll
xy-VSFilter.dll
Yadifmod.dll
So I guess yes it does but what about TCanny also? and why this issue to begin with since the dlls are there?
Are you using the integrated graphics card? you're probably missing the OpenCL dependency. https://software.intel.com/en-us/articles/opencl-drivers
~ VEGETA ~
4th October 2019, 12:49
As for openCl, I installed the latest driver and still the same log file and errors appear.
Here is one of the messages: https://imgur.com/a/76QEOYb
Problematic stuff is in Tcanny.dll and EEDI3m.dll
Also, after updating the plugins and scripts... and using havfunc's aaf function, I get this:
Failed to evaluate the script:
Python exception: int() argument must be a string, a bytes-like object or a number, not 'list'
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1946, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 1947, in vapoursynth.vpy_evaluateScript
File ".....\ep02.vpy", line 21, in
#aa = haf.aaf(grain)
File ".....\Python\Python37\site-packages\havsfunc.py", line 5149, in aaf
return core.rgvs.Repair(aa, inputClip, mode=[repMode])
File "src\cython\vapoursynth.pyx", line 1832, in vapoursynth.Function.__call__
File "src\cython\vapoursynth.pyx", line 648, in vapoursynth.typedDictToMap
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'
while it worked perfectly before with the same script.
So I have these 2 problems.
patxitron
4th October 2019, 12:59
http://vapoursynth.com/doc/installation.html#linux-and-os-x-compilation-instructions:
https://packages.ubuntu.com/bionic/cython:
That is your problem. Update Cython. Or just scroll up a little bit where VapourSynth is now available directly through pip.
Ok I see. However, I think the configure script should check the correct version.
checking for cython3... cython3
Best regards.
ChaosKing
4th October 2019, 13:08
As for openCl, I installed the latest driver and still the same log file and errors appear.
Here is one of the messages: https://imgur.com/a/76QEOYb
Could you first run this in cmd or powershell? I would like to know what the error code / error msg is:
python -c "import vapoursynth; c=vapoursynth.core; c.std.LoadPlugin(r'C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\EEDI3m.dll')"
python -c "import vapoursynth; c=vapoursynth.core; c.std.LoadPlugin(r'C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\TCanny.dll')"
~ VEGETA ~
4th October 2019, 13:45
Could you first run this in cmd or powershell? I would like to know what the error code / error msg is:
python -c "import vapoursynth; c=vapoursynth.core; c.std.LoadPlugin(r'C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\EEDI3m.dll')"
python -c "import vapoursynth; c=vapoursynth.core; c.std.LoadPlugin(r'C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\TCanny.dll')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "src\cython\vapoursynth.pyx", line 1852, in vapoursynth.Function.__call__
vapoursynth.Error: Failed to load C:\Users\hossa\AppData\Roaming\VapourSynth\plugins64\EEDI3m.dll. GetLastError() returned 127.
~ VEGETA ~
4th October 2019, 13:50
Thanks. Fixed on github now.
can i update using vsrepo gui now?
ChaosKing
4th October 2019, 14:15
vsrepo can't update in realtime.
error 127 indicates that there is an appropriate DLL found but a required procedure export is missing. So maybe the "opencl requirements" for TCanny changed in the latest version? Or you need to install a different opencl version.
~ VEGETA ~
4th October 2019, 14:20
vsrepo can't update in realtime.
error 127 indicates that there is an appropriate DLL found but a required procedure export is missing. So maybe the "opencl requirements" for TCanny changed in the latest version? Or you need to install a different opencl version.
Ok, i will update the script manually.
As for opencl, I installed latest driver which should include latest opencl. what should i do now?
_Al_
6th October 2019, 18:00
Doing numpy operations I discovered that returning frame from within ModifyFrame() could be numpy image and vapoursynth does not object at all. Or rather to say it is vapoursynth type of object, but they are the same. So there is no need to copy image to a new frame using f.get_write_array(), which takes time. So for example with this simple numpy operation , drawing two cross lines into vapoursynth frame takes about 10 times faster.
this it with copying a new frame:
import vapoursynth as vs
from vapoursynth import core
import numpy as np
import timeit
def numpy_process(n,f):
start = timeit.default_timer()
fout = f.copy()
for p in range(3):
plane = np.asarray(f.get_read_array (p))
plane_out = np.asarray(fout.get_write_array(p))
#numpy operation with numpy image (two dimensional, because using one plane only)
plane[360,0:1280] = 255
plane[0:720,640] = 255
np.copyto(plane_out, plane)
print(timeit.default_timer()-start)
return fout
clip = core.std.BlankClip(width=1280, height=720, format = vs.RGB24)
clip = core.std.ModifyFrame(clip, clip, numpy_process)
clip.set_output()
times for rendering a frame:
0.0011401229999998819
0.0011680329999999017
0.0011924130000000588
0.001274217999999827
0.0011475010000001618
0.001175732000000096
then this code:
def numpy_process(n,f):
start = timeit.default_timer()
for p in range(3):
plane = np.asarray(f.get_read_array (p))
plane[360,0:1280] = 255
plane[0:720,640] = 255
print(timeit.default_timer()-start)
return f
clip = core.std.BlankClip(width=1280, height=720, format = vs.RGB24)
clip = core.std.ModifyFrame(clip, clip, numpy_process)
clip.set_output()
renders these times for frame:
0.00011035500000033949
0.00011580899999863448
0.00011709199999998532
0.00011292100000126482
0.00011163799999991397
0.00016841999999961388
0.0001109970000001681
Was surprised by that that those frames could be overwritten directly, is there some drawback?
Myrsloik
6th October 2019, 18:15
Memory corruption. Don't do it.
_Al_
6th October 2019, 18:17
I wanted to ask what it means, but I guess corruption means corruption, so it might fail. Thank you.
poisondeathray
7th October 2019, 02:15
Spoke too soon. Getting an overlay bug, probably related to mask in R48test1 . Works ok in R46, R47.2 . But in R48test1 it's discolored
orig = core.ffms2.Source(r'testchart.png')
ovr = core.ffms2.Source(r'rgba_overlay.png')
orig_10bit444 = core.resize.Bicubic(orig, format=vs.YUV444P10, matrix_s="709")
ovrf_10bit444 = core.resize.Bicubic(ovr[0], format=vs.YUV444P10, matrix_s="709", range_s="full")
ovrm_10bit444 = core.resize.Bicubic(ovr[1], format=vs.YUV444P10, matrix_s="709", range_s="full")
overl = haf.Overlay(orig_10bit444, ovrf_10bit444, mask=ovrm_10bit444)
Image assets
https://www.mediafire.com/file/hf27ncfihfjiee9/testchart%2Coverlay.rar/file
Myrsloik
7th October 2019, 09:38
Spoke too soon. Getting an overlay bug, probably related to mask in R48test1 . Works ok in R46, R47.2 . But in R48test1 it's discolored
orig = core.ffms2.Source(r'testchart.png')
ovr = core.ffms2.Source(r'rgba_overlay.png')
orig_10bit444 = core.resize.Bicubic(orig, format=vs.YUV444P10, matrix_s="709")
ovrf_10bit444 = core.resize.Bicubic(ovr[0], format=vs.YUV444P10, matrix_s="709", range_s="full")
ovrm_10bit444 = core.resize.Bicubic(ovr[1], format=vs.YUV444P10, matrix_s="709", range_s="full")
overl = haf.Overlay(orig_10bit444, ovrf_10bit444, mask=ovrm_10bit444)
Image assets
https://www.mediafire.com/file/hf27ncfihfjiee9/testchart%2Coverlay.rar/file
Does it work if you add core.std.SetMaxCPU("none") to the top of the script?
poisondeathray
7th October 2019, 14:27
Does it work if you add core.std.SetMaxCPU("none") to the top of the script?
Yes . Do you have to specify it manually now , no autodetection ?
This was on a Haswell with AVX2 only
DJATOM
7th October 2019, 16:22
Yes . Do you have to specify it manually now , no autodetection ?
This was on a Haswell with AVX2 only
No, auto-detection is still works, but now we can set lower instruction set (or fallback to C routines) on purpose. For example, if there are some bugs with avx2 optimizations, you can fallback to slower but well working functions.
Myrsloik
9th October 2019, 11:06
Several bugs were found already. Will post a new build soon when they're fixed. Apparently Expr is broken too in some cases.
poisondeathray
9th October 2019, 16:17
Several bugs were found already. Will post a new build soon when they're fixed. Apparently Expr is broken too in some cases.
Was it from any of the Expr AVS+ code from pinterf? If so, is AVS+ affected too ?
Myrsloik
9th October 2019, 18:36
Was it from any of the Expr AVS+ code from pinterf? If so, is AVS+ affected too ?
No and no. Also it could be a bug in the expression itself now that we've investigated it a bit...
_Al_
10th October 2019, 04:48
about wrapping/decorating vapoursynth core functions:
import vapoursynth as vs
from vapoursynth import core
import functools
clip = core.std.BlankClip(width=640, height=360, format=vs.YUV420P8)
def CropAbs_extra(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
print('some extra work')
return f(*args, **kwargs)
return wrapper
#this does not work:
#core.std.CropAbs = CropAbs_extra(core.std.CropAbs)
#clip = core.std.CropAbs(clip, 360,240, 0,0) #to crop + some extra work
#AttributeError: 'vapoursynth.Plugin' object has no attribute 'CropAbs'
#this works but script lines would need to be rewritten:
temp = CropAbs_extra(core.std.CropAbs)
clip = temp(clip, 360,240, 0,0) #to crop + some extra work
I edited code above, because it did not work before.
Is there any way to keep :
clip = core.std.CropAbs(clip, 360,240, 0,0) and use a wrapper to it?
Thanks.
this does not work also:
setattr(core.std, 'CropAbs', CropAbs_extra(core.std.CropAbs))
#AttributeError: 'vapoursynth.Plugin' object has no attribute 'CropAbs'
jackoneill
10th October 2019, 22:34
about wrapping/decorating vapoursynth core functions:
import vapoursynth as vs
from vapoursynth import core
import functools
clip = core.std.BlankClip(width=640, height=360, format=vs.YUV420P8)
def CropAbs_extra(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
print('some extra work')
return f(*args, **kwargs)
return wrapper
#this does not work:
#core.std.CropAbs = CropAbs_extra(core.std.CropAbs)
#clip = core.std.CropAbs(clip, 360,240, 0,0) #to crop + some extra work
#AttributeError: 'vapoursynth.Plugin' object has no attribute 'CropAbs'
#this works but script lines would need to be rewritten:
temp = CropAbs_extra(core.std.CropAbs)
clip = temp(clip, 360,240, 0,0) #to crop + some extra work
I edited code above, because it did not work before.
Is there any way to keep :
clip = core.std.CropAbs(clip, 360,240, 0,0) and use a wrapper to it?
Thanks.
this does not work also:
setattr(core.std, 'CropAbs', CropAbs_extra(core.std.CropAbs))
#AttributeError: 'vapoursynth.Plugin' object has no attribute 'CropAbs'
I think it's a lot more work than you want, but you can replace vs.get_core with a function that returns a fake core, which will be a wrapper object around the real core:
import vapoursynth as vs
vs.get_core = function that returns fake core
import other, stuff
core = vs.get_core()
...
I'm not sure this actually works.
WolframRhodium
11th October 2019, 07:57
Agree with jackoneill, the cython part of VS prevents you from modifying attributes of "core" and its attribute "plugin". You should define your own "core" instead.
_Al_
11th October 2019, 16:06
thank you guys,
WolframRhodium thank you for the script, it might be over my head , I'll tackle it though, thank you
_Al_
11th October 2019, 16:44
At the end of vapoursynth2.py I put:
print(core.version())
if hasattr(core, 'ffms2'):
print('ffms2 is loaded')
else:
print('ffms2 is not loaded')
clip = core.ffms2.Source(video.mp4)
#clip = core.std.BlankClip(width=640, height=360)#BlankClip does not create VideoNode as well
if isinstance(clip, vs.VideoNode):
print('clip was created')
else:
print('clip is not vs.VideoNode')
def CropAbs_extra(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
print('working in wrapper')
return f(*args, **kwargs)
return wrapper
print(clip)
core.std.CropAbs = CropAbs_extra(core.std.CropAbs)
clip = core.std.CropAbs(clip, 360,240,0,0)
print(clip)
I got output:
VapourSynth Video Processing Library
Copyright (c) 2012-2018 Fredrik Mellbin
Core R45
API R3.5
Options: -
ffms2 is loaded
clip is not vs.videoNode
<__main__._VideoNode object at 0x00000000037B2A58>
so i t prints clip is a videonode but it does not work as a regular clip
But it does not throw any error trying to wrap that core.std.CropAbs function though, but also it is not in that wrapper.
Anyway , it might take a while to grasp it all.
WolframRhodium
12th October 2019, 00:50
Sorry for the confusion, for your code here (https://gist.github.com/WolframRhodium/3ca2342b7f27904db91bdc7ac4441e28) is a tiny example.
_Al_
12th October 2019, 01:44
Thank you so much.
So far I got quickly this together:
tinyvs.py:
import vapoursynth as vs
from vapoursynth import core as _vscore
import functools
class _Plugin:
def __init__(self, namespace):
self.__dict__.update((name, getattr(namespace, name)) for name in dir(namespace)) # func_name : func
class _Core:
def __init__(self):
self.__dict__.update((name, get_plugin(name)) for name in dir(_vscore)) # (namespace : (func_name : func)) or (attr_name : attr)
def get_plugin(name):
attr = getattr(_vscore, name)
if isinstance(attr, vs.Plugin):
return _Plugin(attr)
else:
return attr
core = _Core()
def CropAbs_extra(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
print('extra work with calling vs function')
c= f(*args, **kwargs)
return c
return wrapper
core.std.CropAbs = CropAbs_extra(core.std.CropAbs)
and actual script could be:
import importlib
import tinyvs
importlib.reload(tinyvs) #mandatory reload so wrapper always works
core = tinyvs.core
clip = core.std.BlankClip(width=640, height=360)
clip = core.std.CropAbs(clip, 360,240, 0,0)
output:
extra work with calling vs function
Thanks
_Al_
12th October 2019, 05:55
Looking at that tinyvs.py, ...,this is a magic. How can you come up with stuff like this ,:)
core object is not copied, not wrapped but instead its attributes, plugins dir is just forwarded/copied to a new object so domains can be hijacked in script but functionality is kept. :o
Cary Knoop
12th October 2019, 06:42
It must be me but I fail to see any benefit in overriding Vapoursynth core functions, I only see disadvantages.
WolframRhodium
12th October 2019, 09:32
Looking at that tinyvs.py, ...,this is a magic. How can you come up with stuff like this ,:)
core object is not copied, not wrapped but instead its attributes, plugins dir is just forwarded/copied to a new object so domains can be hijacked in script but functionality is kept. :o
I just want it to be tiny to show that it's possible. If you want certain level of safety, consider protections like using __getattr__ method to get attribute from "core".
_Al_
12th October 2019, 22:21
It must be me but I fail to see any benefit in overriding Vapoursynth core functions, I only see disadvantages.
you could branch to the whole lot of stuff, checking for correct cmd , returning error that is easier to understand, launch helper utility , program, gui for cropping and returning those values...
I just want it to be tiny to show that it's possible. If you want certain level of safety, consider protections like using __getattr__ method to get attribute from "core".
so would this be any safer?, I don't know really why. It just creates an attribute if needed:
import vapoursynth as vs
from vapoursynth import core as _vscore
import functools
class _Core:
def __getattr__(self, name):
attr = getattr(_vscore, name)
if isinstance(attr, vs.Plugin):
self.__dict__.update({name : _Plugin(attr)})
return _Plugin(attr)
else:
self.__dict__.update({name : attr})
return attr
class _Plugin:
def __init__(self, namespace):
self.__dict__.update((name, getattr(namespace, name)) for name in dir(namespace)) # func_name : func
def CropAbs_extra(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
print('in wrapper')
c = f(*args, **kwargs)
return c
return wrapper
core = _Core()
core.std.CropAbs = CropAbs_extra(core.std.CropAbs)
clip = core.std.BlankClip(width=640, height=360, format = vs.YUV420P8)
clip = core.std.CropAbs(clip, 360,240, 0,0)
at the moment I try to pass that vs.Plugin attribute to __getatttr__as well so it is _Plugin does not go thru the all namespace dir functions
Cary Knoop
12th October 2019, 22:32
you could branch to the whole lot of stuff, checking for correct cmd , returning error that is easier to understand, launch helper utility , program, gui for cropping and returning those values...
Sure, but the classical way is to use wrappers with your own functions.
Redefining API's to me is like writing a novel while changing the meaning of the words. It's possible, but what would be the point?
Please don't get me wrong, if you feel like doing it you certainly can, and if you want to do it don't let me stop you, but I personally think it is not a good idea. :)
_Al_
12th October 2019, 23:07
It might be a dumb idea, I don't deny it and dealing should be done using outputs only.
Myrsloik
12th October 2019, 23:21
If you really want to change the API that much it's a lot easier to just poke the cython code that generates the module directly. It's basically normal python with a few extensions.
Myrsloik
13th October 2019, 22:38
R48-test2 64bit (https://www.dropbox.com/s/arqbfygyynqvrmx/VapourSynth64-R48-test2.exe?dl=1)
Nothing new as such, just fixes all found regressions. Give it a try again. Speed comparisons with R46 also welcome.
Myrsloik
16th October 2019, 21:33
R48 RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R48-RC1)
Go test it everywhere. Once again all known regressions have been fixed. Mask all the things!
r48:
it's now possible to select which optimized code path is used for internal filters (sekrit-twc)
avx2 optimization in many filters, previously the internal ones were mostly sse2 (sekrit-twc)
expr filter can now better optimize expressions (sekrit-twc)
the 7zip executable is now bundled with vsrepo
the portable version now includes the documentation as well
the portable version now includes all the plugins bundled with the normal installer again
ChaosKing
20th October 2019, 20:13
Now that python 3.8 is final, will R48 support it?
Myrsloik
20th October 2019, 20:18
Now that python 3.8 is final, will R48 support it?
Nope, there's no cython release with proper 3.8 support yet.
Myrsloik
21st October 2019, 17:55
R48-RC2 (https://github.com/vapoursynth/vapoursynth/releases/tag/R48-RC2)
More bugs and minor issues fixed. Should be the final RC unless someone finds a serious bug within a week. Test the new add to PATH option a bit extra.
r48:
it's now possible to select which optimized code path is used for internal filters (sekrit-twc)
avx2 optimization in many filters, previously the internal ones were mostly sse2 (sekrit-twc)
expr filter can now better optimize expressions (sekrit-twc)
the 7zip executable is now bundled with vsrepo
the portable version now includes the documentation as well
the portable version now includes all the plugins bundled with the normal installer again
fixed deadlock when setMessageHandler is called a second time
added an option to add vspipe, avfs and vsrepo to path in the installer
added registry entries for the path to vspipe and vsrepo
imwri is now included in the installer
the overwrite argument in imwri now also disables the requirement for output filesnames to contain a number
fixed corrupt output from imwri when requesting alpha output but the read image doesn't have an alpha channel
ChaosKing
21st October 2019, 18:15
The PATH stuff works for me (vspipe, vsrepo, avfs). Green stripes are fixed too.
l00t
21st October 2019, 18:25
Unfortunately I still have the pink borders, when bbmod (from latest havsfunc) is used. See sample pics:
R47.2:
https://images2.imgbox.com/21/ee/LCxpNQn8_o.png
R48-RC2:
https://images2.imgbox.com/f0/df/Nlp16rcQ_o.png
Relevant part of the VS code:
clip = core.std.SetFieldBased(clip, 0)
clip = core.std.CropRel(clip=clip, left=0, right=0, top=20, bottom=20)
clip = core.fb.FillBorders(clip, left=0, right=0, top=1, bottom=1, mode="fillmargins")
clip = havsfunc.bbmod(clip, cTop = 2, cBottom = 2, cLeft = 0, cRight = 0, thresh = 128, blur = 999)
clip = core.resize.Spline36(clip, width=clip.width-0-0, height=clip.height-1-1, src_left=0, src_top=1, src_width=clip.width-0-0, src_height=clip.height-1-1)
I used the portable version of R47.2 and R48-RC2 (both x64) with VSEditor r19 and Python 3.7.5 (embedded). Video is loaded with dgdecodenv.DGSource, most recent version.
Myrsloik
21st October 2019, 18:35
Unfortunately I still have the pink borders, when bbmod (from latest havsfunc) is used. See sample pics:
R47.2:
https://images2.imgbox.com/21/ee/LCxpNQn8_o.png
R48-RC2:
https://images2.imgbox.com/f0/df/Nlp16rcQ_o.png
Relevant part of the VS code:
clip = core.fb.FillBorders(clip, left=0, right=0, top=1, bottom=1, mode="fillmargins")
clip = havsfunc.bbmod(clip, cTop = 2, cBottom = 2, cLeft = 0, cRight = 0, thresh = 128, blur = 999)
clip = core.resize.Spline36(clip, width=clip.width-0-0, height=clip.height-1-1, src_left=0, src_top=1, src_width=clip.width-0-0, src_height=clip.height-1-1)
I used the portable version of R47.2 and R48-RC2 (both x64) with VSEditor r19 and Python 3.7.5 (embedded). Video is loaded with dgdecodenv.DGSource, most recent version.
Can't reproduce. CPU and input video format+resolution?
l00t
21st October 2019, 18:43
Can't reproduce. CPU and input video format+resolution?
CPU: Intel i7-9750H
Video format: YUV420P8; 25fps; input resolution: 1920x1080; final resolution: 1920x1038
(added 2 more lines, which might be important as well...)
Myrsloik
21st October 2019, 18:47
CPU: Intel i7-9750H
Video format: YUV420P8; 25fps; resolution: 1920x1038
(added 2 more lines, which might be important as well...)
Added how? Ideally I want a way to reproduce it using blankclip as the source and a complete script.
l00t
21st October 2019, 18:52
Added how? Ideally I want a way to reproduce it using blankclip as the source and a complete script.
Sorry for being a bit misleading, these were already in the script, when the pictures were taken... (I just wanted to emphasize, that something is happening in bbmod, the script looks fine without it). Nevermind, here's the complete script:
clip = core.dgdecodenv.DGSource(r'some_hd_video.dgi')
clip = core.resize.Spline36(clip, matrix_in_s="709", transfer_in_s="709", primaries_in_s="709", range_s="limited")
clip = core.std.AssumeFPS(clip, fpsnum=25000, fpsden=1000)
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
clip = core.std.SetFieldBased(clip, 0)
clip = core.std.CropRel(clip=clip, left=0, right=0, top=20, bottom=20)
clip = core.fb.FillBorders(clip, left=0, right=0, top=1, bottom=1, mode="fillmargins")
clip = havsfunc.bbmod(clip, cTop = 2, cBottom = 2, cLeft = 0, cRight = 0, thresh = 128, blur = 999)
clip = core.resize.Spline36(clip, width=clip.width-0-0, height=clip.height-1-1, src_left=0, src_top=1, src_width=clip.width-0-0, src_height=clip.height-1-1)
clip = core.remap.ReplaceFramesSimple(baseclip=clip, sourceclip=core.f3kdb.Deband(clip, range=20, grainy=32, grainc=24, sample_mode=2, dither_algo=3, keep_tv_range=1, blur_first=1, dynamic_grain=0), mappings="[0 1070]")
clip.set_output()
Myrsloik
22nd October 2019, 16:49
R48-RC3 (https://github.com/vapoursynth/vapoursynth/releases/tag/R48-RC3)
Fixes the aformentioned pink line at top and bottom (general expr bug) and another 32bit bug in expr as well. Keep testing it.
l00t
22nd October 2019, 18:12
Wow, so fast, thank you very much! The pinkies are now gone, hooray :)
Jukus
22nd October 2019, 20:05
Is there any way to use spline144 with Vapour?
Is it true that this is the best resizer for any situation?
poisondeathray
22nd October 2019, 21:35
Is there any way to use spline144 with Vapour?
With fmtconv kernel="spline", taps=6
"spline"
Generic splines, number of sample points is twice the taps parameter, so you can use taps = 6 to get a Spline144Resize equivalent.
Is it true that this is the best resizer for any situation?
Probably not. Likely some ringing artifacts, oversharpen halos
Myrsloik
22nd October 2019, 21:50
R48-RC3 (https://github.com/vapoursynth/vapoursynth/releases/tag/R48-RC3)
Fixes the aformentioned pink line at top and bottom (general expr bug) and another 32bit bug in expr as well. Keep testing it.
Keep testing it! So far the only discovered bug in RC3 is in Convolution with float input, everything else should work fine. I'll probably do daily builds from now on until every single regression is gone.
poisondeathray
22nd October 2019, 22:02
If you have RGBS and use Expr to add 1 to channel R , is it suppose to round the value ? Or is this the same thing as the Convolution with float input issue ?
clip2 = core.std.Expr(clip, ["x 1 +", "", ""])
e.g. in vsedit, the color picker shows R=0.921468 for clip, R=1.92147 for clip2
I would have expected 1.921468 (G, B remain unchanged at 0.921468)
core.std.SetMaxCPU("none") does not affect the result, R48-RC3 x64
Myrsloik
22nd October 2019, 22:26
If you have RGBS and use Expr to add 1 to channel R , is it suppose to round the value ? Or is this the same thing as the Convolution with float input issue ?
clip2 = core.std.Expr(clip, ["x 1 +", "", ""])
e.g. in vsedit, the color picker shows R=0.921468 for clip, R=1.92147 for clip2
I would have expected 1.921468 (G, B remain unchanged at 0.921468)
core.std.SetMaxCPU("none") does not affect the result, R48-RC3 x64
That's how floating point math works. It's not exact.
StainlessS
22nd October 2019, 22:42
From VS2008 Float.h
#define FLT_DIG 6 /* # of decimal digits of precision */
#define FLT_EPSILON 1.192092896e-07F /* smallest such that 1.0+FLT_EPSILON != 1.0 */
#define FLT_GUARD 0
#define FLT_MANT_DIG 24 /* # of bits in mantissa */
#define FLT_MAX 3.402823466e+38F /* max value */
#define FLT_MAX_10_EXP 38 /* max decimal exponent */
#define FLT_MAX_EXP 128 /* max binary exponent */
#define FLT_MIN 1.175494351e-38F /* min positive value */
#define FLT_MIN_10_EXP (-37) /* min decimal exponent */
#define FLT_MIN_EXP (-125) /* min binary exponent */
#define FLT_NORMALIZE 0
#define FLT_RADIX 2 /* exponent radix */
#define FLT_ROUNDS 1 /* addition rounding: near */
poisondeathray
22nd October 2019, 22:50
Thanks Myrsloik, StainlessS ; If it's using FLT_DIG 6 , shouldn't it round to 1.921468 ? Or does it count decimal digits differently ? Or was this covered in grade school math that I might have slept through? :D
StainlessS
22nd October 2019, 22:52
Its really the binary digits that count, and 10 is not a power of 2, so it works (rounds) a bit weird.
EDIT: If it were viewed in binary, it would make sense.
poisondeathray
22nd October 2019, 22:53
Its really the binary digits that count, and 10 is not a power of 2, so it works (rounds) a bit weird.
Thanks
StainlessS
22nd October 2019, 23:22
PDR, a bit more.
There are a fractional number of binary digits per decimal digit, and although float only precise to 6 [EDIT: significant] digits, there will likely be one or more decimal digits which are not quite correct.
EDIT: Note, below 6 significant digits
0.921468
^^^^^^
1.921468 # Adding 1.0, last digit is not within first 6 significant digits : Note that the extra digit is printed because of the default print format, rather than it being within first 6 significant digits.
^ ^^^^^
a = 0.921468 # This was probably not exact to begin with
b = a + 1.0
DIGS=32 # Digits to the right of decimal point
BlankClip
RT_DebugF("a=%.*f\nb=%.*f",DIGS,a,DIGS,b)
RT_subtitle("a=%.*f\nb=%.*f",DIGS,a,DIGS,b)
return last
00000057 0.29118466 [1068] RT_DebugF: a=0.92146801948547363000000000000000
00000058 0.29125640 [1068] RT_DebugF: b=1.92146801948547360000000000000000
EDIT:
RT_subtitle("a=%.*f\nb=%.*f",DIGS,a,DIGS,b)
Equiv
RT_subtitle("a=%.32f\nb=%.32f",a,b)
EDIT: No reply necessary.
EDIT:
There are a fractional number of binary digits per decimal digit
Function Log2(float n) {
return Log(n) / Log(2.0)
}
blankclip
DIGS=32 # Digits to the right of decimal point
BitsPerDecDigit = Log2(10.0)
Test10=Pow(2.0,BitsPerDecDigit)
RT_debugF ("BitsPerDecDigit=%.*f\nTest10 =%.*f",DIGS,BitsPerDecDigit,DIGS,Test10)
RT_Subtitle("BitsPerDecDigit=%.*f\nTest10 =%.*f",DIGS,BitsPerDecDigit,DIGS,Test10)
return last
00000231 0.29308608 [4064] RT_DebugF: BitsPerDecDigit=3.32192802429199220000000000000000
00000232 0.29313752 [4064] RT_DebugF: Test10 =9.99999904632568360000000000000000
ifb
23rd October 2019, 01:35
Speed comparisons with R46 also welcome.
Threadripper 1920X w/64GB ECC and Windows 10 x64
Local build of VS with the latest AVX2 fix (ac74e9b)
Three runs on a script that's all float and 16-bit (CinemaDNG sequence):
time vspipe -e 1000 script.vpy .
1 2 3 avg stddev relative
R48-RC3+1 avx2 432.83 434.95 435.22 434.33 1.309 1.0080x
sse2 431.05 433.80 436.28 433.71 2.616 1.0095x
none 467.84 465.92 463.87 465.88 1.985 0.9398x
R46 sse2 434.29 440.49 438.68 437.82 3.188 1.0000x
~1% faster vs R46 even though AVX2 doesn't help poor Zen1. :p
Myrsloik
23rd October 2019, 09:48
Threadripper 1920X w/64GB ECC and Windows 10 x64
Local build of VS with the latest AVX2 fix (ac74e9b)
Three runs on a script that's all float and 16-bit (CinemaDNG sequence):
time vspipe -e 1000 script.vpy .
1 2 3 avg stddev relative
R48-RC3+1 avx2 432.83 434.95 435.22 434.33 1.309 1.0080x
sse2 431.05 433.80 436.28 433.71 2.616 1.0095x
none 467.84 465.92 463.87 465.88 1.985 0.9398x
R46 sse2 434.29 440.49 438.68 437.82 3.188 1.0000x
~1% faster vs R46 even though AVX2 doesn't help poor Zen1. :p
You've most likely hit the ram bandwidth limit. Run it with a single/few threads and the difference should be obvious.
Myrsloik
23rd October 2019, 13:41
R48-RC4 (https://github.com/vapoursynth/vapoursynth/releases/tag/R48-RC4)
Fixes the floating point edge handling of RC3.
Test harder!
Myrsloik
23rd October 2019, 14:26
It seems that the PATH is always added even though I have unchecked the option.
Congratulations! You've won a free RC5 build which you can redeem tomorrow! That was a really stupid typo. At least there are no known image corruption problems. (test the unprivileged installs too just to be sure)
Myrsloik
24th October 2019, 10:24
R48-RC5 (https://github.com/vapoursynth/vapoursynth/releases/tag/R48-RC5)
The only change from RC4 is that the installer now correctly respects the add to PATH options.
l00t
24th October 2019, 14:31
I've found another bug. When I try to use nyuszika7h's FFInfo the result is a pile of garbage with R48-RC4, while it was perfectly fine with R47.2. The picture is also okay without the script.
nyuszika7h's FFInfo script:
https://gist.github.com/nyuszika7h/340cd5bd529a70746f0b35a464ef9a91
with FFInfo:
https://thumbs2.imgbox.com/c5/75/lfIpTn7P_t.png (http://imgbox.com/lfIpTn7P)
without FFInfo:
https://thumbs2.imgbox.com/81/7d/ctRXj1Pu_t.png (http://imgbox.com/ctRXj1Pu)
import vapoursynth as vs
from vapoursynth import core
clip = core.ffms2.Source(source=r'some_hd_footage.mkv')
clip = vs_ffinfo.FFInfo(clip, text='some text', frame_num=True, frame_type=True, frame_time=True)
clip.set_output()
FFMS2 is the latest version from 10/07/2019 from StvG
Video parameters:
Resolution: 1920x1038
Format: YUV420P8
FPS: 24000/1001
Thanks in advance
ChaosKing
24th October 2019, 15:37
The problem is in: clip.sub.Subtitle("this is art")
Myrsloik
24th October 2019, 20:05
R48-RC6 (https://github.com/vapoursynth/vapoursynth/releases/tag/R48-RC6)
Fixes premultiplied maskedmerge and a few expr problems that most likely were never encountered by anyone.
l00t
24th October 2019, 21:29
Thanks, now it's perfect.
BTW: If someone's interested in FFInfo, I've pumped up a bit nyuszika's version: https://gist.github.com/l00tzOMG/404e81cdcae2e7415dd96b57b08f32ce
_Al_
24th October 2019, 23:55
I've pumped up a bit nyuszika's version: https://gist.github.com/l00tzOMG/404...d96b57b08f32ce
To get string equivalents for those numerical frame property values, you can use dictionaries/ tables and then just get value you need.
With if , elif approach you can end up having hundreds of them is database is large. Look in that example:
https://forum.doom9.org/showthread.php?p=1885759#post1885759
ifb
25th October 2019, 00:41
You've most likely hit the ram bandwidth limit. Run it with a single/few threads and the difference should be obvious.
core.num_threads = 1
R48 RC4 avx2 5975.40 1.0062
sse2 5938.56 1.0125
R46 sse2 6012.63 1.0000
I only did 1 run each, but still ~1% faster.
_Al_
25th October 2019, 00:41
@l00t
MATRIX = {
0:'rgb',
1:'709',
.
.
.
}
PRIMARIES = { .....}
TRANSFER = {....}
try:
lines.append(f'Matrix: {MATRIX[f.props["_Matrix"]]}')
except Exception as e:
lines.append(f'Matrix: {str(e)}')
try:
lines.append(f'Primaries: {PRIMARIES[f.props["_Primaries"]]}')
except Exception as e:
lines.append(f'Primaries: {str(e)}')
l00t
25th October 2019, 08:13
Thanks for the idea, modified the script accordingly :)
...
MonoS
27th October 2019, 20:08
Since version R46 i get the error "Failed to initialize VapourSynth environment" even execuiting a simple vspipe -v
I've tried R46, R47 and R48-RC6, all giving me the same error, this on two different machine, one Win 10 the other Win Server 2019 even after reboot
Installing R45 it works without problem.
What could be the issue? what can i do to help you diagnose the problem?
Myrsloik
27th October 2019, 20:54
Since version R46 i get the error "Failed to initialize VapourSynth environment" even execuiting a simple vspipe -v
I've tried R46, R47 and R48-RC6, all giving me the same error, this on two different machine, one Win 10 the other Win Server 2019 even after reboot
Installing R45 it works without problem.
What could be the issue? what can i do to help you diagnose the problem?
Which install type? Did you really install the vs2019 runtimes? You can simply run vspipe in a debugger if you still can't figure it out since I've even included pdbs for the main dlls.
MonoS
28th October 2019, 09:02
Which install type? Did you really install the vs2019 runtimes? You can simply run vspipe in a debugger if you still can't figure it out since I've even included pdbs for the main dlls.
64bit non portable version, installed vs2019 runtimes the first time, then in subsequent install skipped that.
For setting up the debugger what should i do? Download the source and put a breakpoint inside real_init (https://github.com/vapoursynth/vapoursynth/blob/7c488b5d33991115e148da60b7afe30040da9245/src/vsscript/vsscript.cpp#L46) and see what fail?
Myrsloik
28th October 2019, 11:13
64bit non portable version, installed vs2019 runtimes the first time, then in subsequent install skipped that.
For setting up the debugger what should i do? Download the source and put a breakpoint inside real_init (https://github.com/vapoursynth/vapoursynth/blob/7c488b5d33991115e148da60b7afe30040da9245/src/vsscript/vsscript.cpp#L46) and see what fail?
Yes, that should work and give you the best information.
MonoS
28th October 2019, 16:52
Yes, that should work and give you the best information.
Ok, i'll try to take a look, but it will probably take me about a week as i'm currently doing an encode.
Myrsloik
28th October 2019, 23:12
R48-RC6 (https://github.com/vapoursynth/vapoursynth/releases/tag/R48-RC6)
Fixes premultiplied maskedmerge and a few expr problems that most likely were never encountered by anyone.
4 days without any bugs found! Final release when bug free for a whole week. Keep testing!
Patman
29th October 2019, 19:22
Hi,
R48 final based on python 3.7.x module? Which version of Vapoursynth will be based on python 3.8?
Gesendet von meinem HMA-L09 mit Tapatalk
Myrsloik
29th October 2019, 19:38
Hi,
R48 final based on python 3.7.x module? Which version of Vapoursynth will be based on python 3.8?
Gesendet von meinem HMA-L09 mit Tapatalk
Yes, it will use python 3.7.x. I'll switch to 3.8.x when cython adds official support for it.
Patman
29th October 2019, 19:41
Yes, it will use python 3.7.x. I'll switch to 3.8.x when cython adds official support for it.Thanks for the info.
Gesendet von meinem HMA-L09 mit Tapatalk
Myrsloik
31st October 2019, 23:07
R48 is released!
stax76
3rd November 2019, 15:52
Is there a particular reason why vsrepo downloaded files don't have original timestamps?
staxrip has packages with lost timestamps and I would like to recover them.
Myrsloik
3rd November 2019, 17:43
Is there a particular reason why vsrepo downloaded files don't have original timestamps?
staxrip has packages with lost timestamps and I would like to recover them.
Because the way I'm handling things it's kinda annoying to set them. And it's not like you can ever trust them anyway...
hydra3333
9th November 2019, 08:25
Yes, it will use python 3.7.x. I'll switch to 3.8.x when cython adds official support for it.
just checking,
does that mean the v48 portable version
will run under portable python 3.7.5 ?
but not 3.8.0 ?
l00t
9th November 2019, 09:09
just checking,
does that mean the v48 portable version
will run under portable python 3.7.5 ?
but not 3.8.0 ?
exactly
Jukus
20th November 2019, 15:58
What needs to be done to make a video have different FPS?
For example, I want to do something like that
from vapoursynth import core
import havsfunc as haf
clip = core.d2v.Source('index.d2v')
clip1 = core.std.Trim(clip, 0, 5579)
clip1 = haf.QTGMC(clip1, Preset='Very Slow', Sharpness=0.5, FPSDivisor=1, SourceMatch=3, Lossless=2, MatchEnhance=0.75, TFF=True)
clip2 = core.std.Trim(clip, 5580, 24186)
clip2 = haf.QTGMC(clip2, Preset='Very Slow', Sharpness=0.5, SourceMatch=3, MatchEnhance=0.75, InputType=1)
clip = clip1+clip2
clip.set_output()
but this code will not work correctly.
poisondeathray
20th November 2019, 17:12
What needs to be done to make a video have different FPS?
For example, I want to do something like that
from vapoursynth import core
import havsfunc as haf
clip = core.d2v.Source('index.d2v')
clip1 = core.std.Trim(clip, 0, 5579)
clip1 = haf.QTGMC(clip1, Preset='Very Slow', Sharpness=0.5, FPSDivisor=1, SourceMatch=3, Lossless=2, MatchEnhance=0.75, TFF=True)
clip2 = core.std.Trim(clip, 5580, 24186)
clip2 = haf.QTGMC(clip2, Preset='Very Slow', Sharpness=0.5, SourceMatch=3, MatchEnhance=0.75, InputType=1)
clip = clip1+clip2
clip.set_output()
but this code will not work correctly.
Internally in vapoursynth, it has to be CFR (constant frame rate)
1) You can duplicate frames and framerate in the second section (but same content speed). eg. by using core.std.Interleave
Or ,
2) you can temporarily assign a 2xFPS to the 2nd section using core.std.AssumeFPS to append sections (so it plays double speed), then use external timecodes (timestamps) method to make it VFR
DJATOM
20th November 2019, 18:57
Internally in vapoursynth, it has to be CFR (constant frame rate)
No. You can splice mixed fps clips, or even mixed resolution clips, vapoursynth can handle that. But encoding app might fail to understand such clip, that depends on what you're using.
I made x264 input filter and successfully provided vapoursynth timecodes (but code is a bit dirty), you can pick it here and compile: https://pastebin.com/QhjQ26qG
_Al_
22nd November 2019, 03:30
http://www.vapoursynth.com/doc/installation.html#installation-via-pip-pypi says that pip install should be done only after Vapoursynth is installed. So what is it for, or what is the purpose of that PIP installation?
MonoS
23rd November 2019, 13:49
Yes, that should work and give you the best information.
I've reinstalled my whole system so i am now on a clean OS.
Installed Python 3.7.5 for all user (so it is in "C:\Program Files\Python37" ), installed Vapoursynth R48 and it gives me the same error.
I've then started debuging and the line that is failing is the PyImport_ImportModule in vapoursynth_api.h (https://github.com/vapoursynth/vapoursynth/blob/7c488b5d33991115e148da60b7afe30040da9245/include/cython/vapoursynth_api.h#L113), the module returned is NULL.
Folder "Lib\site-packages", where i would put my script, is empty, would expect to find file "vapoursynth.pth" and the folder "vapoursynth" (checked in another system with R45), probably is that that is making VSPipe fails?
stax76
23rd November 2019, 21:13
Because the way I'm handling things it's kinda annoying to set them. And it's not like you can ever trust them anyway...
If both timestamps and module version info is missing (it's missing very often in my experience), what else do we have? The file size will be the only thing left and that isn't very much.
ChaosKing
23rd November 2019, 23:05
We have the hash...
https://github.com/vapoursynth/vsrepo/blob/master/local/fft3dfilter.json
MonoS
26th November 2019, 21:23
I've reinstalled my whole system so i am now on a clean OS.
Installed Python 3.7.5 for all user (so it is in "C:\Program Files\Python37" ), installed Vapoursynth R48 and it gives me the same error.
I've then started debuging and the line that is failing is the PyImport_ImportModule in vapoursynth_api.h (https://github.com/vapoursynth/vapoursynth/blob/7c488b5d33991115e148da60b7afe30040da9245/include/cython/vapoursynth_api.h#L113), the module returned is NULL.
Folder "Lib\site-packages", where i would put my script, is empty, would expect to find file "vapoursynth.pth" and the folder "vapoursynth" (checked in another system with R45), probably is that that is making VSPipe fails?
I think i fixed the issue downloading the portable version of Vapoursynth and putting the file vapoursynth.cp37-win_amd64.pyd inside the site-packages folder under Python37. Hope this could help you fix the problem.
Lypheo
27th November 2019, 16:28
core.resize.Bicubic(core.std.BlankClip(format=vs.YUV444PS), format=vs.RGB24, matrix_in=1, primaries_in=1, primaries=1) #errors out (Resize error 3074: invalid colorspace definition (1/2/1 => 0/2/1). May need to specify additional colorspace parameters.)
core.resize.Bicubic(core.std.BlankClip(format=vs.YUV444PS), format=vs.RGB24, matrix_in=1, primaries_in=1, primaries=1, transfer_in=1, transfer=1) #works
core.resize.Bicubic(core.std.BlankClip(format=vs.YUV444PS), format=vs.RGB24, matrix_in=1) #works
Seems like a bug to me. vsresize/zimg seems to think it needs to do a primary conversion when in and out primaries are specified (even when equal), and thus demands that the transfer function be specified. This causes the error mentioned above when previewing clips with vsedit (which calls vsresize internally, I presume) that ffms2 attached _Primaries != 2 and _Transfer = 2 to (this is the case for files which have a primaries flag but no transfer flag).
Richard1485
29th November 2019, 21:25
http://www.vapoursynth.com/doc/installation.html#installation-via-pip-pypi says that pip install should be done only after Vapoursynth is installed. So what is it for, or what is the purpose of that PIP installation?
I was wondering the same thing.
Myrsloik
29th November 2019, 22:09
I was wondering the same thing.
It's useful if you want to install vapoursynth into multiple python environments. The normal installer only lets you choose one.
Myrsloik
4th December 2019, 15:46
core.resize.Bicubic(core.std.BlankClip(format=vs.YUV444PS), format=vs.RGB24, matrix_in=1, primaries_in=1, primaries=1) #errors out (Resize error 3074: invalid colorspace definition (1/2/1 => 0/2/1). May need to specify additional colorspace parameters.)
core.resize.Bicubic(core.std.BlankClip(format=vs.YUV444PS), format=vs.RGB24, matrix_in=1, primaries_in=1, primaries=1, transfer_in=1, transfer=1) #works
core.resize.Bicubic(core.std.BlankClip(format=vs.YUV444PS), format=vs.RGB24, matrix_in=1) #works
Seems like a bug to me. vsresize/zimg seems to think it needs to do a primary conversion when in and out primaries are specified (even when equal), and thus demands that the transfer function be specified. This causes the error mentioned above when previewing clips with vsedit (which calls vsresize internally, I presume) that ffms2 attached _Primaries != 2 and _Transfer = 2 to (this is the case for files which have a primaries flag but no transfer flag).
You always need to specify both primaries and transfer. You can't do just one. It's how it works.
Lypheo
5th December 2019, 10:58
You always need to specify both primaries and transfer. You can't do just one. It's how it works.
Yes, I know, but this is about cases where the output primaries are equal to the input primaries (so no conversion is performed). Requiring the transfer parameters to be specified as well in that situation doesn’t make a lot of sense because they’re not needed at all.
Again, this isn’t just a hypothetical case of passing these particular arguments to resize manually: When you have a YCbCR clip that has _Primaries other than 2 but _Transfer == 2 (=undefined) and try to convert to RGB (or to preview with VSEdit), vsresize will throw this error: Resize error 3074: invalid colorspace definition (1/2/1 => 0/2/1). May need to specify additional colorspace parameters.
This behaviour is likely very confusing to the unsuspecting user (as it was to me), because in theory, matrix is all the colorspace parameters that should be needed for a YUV->RGB conversion.
groucho86
18th December 2019, 21:02
invalid colorspace definition (1/2/1 => 0/2/1)
What is the order of these numbers? Transfer / Matrix / Primaries ?
I'm getting the error as well, even though I'm not explicitly using the resize function:
File "script.py", line 329, in write_img
print(clip.get_frame(0).props)
File "src/cython/vapoursynth.pyx", line 1244, in vapoursynth.VideoNode.get_frame
vapoursynth.Error: Resize error: Resize error 3074: invalid colorspace definition (1/2/1 => 0/2/1). May need to specify additional colorspace parameters.
Pat357
23rd December 2019, 01:10
Are you converting YUV -> RGB somewhere ? Like writing frames from a YUV-clip to RGB-images using "write_img" ?
You're not running vspipe or any other piping and do not use clip.set_output, are you ?
Just plain python.. ? correct ?
I guess it's Matrix /Transfer / Primaries.
I guess VS is complaining because you're going from matrix=1 (=709) to matrix=0 (=RGB) with undef for Transfer, but 1 for primaries.
It would have been no problem if the primaries were also undef (2), but now you 've to specify the other colorspace info as wel.
Please correct me if I'm wrong with this.
groucho86
23rd December 2019, 15:28
Are you converting YUV -> RGB somewhere ? Like writing frames from a YUV-clip to RGB-images using "write_img" ?
You're not running vspipe or any other piping and do not use clip.set_output, are you ?
Just plain python.. ? correct ?
I guess it's Matrix /Transfer / Primaries.
I guess VS is complaining because you're going from matrix=1 (=709) to matrix=0 (=RGB) with undef for Transfer, but 1 for primaries.
It would have been no problem if the primaries were also undef (2), but now you 've to specify the other colorspace info as wel.
Please correct me if I'm wrong with this.
Hi Pat357, you're correct - pure python, no vspipe. Going from YUV to RGB, but also potentially staying in YUV. Here's an H.264 sample rendered out of Resolve (.mov ProRes and DNxHD react the same way):
https://www.mediafire.com/file/gzacc9ges2yk0cm/bars_h264.mov/file
Reproduced the issue in vsedit. This fails:
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source(source='bars_h264.mov')
clip = core.text.FrameProps(clip)
clip.set_output()
My workaround for now:
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source(source='bars_h264.mov')
clip = core.text.FrameProps(clip)
if clip.get_frame(0).props['_Transfer'] == 2:
clip = core.std.SetFrameProp(clip, prop="_Transfer", intval=1)
clip.set_output()
Same behavior with LibavSMASHSource. Is there a more elegant way of dealing with it?
Lypheo
23rd December 2019, 15:53
Seems like this is the exact issue I talked about a earlier (or rather a consequence of it), namely zimg requiring the transfer func to be specified too when the primaries are given (even implicitly as frame properties) despite it not being needed at all for the conversion.
yoon
23rd December 2019, 18:06
Hi,
I want to crop a video into four parts and separate each part into its own video. It would be like:
clip.mkv -> Crop Top Left -> clip1.mkv
clip.mkv -> Crop Top Right -> clip2.mkv
clip.mkv -> Crop Bottom Left -> clip3.mkv
...
So far, the cropping seems to be fine, but I don't know how to cut the frames and output multiple files, instead of one.
This is my script:
import vapoursynth as vs
core = vs.get_core()
clip = core.lsmas.LWLibavSource(source=r'clip.mkv')
clip = core.std.Trim(clip, 0, 59)
clip = core.fmtc.resample(clip, w=600, h=338, css="444", kernel="spline36")
clip = core.fmtc.bitdepth(clip, bits=8)
h = clip.height
h_n = h // 2
clip1 = core.std.CropAbs(clip, x=0, y=0, width=299, height=h_n-0.5) #Top Left
clip2 = core.std.CropAbs(clip, x=300, y=0, width=299, height=h_n-0.5) #Top Right
clip3 = core.std.CropAbs(clip, x=0, y=h_n+0.5, width=299, height=h_n-0.5) #Bottom Left
clip4 = core.std.CropAbs(clip, x=300, y=h_n+0.5, width=299, height=h_n-0.5) #Bottom Right
clip = clip1 + clip2 + clip3 + clip4
clip.set_output()
Is there a simple way to do this?
Pat357
23rd December 2019, 18:52
https://www.mediafire.com/file/gzacc9ges2yk0cm/bars_h264.mov/file
Reproduced the issue in vsedit. This fails:
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source(source='bars_h264.mov')
clip = core.text.FrameProps(clip)
clip.set_output()
Same behavior with LibavSMASHSource. Is there a more elegant way of dealing with it?
Yes, maybe you shouldn't use VSEdit to view the VPY files. ;-) For viewing with VSEdit, a conversion from YUV to RGB is needed.
Without your workaround, you can still open the .VPY file in anything that understands YUV : VirtualDub, or any mediaplayer like MPC-HC, MPV, FFplay, ...
Also encoding works without the work-around as all encoders understand YUV.
poisondeathray
24th December 2019, 20:06
Here's an H.264 sample rendered out of Resolve (.mov ProRes and DNxHD react the same way
Another approach would be to tag all 3 matrix/transfer/primaries .
Note that was a change in Resolve 16.x behavior from previous . Older versions tagged all 3 by default. There is some discussion about this on the Resolve forum, and you can see it tags differently depending on the timeline settings
https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=101253
Or you can also do it afterwards , for AVC, HEVC, or Prores with ffmpeg bitstream filters without re-encoding . But there isn't one for DNxHD/DNxHR
https://ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmetadata
https://ffmpeg.org/ffmpeg-bitstream-filters.html#hevc_005fmetadata
https://ffmpeg.org/ffmpeg-bitstream-filters.html#prores_005fmetadata
groucho86
24th December 2019, 21:11
Another approach would be to tag all 3 matrix/transfer/primaries .
Note that was a change in Resolve 16.x behavior from previous . Older versions tagged all 3 by default.
Aha, that explains it! I'm now on Resolve 16.1.2 and was on 15.3.1 for quite a while. Thanks for the explanation!
I've occasionally used BBC's tool as well:
https://github.com/bbc/qtff-parameter-editor
Selur
26th December 2019, 07:34
Can someone with MSVC 2017 or 2019 compile a static version of https://github.com/sekrit-twc/EdgeFixer which does not rely on tons of dlls like the currently linked version in the release section?
-> Problem solved: seems like something with my Windows installation was 'off'
_Al_
26th December 2019, 19:26
Is there a simple way to do this?
Not sure if I understand, do you want to encode each cropped clip separately?
You can use vspipe --outputindex to specify what output to process
import vapoursynth as vs
from vapoursynth import core
clip = core.lsmas.LWLibavSource(source=r'clip.mkv')
clip = core.std.Trim(clip, 0, 59)
clip = core.resize.Bicubic(clip, 600,340)
new_resolution = (clip.width/2, clip.height/2)
clip1 = core.std.CropAbs(clip, *new_resolution, top=0, left=0, ) #Top Left
clip2 = core.std.CropAbs(clip, *new_resolution, top=0, left=clip.width/2) #Top Right
clip3 = core.std.CropAbs(clip, *new_resolution, top=clip.height/2, left=0) #Bottom Left
clip4 = core.std.CropAbs(clip, *new_resolution, top=clip.height/2, left=clip.width/2) #Bottom Right
clip1.set_output(1)
clip2.set_output(2)
clip3.set_output(3)
clip4.set_output(4)
clip = clip1 + clip2 + clip3 + clip4
clip.set_output() #if not stated , default is zero: clip.set_output(0)
and when using command line:
vspipe --y4m your_script.vpy - | ffmpeg -f yuv4mpegpipe .. ....default is output zero
vspipe --outputindex 1 --y4m your_script.vpy - | ffmpeg -f yuv4mpegpipe ....... for clip1
vspipe --outputindex 2 --y4m your_script.vpy - | ffmpeg -f yuv4mpegpipe ....... etc for each output
odd video dimensions cannot be used here, it has to be at least even, (mod 2). In Vapoursynth it depends on video subsampling.
stax76
27th December 2019, 16:25
I wish Visual Studio project files were included in the source, so I can use 'Go to document' and 'Go to definition' in order to understand the code. Right now I'm looking at vsvfw.cpp and want to know which header declares IUnknown. Maybe I have to try creating a project file.
Myrsloik
27th December 2019, 16:33
I wish Visual Studio project files were included in the source, so I can use 'Go to document' and 'Go to definition' in order to understand the code. Right now I'm looking at vsvfw.cpp and want to know which header declares IUnknown. Maybe I have to try creating a project file.
They are included: msvc_project/vapoursynth.sln
IUnknown is obviously from a system COM header.
stax76
27th December 2019, 16:41
Sorry, I overlooked it. I'm not very good in C++ right now, first C++ project after over ten years. :)
Myrsloik
28th December 2019, 21:49
Audio support is almost done:cool:
yoon
28th December 2019, 22:10
Not sure if I understand, do you want to encode each cropped clip separately?
You can use vspipe --outputindex to specify what output to process
import vapoursynth as vs
from vapoursynth import core
clip = core.lsmas.LWLibavSource(source=r'clip.mkv')
clip = core.std.Trim(clip, 0, 59)
clip = core.resize.Bicubic(clip, 600,340)
new_resolution = (clip.width/2, clip.height/2)
clip1 = core.std.CropAbs(clip, *new_resolution, top=0, left=0, ) #Top Left
clip2 = core.std.CropAbs(clip, *new_resolution, top=0, left=clip.width/2) #Top Right
clip3 = core.std.CropAbs(clip, *new_resolution, top=clip.height/2, left=0) #Bottom Left
clip4 = core.std.CropAbs(clip, *new_resolution, top=clip.height/2, left=clip.width/2) #Bottom Right
clip1.set_output(1)
clip2.set_output(2)
clip3.set_output(3)
clip4.set_output(4)
clip = clip1 + clip2 + clip3 + clip4
clip.set_output() #if not stated , default is zero: clip.set_output(0)
and when using command line:
vspipe --y4m your_script.vpy - | ffmpeg -f yuv4mpegpipe .. ....default is output zero
vspipe --outputindex 1 --y4m your_script.vpy - | ffmpeg -f yuv4mpegpipe ....... for clip1
vspipe --outputindex 2 --y4m your_script.vpy - | ffmpeg -f yuv4mpegpipe ....... etc for each output
odd video dimensions cannot be used here, it has to be at least even, (mod 2). In Vapoursynth it depends on video subsampling.
Thank you for your answer, I didn't know that outputindex option existed. That's great. Will try it this way.
jmartinr
29th December 2019, 10:57
:thanks:
Selur
29th December 2019, 13:10
Audio support is almost done
Nice, hoping to view the wave front of an input file to find the audio delay of some files. :)
Thanks!
Cu Selur
Myrsloik
29th December 2019, 13:53
Nice, hoping to view the wave front of an input file to find the audio delay of some files. :)
Thanks!
Cu Selur
Only trim, splice and raw pcm output from vspipe is planned for the first test version. There's however one little problem...
All existing audio sources suck so I'll probably have to improve FFMS2 first.
Feel free to start implementing audio plugins using the doodle1 branch. The API is conceptually stable (but tweaks will definitely be made).
Jukus
29th December 2019, 14:37
@Myrsloik
What about variable fps?
Myrsloik
29th December 2019, 15:04
@Myrsloik
What about variable fps?
What about you asking a complete question?
Jukus
30th December 2019, 05:19
What about you asking a complete question?
VS does not support variable FPS for output, will it be implemented?
Lypheo
30th December 2019, 08:22
VS does not support variable FPS for output, will it be implemented?
It does, though? Just have vspipe write the timestamp file with --timecodes and mux it in (or pass it to x264 or whatever).
Only trim, splice and raw pcm output from vspipe is planned for the first test version. There's however one little problem...
All existing audio sources suck so I'll probably have to improve FFMS2 first.
Feel free to start implementing audio plugins using the doodle1 branch. The API is conceptually stable (but tweaks will definitely be made).
Can we expect a test build soon or not until you’re done fixing ffms2?
Myrsloik
30th December 2019, 09:50
It does, though? Just have vspipe write the timestamp file with --timecodes and mux it in (or pass it to x264 or whatever).
Can we expect a test build soon or not until you’re done fixing ffms2?
There needs to be at least one decent source filter for audio or there won't be much to test really...
Cary Knoop
1st January 2020, 01:30
I can't figure this out on Windows 10.
1. I installed Python using Anaconda (e:\anaconda3)
2. Installed Vapoursynth (all users) (e:\vapoursynth)
python myscript.vpy works fine!
import vapoursynth as vs
from vapoursynth import core
print(core.version())
clip = core.std.BlankClip(format=vs.RGB24, color=[0, 0, 0])
clip.set_output()
vspipe and vsedit don't work.
vspipe --info myscript.vpy -
Setting PythonPath in registry to "e:\anaconda3" gives:
Failed to initialize VapourSynth environment
Setting PythonPath to "" gives:
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00008fdc (most recent call first):
Registry entries:
Key Name: HKEY_LOCAL_MACHINE\SOFTWARE\VapourSynth
Class Name: <NO CLASS>
Last Write Time: 12/31/2019 - 4:26 PM
Value 0
Name: Version
Type: REG_SZ
Data: 48
Value 1
Name: Path
Type: REG_SZ
Data: e:\vapoursynth
Value 2
Name: CorePlugins
Type: REG_SZ
Data: e:\vapoursynth\core\plugins
Value 3
Name: Plugins
Type: REG_SZ
Data: e:\vapoursynth\plugins
Value 4
Name: VapourSynthDLL
Type: REG_SZ
Data: e:\vapoursynth\core\vapoursynth.dll
Value 5
Name: VSScriptDLL
Type: REG_SZ
Data: e:\vapoursynth\core\vsscript.dll
Value 6
Name: VSPipeEXE
Type: REG_SZ
Data: e:\vapoursynth\core\vspipe.exe
Value 7
Name: VSRepoPY
Type: REG_SZ
Data: e:\vapoursynth\vsrepo\vsrepo.py
Value 8
Name: PythonPath
Type: REG_SZ
Data: e:\anaconda3
Created a batch file clearing all environment variables except for path, systemdrive and systemroot.
No change, same problem.
feisty2
5th January 2020, 19:54
I wrote some syntactic sugar stuff for the C++ API here: https://github.com/IFeelBloated/vaporsynth-syntactic-sugar/blob/master/sugar.hpp
C++2a support is required (I'm 100% sure C++17 aint cuttin' it), it compiles with "-std=c++2a" for GCC10
you can use
auto MakePlane(auto Pointer, auto Width, auto Height, auto PaddingPolicy)
to access the plane in a 2-dimensional style, out-of-bound access (automatic padding) is allowed for the source plane, but not allowed for the destination plane.
I'll give you a concrete example, to write a 3x3 box blur, you would do the following:
auto srcp = reinterpret_cast<const float *>(srcp8);
auto dstp = reinterpret_cast<float *>(dstp8);
auto padded_src = reinterpret_cast<float *>(malloc((width+2) * (height+2) * sizeof(float)));
for (auto y : Range{ height })
std::memcpy(padded_src + (y+1) * (width+2) + 1, srcp + y * width, width * sizeof(float));
// lots of code here to deal with padding for "padded_src"
auto gc_addr = padded_src;
padded_src += (width + 2) + 1;
for (auto y : Range{ height })
for (auto x : Range{ width }) {
auto above = padded_src - (width + 2);
auto below = padded_src + (width + 2);
dstp[x] = (above[x-1] + above[x] + above[x+1] + padded_src[x-1] + padded_src[x] + padded_src[x+1] + below[x-1] + below[x] + below[x+1]) / 9;
dstp += width;
padded_src += width + 2;
}
free(gc_addr);
with "sugar.hpp", that huge pile of nuisance is equivalent to simply
auto srcp = MakePlane<const float>(srcp8, width, height, Repeat);
auto dstp = MakePlane<float>(dstp8, width, height, Zero);
for (auto y : Range{ height })
for (auto x : Range{ width })
dstp[y][x] = (srcp[y-1][x-1] + srcp[y-1][x] + srcp[y-1][x+1] + srcp[y][x-1] + srcp[y][x] + srcp[y][x+1] + srcp[y+1][x-1] + srcp[y+1][x] + srcp[y+1][x+1]) / 9;
// possible out-of-bound access like "srcp[y-1][x-1]" is automatically handled here with the given padding policy, you got nothing to worry about
The header includes 3 pre-defined padding policies
Zero
Repeat (or simply called "pad" on this forum)
Reflect
however, you can also define your own padding policy by completing the following function and pass it to "MakePlane()"
auto PaddingFunction = [](auto Canvas, auto Width, auto Height, auto y, auto x) {
...
};
note that the "PaddingPolicy" argument has no effect on "dstp" as no padding is applied here.
you are welcome to leave a comment if you have any suggestions or ideas to further improve this.
feisty2
5th January 2020, 20:05
simple live demonstration: https://godbolt.org/z/MHebt8
Jukus
8th January 2020, 15:50
How to properly process the video where 3 progressive frames, 2 interlaced and it turns out that every 5 frame is a duplicate?
Boulder
8th January 2020, 18:50
How to properly process the video where 3 progressive frames, 2 interlaced and it turns out that every 5 frame is a duplicate?
Standard IVTC? VFM to match fields followed by VDecimate to drop the dupes.
PlazzTT
11th January 2020, 17:18
I'm getting this error when compiling Vapoursynth on Linux (Mint 19.3)
I installed cython through pip.
"which cython" gives "/home/me/.local/bin/cython"
...
CXXLD libremovegrain.la
CC src/filters/vinverse/libvinverse_la-vinverse.lo
CCLD libvinverse.la
CC src/filters/vivtc/libvivtc_la-vivtc.lo
CCLD libvivtc.la
CYTHON src/cython/vapoursynth.c
/bin/bash: cython: command not found
Makefile:2217: recipe for target 'src/cython/vapoursynth.c' failed
make: *** [src/cython/vapoursynth.c] Error 127
Any ideas how to fix this?
Jukus
11th January 2020, 20:53
By the way, to the page:
http://www.vapoursynth.com/doc/installation.html#linux-installation-from-packages
May be added that there is a ready-made solution for Debian:
https://www.deb-multimedia.org/
And, apparently, remove the link to packages for Ubuntu.
outhud
12th January 2020, 20:50
Where should Vapoursynth plugins (.so) be placed by default on Linux (Ubuntu) so that they are auto-loaded?
Is there a way to print the autoload folder?
I've tried /usr/local/lib/ and /usr/lib/x86_64-linux-gnu/vapoursynth/ but it seems the modules are not being found.
Richard1485
12th January 2020, 20:56
I installed cython through pip.
Did you install it with pip3?
pip3 install cython
Are_
12th January 2020, 21:02
Where should Vapoursynth plugins (.so) be placed by default on Linux (Ubuntu) so that they are auto-loaded?
Is there a way to print the autoload folder?
I've tried /usr/local/lib/ and /usr/lib/x86_64-linux-gnu/vapoursynth/ but it seems the modules are not being found.
http://www.vapoursynth.com/doc/autoloading.html
Most probably in /usr/local/lib/vapoursynth in your case.
Myrsloik
14th January 2020, 14:46
Only trim, splice and raw pcm output from vspipe is planned for the first test version. There's however one little problem...
All existing audio sources suck so I'll probably have to improve FFMS2 first.
Feel free to start implementing audio plugins using the doodle1 branch. The API is conceptually stable (but tweaks will definitely be made).
Audio update:
A a best but slow audio source has been created so that's no longer a major problem (will still get some usefulness improvements over time).
Testing and debugging everything else is however taking longer than expected but audio will be fully supported by AVFS and VFW as well from the start and vspipe will be able to output wave64 headers.
Richard1485
14th January 2020, 17:07
^ Excellent news! Down the line, I hope that it might be possible to have an equivalent to AviSynth's Dissolve(), which affects video and audio.
stax76
18th January 2020, 12:43
I'm not sure what's the focus of this thread because my question is about vs host application development.
There is a weird exception happening here:
case WM_DESTROY:
DiscardGraphicsResources();
SafeRelease(&g_D2D_Factory);
g_vsapi->freeNode(g_vsnode);
vsscript_freeScript(g_vsscript);
vsscript_finalize();
PostQuitMessage(0);
return 0;
Exception thrown at 0x00007FFAFC5B448D (vapoursynth.cp37-win_amd64.pyd) in VapourSynth Direct2D Rendering.exe: 0xC0000005: Access violation writing location 0x0000000000000000.
Weird thing is it crashes only inside WM_DESTROY and not when this code is executed before WM_DESTROY !
How can this issue be debugged?
Myrsloik
18th January 2020, 12:54
I'm not sure what's the focus of this thread because my question is about vs host application development.
There is a weird exception happening here:
case WM_DESTROY:
DiscardGraphicsResources();
SafeRelease(&g_D2D_Factory);
g_vsapi->freeNode(g_vsnode);
vsscript_freeScript(g_vsscript);
vsscript_finalize();
PostQuitMessage(0);
return 0;
Exception thrown at 0x00007FFAFC5B448D (vapoursynth.cp37-win_amd64.pyd) in VapourSynth Direct2D Rendering.exe: 0xC0000005: Access violation writing location 0x0000000000000000.
Weird thing is it crashes only inside WM_DESTROY and not when this code is executed before WM_DESTROY !
How can this issue be debugged?
It's with a trivial script (BlankClip only)?
Are there any restrictions on what you're allowed to do when handling a WM_DESTROY message? If not then I'd simply see what the call stack is in a debugger. Maybe there's a hint in there.
stax76
18th January 2020, 13:06
I don't have debug symbols so on my side call stack don't help.
vapoursynth.cp37-win_amd64.pyd!00007ffb10a9448d()
vapoursynth.cp37-win_amd64.pyd!00007ffb10a97529()
vsscript.dll!00007ffb4d0a25c1()
VapourSynth Direct2D Rendering.exe!WndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 197
at D:\Projekte\CPP\VapourSynth Direct2D Rendering\main.cpp(197)
[External Code]
VapourSynth Direct2D Rendering.exe!WndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 244
at D:\Projekte\CPP\VapourSynth Direct2D Rendering\main.cpp(244)
[External Code]
VapourSynth Direct2D Rendering.exe!WndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 244
at D:\Projekte\CPP\VapourSynth Direct2D Rendering\main.cpp(244)
[External Code]
VapourSynth Direct2D Rendering.exe!WndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 244
at D:\Projekte\CPP\VapourSynth Direct2D Rendering\main.cpp(244)
[External Code]
VapourSynth Direct2D Rendering.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 164
at D:\Projekte\CPP\VapourSynth Direct2D Rendering\main.cpp(164)
[External Code]
I can try to compile VS to get debug symbols or maybe you can have a look if I upload the source code.
The script is very simple and works in any other application.
import os, sys
import vapoursynth as vs
core = vs.get_core()
sys.path.append(r'D:\Projekte\VB\staxrip\bin\Apps\Plugins\VS\Scripts')
core.std.LoadPlugin(r"D:\Projekte\VB\staxrip\bin\Apps\Plugins\both\ffms2\ffms2.dll")
clip = core.ffms2.Source(r'D:\Samples\test.mkv', cachefile=r'D:\Samples\test_temp\test.ffindex')
#clip = core.std.AssumeFPS(clip, None, 25, 1)
clip = core.std.FlipVertical(clip)
if clip.format.id == vs.RGB24:
_matrix_in_s = 'rgb'
else:
if clip.height > 576:
_matrix_in_s = '709'
else:
_matrix_in_s = '470bg'
clip = clip.resize.Bicubic(matrix_in_s = _matrix_in_s, format = vs.COMPATBGR32)
clip.set_output()
Are there any restrictions on what you're allowed to do when handling a WM_DESTROY message?
It's a simple C++ classic Win32 GUI application, I'm not a expert in that and don't know about restrictions.
Myrsloik
18th January 2020, 13:18
Send me the code and I'll take look at it then.
Btw, debug symbols for vapoursynth.dll are included in the installer (look for vapoursynth.pdb). VSScript.dll has no code of interest at all and is pointless to bother with. If anything you need to compile the python module with debug symbols which I've never done so don't ask me how.
stax76
18th January 2020, 13:55
Thanks for the help! I hope it's easy to find and fix.
http://www.mediafire.com/file/xgfjzt3jxhs489s/VapourSynth_Direct2D_Rendering.zip
Jukus
19th January 2020, 19:06
Is it possible to read somewhere how to do detelecine using VS? I know there is documentation http://www.vapoursynth.com/doc/plugins/vivtc.html but still nothing is clear.
Myrsloik
19th January 2020, 22:16
Thanks for the help! I hope it's easy to find and fix.
http://www.mediafire.com/file/xgfjzt3jxhs489s/VapourSynth_Direct2D_Rendering.zip
Still looking at your code. Still not sure why it happens.
Boulder
20th January 2020, 12:22
Is it possible to read somewhere how to do detelecine using VS? I know there is documentation http://www.vapoursynth.com/doc/plugins/vivtc.html but still nothing is clear.
It's basically the same procedure compared to Avisynth's TFM and TDecimate. You just have to use the VapourSynth syntax. IIRC the settings are pretty much the same for a regular IVTC operation.
Jukus
20th January 2020, 12:48
It's basically the same procedure compared to Avisynth's TFM and TDecimate. You just have to use the VapourSynth syntax. IIRC the settings are pretty much the same for a regular IVTC operation.
I have never used AviSynth.
Or tell me an analog of this code for VS
AnimeIVTC(2, bbob=5, extbob=MC_A_bob, mode22=false, aa=0)
Boulder
20th January 2020, 13:01
AnimeIVTC is a custom function, it's far from a normal IVTC. I don't know if there is an alternative one in VS.
Jukus
20th January 2020, 13:31
AnimeIVTC is a custom function, it's far from a normal IVTC. I don't know if there is an alternative one in VS.
How to make detelecine in general? I even have a poor idea of what telecine is, what scripts and their settings should do to fix it.
Boulder
20th January 2020, 13:48
How to make detelecine in general? I even have a poor idea of what telecine is, what scripts and their settings should do to fix it.A simple IVTC happens for example with
clp = core.vivtc.VFM(clp, order=1)
clp = core.vivtc.VDecimate(clp)
You really need to learn the syntax and do some studying. Avisynth is probably easier to start with than VS.
Jukus
20th January 2020, 19:16
A simple IVTC happens for example with
clp = core.vivtc.VFM(clp, order=1)
clp = core.vivtc.VDecimate(clp)
You really need to learn the syntax and do some studying. Avisynth is probably easier to start with than VS.
Everything is much worse and more complicated.
For some reason, I can’t unload the sample.
I tried to apply this code for my case, but just got an interlaced video.
The best result is obtained in this way:
clip = haf.QTGMC(clip, Preset='Very Slow', Sharpness=0.3, FPSDivisor=2, TFF=True)
clip = core.vivtc.VDecimate(clip, cycle=5)
At the same time, many frames with blends and even there is no consistency, that is 4 good frames, the next with blend, then 8 good frames, the next with blend, about 2 frames with blends in a row.
Srestore doesn't help.
I have no more ideas on what can be done and what is happening in this video.
Reading the documentation is useless without understanding what is going on in the video. And there is nothing to read about what types of videos exist and what can be done or not done with it. Even there are several types of telecine: HardTelecine, DoubleHardTelecine and I don’t know what else.
AviSynth is Windows only, I use Linux. Maybe I should use AviSynth with WIne, I don't know.
Boulder
20th January 2020, 19:27
If your source is anime, I can only wish you good luck with that. They are notoriously hard, or even impossible to restore without intense manual labour.
Jukus
20th January 2020, 19:51
If your source is anime, I can only wish you good luck with that. They are notoriously hard, or even impossible to restore without intense manual labour.
No, it's a low-budget film from 2001-2004.
stax76
20th January 2020, 22:36
@Myrsloik
I found a solution that should be fine for me, moving the cleanup code past the message loop, apparently it has something to do with the message system. Sorry for not finding it earlier and thanks for trying to help.
Myrsloik
21st January 2020, 00:32
@Myrsloik
I found a solution that should be fine for me, moving the cleanup code past the message loop, apparently it has something to do with the message system. Sorry for not finding it earlier and thanks for trying to help.
Definitely looks like some kind of memory corruption but I can't explain why it happens. A true mystery. It crashes in vpy_clearEnvironment() which gets called twice in a row (impossible) and I can't explain that at all.
stax76
21st January 2020, 11:23
Definitely looks like some kind of memory corruption but I can't explain why it happens. A true mystery. It crashes in vpy_clearEnvironment() which gets called twice in a row (impossible) and I can't explain that at all.
I've set few breakpoints and stepped through the code, turned out that WM_DESTROY is not only sent to the main window but also to the child windows so the code runs more than once... :o
https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-destroy
Myrsloik
21st January 2020, 15:28
I've set few breakpoints and stepped through the code, turned out that WM_DESTROY is not only sent to the main window but also to the child windows so the code runs more than once... :o
https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-destroy
So it was your fault after all...
Your code sample was helpful to the development of audio support anyway since it exposed another bug.
lansing
25th January 2020, 12:12
I trying out the vapousynth sdk to build a filter, I want to start off by testing out the examples in the sdk folder, but I don't know how to compile them into dll. Can I get some instruction?
Myrsloik
25th January 2020, 12:52
I trying out the vapousynth sdk to build a filter, I want to start off by testing out the examples in the sdk folder, but I don't know how to compile them into dll. Can I get some instruction?
From the VS2019 startup screen select "create a new project".
Then "windows desktop wizard" and when asked select dll as project type and check "empty project". Add the sdk source file and then add the location of vapoursynth.h to the include dirs (or simply stuff it in the same dir as the source code if you're lazy).
Something like that.
lansing
25th January 2020, 18:54
From the VS2019 startup screen select "create a new project".
Then "windows desktop wizard" and when asked select dll as project type and check "empty project". Add the sdk source file and then add the location of vapoursynth.h to the include dirs (or simply stuff it in the same dir as the source code if you're lazy).
Something like that.
For some reason the header files were not detected, got the same problem if I put them in the header folder.
https://i.imgur.com/NHrNBAE.jpg
stax76
25th January 2020, 19:22
In the project properties there is a VC++ Directory section where you can set include and lib directories.
lansing
25th January 2020, 20:07
In the project properties there is a VC++ Directory section where you can set include and lib directories.
Thanks it works
Myrsloik
26th January 2020, 14:30
Go try the builds with audio support (https://forum.doom9.org/showthread.php?t=177623).
feisty2
27th January 2020, 21:06
update on the syntactic sugar: https://github.com/IFeelBloated/vaporsynth-syntactic-sugar/blob/master/sugar.hpp
new function: View(y, x)
creates an offset view of the src plane centered on (y, x), you can also create a second/third/... order view on a view to manipulate the relative coordinates of, well, relative coordinates. high order views are useful to algorithms with nested search windows (eg. NLMeans, you got a sliding similarity window(s) inside a sliding search window(a)).
the previous box blur example
auto srcp = MakePlane<const float>(srcp8, width, height, Repeat);
auto dstp = MakePlane<float>(dstp8, width, height, Zero);
for (auto y : Range{ height })
for (auto x : Range{ width })
dstp[y][x] = (srcp[y-1][x-1] + srcp[y-1][x] + srcp[y-1][x+1] + srcp[y][x-1] + srcp[y][x] + srcp[y][x+1] + srcp[y+1][x-1] + srcp[y+1][x] + srcp[y+1][x+1]) / 9;
could now be further simplified to
auto srcp = MakePlane<const float>(srcp8, width, height, Repeat);
auto dstp = MakePlane<float>(dstp8, width, height, Zero);
for (auto y : Range{ height })
for (auto x : Range{ width }) {
auto center = srcp.View(y, x);
dstp[y][x] = (center[-1][-1] + center[-1][0] + center[-1][1] + center[0][-1] + center[0][0] + center[0][1] + center[1][-1] + center[1][0] + center[1][1]) / 9;
}
feisty2
27th January 2020, 22:06
@Myrsloik
can you somehow merge these helper functions into VSAPI so it would be easier for filter developers to code or prototype new filters? I don't wanna keep it homegrown.
lansing
27th January 2020, 22:56
I got a crash from the audio test build while running benchmark in vsedit. It works fine when I switch back to R48.
core.avs.LoadPlugin(vd_filter)
core.avs.LoadVirtualdubPlugin(neatvideo_vdf, "NeatVideo", 2)
clip = core.lsmas.LWLibavSource(src, prefer_hw=1)
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)
denoise_clip = core.avs.NeatVideo_2(rgb_clip, profilePath, presetPath)
denoise_clip.set_output()
Myrsloik
27th January 2020, 23:26
@Myrsloik
can you somehow merge these helper functions into VSAPI so it would be easier for filter developers to code or prototype new filters? I don't wanna keep it homegrown.
No, this is definitely not something the API should handle. Not that it'd be possible anyway to expose a huge lump of C++ templates in a header through a C API anyway...
Myrsloik
28th January 2020, 09:02
I got a crash from the audio test build while running benchmark in vsedit. It works fine when I switch back to R48.
core.avs.LoadPlugin(vd_filter)
core.avs.LoadVirtualdubPlugin(neatvideo_vdf, "NeatVideo", 2)
clip = core.lsmas.LWLibavSource(src, prefer_hw=1)
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)
denoise_clip = core.avs.NeatVideo_2(rgb_clip, profilePath, presetPath)
denoise_clip.set_output()
Is it reproducible with blankclip?
feisty2
28th January 2020, 09:57
No, this is definitely not something the API should handle. Not that it'd be possible anyway to expose a huge lump of C++ templates in a header through a C API anyway...
well I could wrap everything into a C++ wrapper and enable a python scripting kind of filter writing experience with various syntactic sugar in c++20, but there's already vsxx so I don't know...
lansing
28th January 2020, 11:04
Is it reproducible with blankclip?
Yes, I tested with QTGMC, also crashed.
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = core.std.BlankClip(width=1920, height=1080, format=vs.YUV420P8, length=10000)
clip = haf.QTGMC(clip, TFF=True)
clip.set_output()
I previewed the script, do a couple of seeks and it crashed. Every seek took about 1G of memory.
feisty2
28th January 2020, 16:45
@Myrsloik
can I store vsapi, in and out as global variables and for each filter in the plugin, refresh them in xxxCreate()? will there be some unknown conflict? I assume this should work since you can only invoke one filter in the plugin with each function call?
I haven't finished but basically, it's https://github.com/IFeelBloated/vaporsynth-syntactic-sugar/blob/master/gaussblur(example).cxx#L70
Myrsloik
28th January 2020, 18:25
@Myrsloik
can I store vsapi, in and out as global variables and for each filter in the plugin, refresh them in xxxCreate()? will there be some unknown conflict? I assume this should work since you can only invoke one filter in the plugin with each function call?
I haven't finished but basically, it's https://github.com/IFeelBloated/vaporsynth-syntactic-sugar/blob/master/gaussblur(example).cxx#L70
That won't work for several reasons:
1. You can get different vsapi pointers to different filters. This is how different api versions are handled.
2. Multithreaded filter creation is actually a thing. So you'll have races when using globals for in and out.
feisty2
28th January 2020, 20:04
well, then I guess the simplest solution is to make the global variables templated, so each filter has the access to its own copy
feisty2
29th January 2020, 22:35
can I request a frame once and get the same frame multiple times? I know it sounds weird but it has something to do with temporal padding.
Myrsloik
29th January 2020, 23:02
can I request a frame once and get the same frame multiple times? I know it sounds weird but it has something to do with temporal padding.
Sure, you simply have to free all the different references you get to the frame.
feisty2
30th January 2020, 20:47
I just finished wrapping the video access process, the "zero" mode for temporal padding is quiet a nuisance: https://github.com/IFeelBloated/vsFilterScript/blob/master/TemporalPaddingPolicies.hxx#L8 since it requires creating a new frame, which then requires a "core".
the temporal padding functions are called here: https://github.com/IFeelBloated/vsFilterScript/blob/master/Clip.hxx#L72 and the global "Core<Filter>" is obtained from xxxCreate(), I've tested it and it seemed to work properly, but I'm not sure, is there a potential problem here with the core stuff for zero padding at the temporal dimension?
Also can I store "frameCtx" in the video clip struct when requesting the frame so I can get rid of this useless parameter in GetFrame()? Do all frames share the same frameCtx or do I need a map to store the Ctx for each frame?
Jukus
7th February 2020, 19:20
How can crop be an odd number? (but with resize to even numbers, ofс)
There is a technically interlaced DVD, but visually progressive, 2 pixels above are a black stripe, do crop top 2 and resize to 480, but a video doesn't encoded, what should I do?
Myrsloik
7th February 2020, 19:35
I just finished wrapping the video access process, the "zero" mode for temporal padding is quiet a nuisance: https://github.com/IFeelBloated/vsFilterScript/blob/master/TemporalPaddingPolicies.hxx#L8 since it requires creating a new frame, which then requires a "core".
the temporal padding functions are called here: https://github.com/IFeelBloated/vsFilterScript/blob/master/Clip.hxx#L72 and the global "Core<Filter>" is obtained from xxxCreate(), I've tested it and it seemed to work properly, but I'm not sure, is there a potential problem here with the core stuff for zero padding at the temporal dimension?
Also can I store "frameCtx" in the video clip struct when requesting the frame so I can get rid of this useless parameter in GetFrame()? Do all frames share the same frameCtx or do I need a map to store the Ctx for each frame?
The point of frameCtx is that it's unique to each frame being processed. I didn't review the rest of your code.
StainlessS
7th February 2020, 19:39
How can crop be an odd number? (but with resize to even numbers, ofс)
Well if YV12 (420), there are half the number of chroma samples as there are luma samples (both X and Y dimension),
and you cant chop a chroma sample in half.
If Interlaced YV12, then can only crop vertical in multiples of 4. [Otherwise Interlacing destroyed]
_Al_
7th February 2020, 19:52
in Vapoursynth you cannot crop "within" subsampling,
if you have YUV420P8 , it means you can crop only even numbers in x and y
say you have YUV411P8, then you can crop only multiples of 4 in x but odd lines in y
..etc,
you can get those multiples like this:
import vapoursynth as vs
clip = vs.core.std.BlankClip(clip, format=vs.YUV420P8)
print(1 << clip.format.subsampling_h)
print(1 << clip.format.subsampling_w)
you'd get:
>>>2
>>>2
for format=vs.YUV411P8
you'd get:
>>>1
>>>4
anyway, but do not cut some lines and resize back to the same number, that is nasty
Jukus
7th February 2020, 20:23
Thanks for answers.
anyway, but do not cut some lines and resize back to the same number, that is nasty
You mean it's a hoax?
Some people think that the resolution of the image should necessarily be multiples of 8 or even 16.
There are also hardware players that do not understand the non-standard resolution, anamorph.
_Al_
7th February 2020, 21:39
There is copping scripts, tutorials, calculators included, etc., on web since era of digital video started, especially at the beginning everyone was cropping like they'd get candy each time they did that. And those scripts and advises are still out there.
About mod, take a major HD resolution dimension 1080 that does not even qualify for mod 16.
If there is a filter that needs mod 8 or 16 you go with it otherwise there is no reason to change video to get to that mod. What I meant with those 2 pixels black strips, just leave it there (if it is an top or bottom). Maybe the best advice is going with basics for DVD, you see black stripes on sides crop them , total 16 pixels left and right, then resize to 16:9 to 854x480. At this point if those black stripes bother you, you can crop them, but that I'd do only if having letterbox, not some 2 pixels.
Jukus
7th February 2020, 22:00
@_AI_
Likely, people look at x264 log and see there "magic blocks of pixels"
...
[libx264 @ 0x55565ecbfd80] mb I I16..4: 10.1% 74.9% 14.9%
[libx264 @ 0x55565ecbfd80] mb P I16..4: 2.2% 9.2% 1.0% P16..4: 52.0% 17.5% 13.3% 0.5% 0.2% skip: 4.0%
[libx264 @ 0x55565ecbfd80] mb B I16..4: 0.1% 0.4% 0.0% B16..8: 42.9% 5.1% 1.0% direct: 2.7% skip:47.8% L0:36.5% L1:46.9% BI:16.6%
[libx264 @ 0x55565ecbfd80] 8x8 transform intra:73.7% inter:70.4%
...
[libx264 @ 0x55565ecbfd80] i16 v,h,dc,p: 11% 6% 3% 80%
[libx264 @ 0x55565ecbfd80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 8% 4% 9% 15% 14% 16% 13% 13%
[libx264 @ 0x55565ecbfd80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 7% 3% 8% 16% 15% 15% 12% 12%
[libx264 @ 0x55565ecbfd80] i8c dc,h,v,p: 30% 25% 19% 26%
Jukus
7th February 2020, 22:53
How to write an analog of that code for VS?
interp = nnedi3(field=0, qual=2)
deint = YadifMod(order=0, edeint=interp)
TFM(order=0, mode=3, clip2=deint, slow=2).TDecimate(hybrid=1)
ChaosKing
8th February 2020, 01:20
How to write an analog of that code for VS?
interp = nnedi3(field=0, qual=2)
deint = YadifMod(order=0, edeint=interp)
TFM(order=0, mode=3, clip2=deint, slow=2).TDecimate(hybrid=1)
clip = your source
interp = core.nnedi3.nnedi3(clip, field=0, qual=2)
deint = core.yadifmod.Yadifmod(clip, order=0, edeint=interp)
clip = clip.vivtc.VFM(order=0, mode=3, clip2=deint).vivtc.VDecimate()
There's no hybrid=1 parameter in VDecimate().
stax76
10th February 2020, 16:51
Hello Myrsloik, I've some questions...
Is there some documentation or sample code for DLL discovery and loading?
I've looked at the nvenc code and it is using Run-Time Dynamic Linking, I don't know if it relies on VS being in Path or if it searches the VS location in the registry and modifies the Path env var of the process.
vspipe appears to do Load-Time Dynamic Linking, discovery and manual loading is not necessary because the DLLs are located in the same directory.
Do all setup variants add VS to the Path env var and apps can rely on that?
Do all setup variants register the VS location in the registry? If so which key(s)?
I believe Load-Time Dynamic Linking is possible and preferred, I'm mostly unsure about path discovery.
ChaosKing
10th February 2020, 17:45
Do all setup variants add VS to the Path env var and apps can rely on that?
Do all setup variants register the VS location in the registry? If so which key(s)?
Yes, see https://github.com/vapoursynth/vapoursynth/blob/master/installer/vsinstaller.iss#L142
Since VS was split in global and user installation variants we need to check 4 reg paths:
CurrentUser / LocalMachine => "SOFTWARE\VapourSynth-32" and "SOFTWARE\VapourSynth"
stax76
10th February 2020, 18:28
Thanks, might somebody have done this before with C++ and Win32? I'm very clumsy with that...
Myrsloik
10th February 2020, 19:01
Hello Myrsloik, I've some questions...
Is there some documentation or sample code for DLL discovery and loading?
Do all setup variants add VS to the Path env var and apps can rely on that?
Do all setup variants register the VS location in the registry? If so which key(s)?
I believe Load-Time Dynamic Linking is possible and preferred, I'm mostly unsure about path discovery.
Is there some documentation or sample code for DLL discovery and loading?
No. You read the location you need from the registry. HKLM/HKCU (depends on current user install mode) and then software\vapoursynth (or vapoursynth-32 for poor people) and the keys of interest are called VSScriptDLL and VapourSynthDLL. Simply use loadlibrary and call vsscript_getVSApi2() or getVapourSynthAPI() depending on which dll you use.
Do all setup variants add VS to the Path env var and apps can rely on that?
No. It's a user option and you can never depend on this.
Do all setup variants register the VS location in the registry? If so which key(s)?
Yes, see above. I guess portable doesn't but that's hardly a setup variant...
stax76
22nd February 2020, 17:19
Made some simple wrapper library for AviSynth and VapourSynth, it was necessary because AviSynth has no C or COM interface...
https://github.com/staxrip/staxrip/tree/master/FrameServer
https://github.com/staxrip/staxrip/blob/master/General/FrameServer.vb
https://github.com/staxrip/staxrip/blob/master/General/VideoRenderer.vb
amichaelt
23rd February 2020, 05:00
it was necessary because AviSynth has no C or COM interface...
What about avisynth_c.h?
stax76
23rd February 2020, 06:26
I don't know, maybe I should try it, sample code would help. When I started the library I didn't know a lot about C/C++ (last project more than 10 years ago) and AviSynth, after completing it I know a little more. With the AviSynth part I had few issues, no problems with VapourSynth.
DJATOM
23rd February 2020, 14:50
The way you're using frame fetching in VS is inefficient. In general you have to care about async frame requests on your end, otherwise it works like a single-threaded frameserver.
Myrsloik
23rd February 2020, 21:13
What about avisynth_c.h?
Using the avisynth C api is really iffy. If all you want is to evaluate a script and get frames out then writing your own C++ wrapper dll will be so much more reliable and also faster. Believe me, I've tried both ways long ago when developing yatta.
VapourSynth has a very straightforward C-api in comparison.
_Al_
23rd February 2020, 23:18
If trying to modify props and clip resolution is ridiculously small, it crashes, where no recovery is possible, it locks a PC.
rgb = core.std.BlankClip(width=30, height=16, format=vs.RGB24)
rgb2 = rgb.std.PlaneStats(prop='PlaneStats')
PROP_NAME = f'New_string_name_here'
def copy_prop(n,f):
f_out = f[0].copy()
f_out.props[PROP_NAME] = '{:.1f}'.format(f[1].props['PlaneStatsAverage']*100)
return f_out
rgb = core.std.ModifyFrame(rgb, [rgb, rgb2], copy_prop)
stax76
24th February 2020, 00:31
The way you're using frame fetching in VS is inefficient. In general you have to care about async frame requests on your end, otherwise it works like a single-threaded frameserver.
For a GUI like staxrip it's totally fine, it's not used for encoding but only to access parameters and for a basic crop and preview dialog that doesn't support playback and HDR color handling but has mpv/mpc integration to take care of this. The GDI based WinForms rendering was ridiculously slow but it was addressed with a hardware accelerated Direct2D replacement. It does a vertical flip and converts to RGB32 in software via avs/vs. For best possible performance vertical flip and YV12 could be handled by Direct3D and like you told frames could be accessed asynchronously.
Myrsloik
29th February 2020, 15:22
If trying to modify props and clip resolution is ridiculously small, it crashes, where no recovery is possible, it locks a PC.
rgb = core.std.BlankClip(width=30, height=16, format=vs.RGB24)
rgb2 = rgb.std.PlaneStats(prop='PlaneStats')
PROP_NAME = f'New_string_name_here'
def copy_prop(n,f):
f_out = f[0].copy()
f_out.props[PROP_NAME] = '{:.1f}'.format(f[1].props['PlaneStatsAverage']*100)
return f_out
rgb = core.std.ModifyFrame(rgb, [rgb, rgb2], copy_prop)
I can't reproduce this and need more information. CPU? OS? Number of threads? Does it happen every time?
Myrsloik
1st March 2020, 00:02
R49-RC1 is now available (https://github.com/vapoursynth/vapoursynth/releases/tag/R49-RC1). All maintenance this time since I'm slowly working on the separate audio build.
Changes:
r49:
updated to python 3.8 on windows
updated visual studio 2019 runtime version
updated zimg and added support for spline64 resize method
fixed a savestring bug in avscompat (sekrit-twc)
interleave, selectevery and separate fields now have a modify_duration argument to determine if they modify frame durations and fps
addborders and crop now update the _fieldbased attribute properly when an odd number of lines are cut from the top
fixed add to path not working for single user installs
fixed compilation on non-x86 systems
fixed an infinite loop in the expr filter optimizer that was introduced in r48 (sekrit-twc)
lansing
3rd March 2020, 07:44
I don't know if this is a bug from vapoursynth or KNLMeansCL. KNLMeansCL requires input clip to be YUV444P10, but it still complains about it when I converted my clip to YUV444P10.
clip = core.resize.Bicubic(clip, format=vs.YUV444P10)
clip = core.knlm.KNLMeansCL(clip)
But then it works when I convert it to YUV444P8
Selur
4th March 2020, 19:31
@lansing: read https://github.com/Khanattila/KNLMeansCL/issues/42
lansing
4th March 2020, 20:31
@lansing: read https://github.com/Khanattila/KNLMeansCL/issues/42
Thanks, I'll follow up over there.
Myrsloik
19th March 2020, 21:21
R49-RC2 (https://github.com/vapoursynth/vapoursynth/releases/tag/R49-RC2) is out. Should be the final RC.
r49:
updated to python 3.8 on windows
updated visual studio 2019 runtime version
updated zimg and added support for spline64 resize method
fixed transfer characteristics not being applied to gray format clips (sekrit-twc)
fixed vdecimate bugs when compiled on systems where char is unsigned by default
fixed a regression introduced in r48 in that could sometimes cause corrupt output from expr on cpus without sse4.1 (sekrit-twc)
fixed a savestring bug in avscompat (sekrit-twc)
interleave, selectevery and separate fields now have a modify_duration argument to determine if they modify frame durations and fps
addborders and crop now update the _fieldbased attribute properly when an odd number of lines are cut from the top
fixed add to path not working for single user installs
fixed compilation on non-x86 systems
fixed an infinite loop in the expr filter optimizer that was introduced in r48 (sekrit-twc)
poisondeathray
24th March 2020, 16:17
Can 2 python versions 3.x coexist ? 3.7.x and 3.8.x ? I ask because I need 3.7 for some other projects but would like to test new version of vapoursynth, and I'm assuming 3.8 is a requirement for r49-rc2 ?
Myrsloik
24th March 2020, 16:30
Can 2 python versions 3.x coexist ? 3.7.x and 3.8.x ? I ask because I need 3.7 for some other projects but would like to test new version of vapoursynth, and I'm assuming 3.8 is a requirement for r49-rc2 ?
Yes, they can generally do that without any problems. However the python installer doesn't approve so you'll need to rename/delete the registry entries for the version you install first.
There's also always the portable version. Maybe that's easier.
feisty2
25th March 2020, 07:33
@Myrsloik
auto y1 = vsapi->getReadPtr(x, 0);
auto x2 = vsapi->cloneFrameRef(x);
auto y2 = vsapi->getReadPtr(x2, 0);
say "x" is a frame ref, do "y1" and "y2" evaluate to the same value?
Myrsloik
25th March 2020, 09:05
@Myrsloik
auto y1 = vsapi->getReadPtr(x, 0);
auto x2 = vsapi->cloneFrameRef(x);
auto y2 = vsapi->getReadPtr(x2, 0);
say "x" is a frame ref, do "y1" and "y2" evaluate to the same value?
Yes, they point to the same underlying frame.
feisty2
26th March 2020, 14:58
what is the lifetime of "in" and "out" in the "Create" function? If I create an std::string_view from propGetData(in, ...), does it have a global lifetime?
Myrsloik
26th March 2020, 15:25
what is the lifetime of "in" and "out" in the "Create" function? If I create an std::string_view from propGetData(in, ...), does it have a global lifetime?
They're only valid inside the create function and usually destroyed very quickly after.
feisty2
26th March 2020, 15:32
I see, so I should copy the string with an owning std::string.
Myrsloik
26th March 2020, 15:37
I see, so I should copy the string with an owning std::string.
Yes, always.
Boulder
26th March 2020, 16:32
If I have a VFR video clip, say like part A deinterlaced to 25fps and part B bobbed to 50fps in the script and the two parts combined with A+B - what is the proper way to get the correct timecodes out with vspipe? Should I use AssumeFPS to set the framerate to 25fps (which I will use when I feed it to x265) or leave it as it is?
Myrsloik
26th March 2020, 20:31
R49 released!
Myrsloik
26th March 2020, 20:33
If I have a VFR video clip, say like part A deinterlaced to 25fps and part B bobbed to 50fps in the script and the two parts combined with A+B - what is the proper way to get the correct timecodes out with vspipe? Should I use AssumeFPS to set the framerate to 25fps (which I will use when I feed it to x265) or leave it as it is?
It's been a long time since I did this so it could be wrong but generally you simply splice the two different fps clips (mismatch=1 in splice) and then use it as input to x265. Make sure to use the vspipe timecode option and after the encode is done mux in the proper timecodes.
Or that's how I think it should work.
Boulder
27th March 2020, 20:17
It's been a long time since I did this so it could be wrong but generally you simply splice the two different fps clips (mismatch=1 in splice) and then use it as input to x265. Make sure to use the vspipe timecode option and after the encode is done mux in the proper timecodes.
Or that's how I think it should work.
Doesn't seem to be working properly :( I fed the VFR clip into x265 and told it to expect 25fps input (otherwise it would simply crash). The clip was produced by splicing with the + operator in Vapoursynth.
The timecodes have two steps, 20ms and 40ms in the 50fps parts. The 25fps parts have 40ms and 80ms steps.
# timecode format v2
0.000000
20.000000
60.000000
80.000000
120.000000
.
.
.
46600.000000
46680.000000
46720.000000
46800.000000
46840.000000
46920.000000
46960.000000
I have some similar old Matroska files in which I have encoded the video track at 50fps (at least according to MediaInfo) and created the timestamp v1 file manually. I now extracted the timestamps and they look like this, first the 50fps part and the latter one is from a 25fps part:
# timestamp format v2
0
20
40
60
.
.
.
408000
408040
408080
408120
408160
DJATOM
28th March 2020, 00:07
Boulder
You probably doing it wrong.
Yesterday I had hybrid video file encoded as MBAFF (no actual combed frames, but it's 30000/1001i), and some sections are upscaled from 24000/1001p. So I need to decimate only certain sections and produce VFR video.
I'll describe my solution bellow and how to actually get valid timecodes (Myrs answer seems not so clear for you). The whole process is described to understand my workflow and most likely irrelevant for you, but you can adapt that to your case and use only what you need from it.
First, I have to check with VDecimate(dryrun=True) if scene actually telecined. The result for my video was
scenes = [0, 80, 173, 269, 366, 462, 561, 609, 657, 705, 1255, 1306]
Video starts from 24p scene, so I have to decimate every odd section.
vfr_pool = list()
for pos, start in enumerate(scenes, 1): # start from 1 for simplicity of the algo
if pos >= len(scenes): # last frame in list is the end of last section, so I want to terminate loop on it
break
end = scenes[pos]
if pos&1: # decimate only 1, 3, 5, 7, etc. sections
vfr_pool.append(core.vivtc.VDecimate(source[start:end]))
else:
vfr_pool.append(source[start:end])
And finally splice those scenes into one VFR video
vfr_clip = core.std.Splice(vfr_pool)
vfr_clip.set_output()
Now it's ready to encode,
vspipe -t mytimecodes.txt -y script.vpy - | x265 ... --y4m --fps 24000/1001 -
and after encoding use mytimecodes.txt to mux into mkv video. Result should be VFR and properly sync with audio.
I really want tdecimate's mode 4/5 solution in vapoursynth, but it seems like no one want to port that.
Boulder
28th March 2020, 10:56
Thank you, I will take a look at your method :)
I used this kind of approach for creating the test clip, the first and third parts are bobbed.
clp = core.dgdecodenv.DGSource(r"F:\Temp\Captures\monty\monty_s01e01.dgi", cl=244, cr=244)
result = haf.QTGMC(core.std.Trim(clp, 0,719), Preset='very fast', Search=5, SearchParam=8, PelSearch=8, ChromaMotion=True, ChromaNoise=False, SourceMatch=2, Lossless=2, EZKeepGrain=0.4, Sharpness=0.1, TR2=0, TFF=True)
result = result + haf.QTGMC(core.std.Trim(clp, 720,2890), Preset='very fast', Search=5, SearchParam=8, PelSearch=8, ChromaMotion=True, ChromaNoise=False, SourceMatch=2, Lossless=2, EZKeepGrain=0.4, Sharpness=0.1, TR2=0, TFF=True, InputType=2)
result = result + haf.QTGMC(core.std.Trim(clp, 2891,3935), Preset='very fast', Search=5, SearchParam=8, PelSearch=8, ChromaMotion=True, ChromaNoise=False, SourceMatch=2, Lossless=2, EZKeepGrain=0.4, Sharpness=0.1, TR2=0, TFF=True)
result = result + haf.QTGMC(core.std.Trim(clp, 3936,4428), Preset='very fast', Search=5, SearchParam=8, PelSearch=8, ChromaMotion=True, ChromaNoise=False, SourceMatch=2, Lossless=2, EZKeepGrain=0.4, Sharpness=0.1, TR2=0, TFF=True, InputType=2)
result.set_output()
Thinking a bit further, I think I could use some Python scripting to autofill the Trims as I've collected all the parts like this.
#0, 719 i
#720, 2890 p
#2891, 3935 i
#3936, 4428 p
#4429, 6676 i
#6677, 6834 p
#6835, 10567 i
#10568, 12260 p
#12261, 23093 i
#23094, 23991 p
#23992, 24154 i
#24155, 25876 p
#25877, 26664 i
#26665, 30805 p
#30806, 31140 i
#31141, 40655 p
#40656, 43509 i
#43510, 43599 p
#43600, 44268 i
#44269, 44403 p
#44404, 44831 i
#44832, 45795 p
#45796, 47686 i
DJATOM
28th March 2020, 12:22
Apparently timecodes produced with vspipe are weird. Working solution is
import easyvfr # https://gist.github.com/chikuzen/5005590 (usage: http://csbarn.blogspot.com/2013/02/easyvfr-for-vapoursynth.html)
<...>
clp = core.dgdecodenv.DGSource(r"F:\Temp\Captures\monty\monty_s01e01.dgi", cl=244, cr=244)
qtgmc_common_opts = {'Preset': 'very fast', 'Search': 5, 'SearchParam': 8, 'PelSearch': 8, 'ChromaMotion': True, 'ChromaNoise': False, 'SourceMatch': 2, 'Lossless': 2, 'EZKeepGrain': 0.4, 'Sharpness': 0.1, 'TR2': 0, 'TFF': True}
clips = []
clips.append(haf.QTGMC(core.std.Trim(clp, 0,719), **qtgmc_common_opts))
clips.append(haf.QTGMC(core.std.Trim(clp, 720,2890), **qtgmc_common_opts, InputType=2))
clips.append(haf.QTGMC(core.std.Trim(clp, 2891,3935), **qtgmc_common_opts))
clips.append(haf.QTGMC(core.std.Trim(clp, 3936,4428), **qtgmc_common_opts, InputType=2))
vfr = easyvfr.EasyVFR(clips, base_num=25, base_den=1)
vfr.write_timecode(r'test.tc.txt')
vfr.splice_clips().set_output()
That way we have valid timecodes, after converting to v1 (tcConv) the result is
# timecode format v1
Assume 25.000000
0,1439,50.000000
3612,5701,50.000000
Boulder
28th March 2020, 12:52
Thanks a lot, that probably saves me a huge amount of manual work :)
feisty2
29th March 2020, 13:30
I updated to r49 and weird things happened.
I ran the same std.Convolution script for speed test and the script ran for 497.17fps, but it was 2400+fps before the update!
my custom GaussBlur filter also ran a lot slower, from 1800+fps before update to now 483.92fps (gcc -O3)
Are_
29th March 2020, 14:23
std.Convolution with same parameters as you runs at 2384 fps here (Linux), maybe Windows build is compiled without optimizations?
I also did try to run it with core.std.SetMaxCPU('none') but it made no difference? Maybe I'm too sleepy and I'm doing something wrong.
import vapoursynth as vs
core = vs.get_core()
core.std.SetMaxCPU('none')
clip = core.std.BlankClip(format=vs.GRAYS, length=100000, fpsnum=24000, fpsden=1001, keep=True)
clip = core.std.Convolution(clip, matrix=[1,2,1,2,4,2,1,2,1])
clip.set_output()
feisty2
29th March 2020, 14:28
std.Convolution with same parameters as you runs at 2384 fps here (Linux), maybe Windows build is compiled without optimizations?
I also did try to run it with core.std.SetMaxCPU('none') but it made no difference? Maybe I'm too sleepy and I'm doing something wrong.
import vapoursynth as vs
core = vs.get_core()
core.std.SetMaxCPU('none')
clip = core.std.BlankClip(format=vs.GRAYS, length=100000, fpsnum=24000, fpsden=1001, keep=True)
clip = core.std.Convolution(clip, matrix=[1,2,1,2,4,2,1,2,1])
clip.set_output()
could you compile this (https://github.com/IFeelBloated/vsFilterScript/blob/master/GaussBlur.hxx) with GCC10 -Ofast and run a speed test? :thanks:
Are_
29th March 2020, 14:33
I will give it a try in about one hour or so, I don't have GCC-10 installed and it will take a while here on Gentoo.
ChaosKing
29th March 2020, 14:39
std.Convolution with same parameters as you runs at 2384 fps here (Linux), maybe Windows build is compiled without optimizations?
I also did try to run it with core.std.SetMaxCPU('none') but it made no difference? Maybe I'm too sleepy and I'm doing something wrong.
import vapoursynth as vs
core = vs.get_core()
core.std.SetMaxCPU('none')
clip = core.std.BlankClip(format=vs.GRAYS, length=100000, fpsnum=24000, fpsden=1001, keep=True)
clip = core.std.Convolution(clip, matrix=[1,2,1,2,4,2,1,2,1])
clip.set_output()
R49 quick test on ryzen 2600, seems ok
vspipe.exe .\bla.vpy .
Output 100000 frames in 6.20 seconds (16138.35 fps) # without core.std.SetMaxCPU('none')
Output 100000 frames in 12.73 seconds (7856.92 fps) #with core.std.SetMaxCPU('none')
sl1pkn07
29th March 2020, 18:21
with/without dual xeon (:/) (linux, -02)
└───╼ vspipe test.vpy /dev/null
Output 100000 frames in 15.89 seconds (6293.29 fps)
└───╼ vspipe test.vpy /dev/null
Output 100000 frames in 9.40 seconds (10642.37 fps)
seems Konsole (KDE terminal) do strange things
lanuched the same in yakuake (based on konsole, not use as bakend)
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-git]|
└───╼ cat test.vpy
import vapoursynth as vs
core = vs.get_core()
core.std.SetMaxCPU('none')
clip = core.std.BlankClip(format=vs.GRAYS, length=100000, fpsnum=24000, fpsden=1001, keep=True)
clip = core.std.Convolution(clip, matrix=[1,2,1,2,4,2,1,2,1])
clip.set_output()
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-git]|
└───╼ vspipe test.vpy /dev/null
Output 100000 frames in 8.39 seconds (11923.86 fps)
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-git]|
└───╼ cat test.vpy
import vapoursynth as vs
core = vs.get_core()
#core.std.SetMaxCPU('none')
clip = core.std.BlankClip(format=vs.GRAYS, length=100000, fpsnum=24000, fpsden=1001, keep=True)
clip = core.std.Convolution(clip, matrix=[1,2,1,2,4,2,1,2,1])
clip.set_output()
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-git]|
└───╼ vspipe test.vpy /dev/null
Output 100000 frames in 7.32 seconds (13656.67 fps)
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-git]|
└───╼
htop with vspipe in konsole shot (https://i.ibb.co/YdYLj0z/Screenshot-20200329-192231.png)
htop with vspipe in yakuake shot (https://i.ibb.co/SXJ75C3/Screenshot-20200329-193114.png)
leon
6th April 2020, 22:14
Why does R49 installer force the download of vc++ 2019?
Myrsloik
7th April 2020, 03:29
Why does R49 installer force the download of vc++ 2019?
Because your runtimes are old and you didn't unchecked the option.
leon
7th April 2020, 21:31
You mean it checks for the installed runtimes? Because I'd already installed both x86 and x64 versions of it. You're right there's an option for it which I somehow missed.
Thank you.
BTW, I installed Python 3.8 in Program Files and moved its path to the end of PATH variable so that I'd be able to use the already installed 3.7.4 version, things appear to work so far, but I thought I'd ask here whether that's OK or not.
P.S. I updated from R45 so I thought I'd see some speed improvements considering AVX2 has been added since that version, but I got almost the same speeds, so was wondering if there's a way to check whether I was doing something wrong and that AVX2 was actually being used.
Myrsloik
7th April 2020, 21:38
You mean it checks for the installed runtimes? Because I'd already installed both x86 and x64 versions of it. You're right there's an option for it which I somehow missed.
Thank you.
BTW, I installed Python 3.8 in Program Files and moved its path to the end of PATH variable so that I'd be able to use the already installed 3.7.4 version, things appear to work so far, but I thought I'd ask here whether that's OK or not.
P.S. I updated from R45 so I thought I'd see some speed improvements considering AVX2 has been added since that version, but I got almost the same speeds, so was wondering if there's a way to check whether I was doing something wrong and that AVX2 was actually being used.
Yes, it checks for the exact version of installed runtimes. Note that the 2019 ones get updated every few months and I install the most recent minor update too. That's why it appears to you like I'm "pointlessly" installing it.
Don't do that python mess. You've most likely ended up using the R48 python module and things just work by accident.
leon
7th April 2020, 22:14
...Note that the 2019 ones get updated every few months and I install the most recent minor update too...
Well, I wasn't aware of that.
So what would you suggest? How can I keep 3.7 alongside 3.8 and make VS use it?
Does that also explain the speed problem?
amayra
10th April 2020, 18:48
i try run new VS R49 with latest version of mpv shinchiro build but mpv close after i open file and my script work fine in MPC
here my log file :
[ 5.731][v][cplayer] Opening failed or was aborted: C:\my file\mpv\test\test4.vpy
[ 5.731][v][cplayer] Running hook: ytdl_hook/on_load_fail
[ 5.731][v][ytdl_hook] full hook
[ 5.731][v][cplayer] finished playback, unrecognized file format (reason 4)
[ 5.731][e][cplayer] Failed to recognize file format.
[ 5.731][i][cplayer]
[ 5.731][i][cplayer] Exiting... (Errors when loading file)
[ 5.731][d][ytdl_hook] Exiting...
[ 5.731][d][stats] Exiting...
[ 5.731][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="remove", value="osc-margins"]
[ 5.731][v][cplayer] Set property: shared-script-properties -> 1
[ 5.731][d][osc] Exiting...
[ 5.732][d][console] Exiting...
[ 5.734][d][vo/gpu] flushing shader cache
[ 5.736][v][vo/gpu/win32] uninit
all vpy file after update stop working even with new clean mpv setup
stax76
10th April 2020, 19:53
@amayra
shinchiros builds don't have vs enabled in ffmpeg, see here:
https://forum.doom9.org/showthread.php?t=180433
amayra
10th April 2020, 20:56
@amayra
shinchiros builds don't have vs enabled in ffmpeg, see here:
https://forum.doom9.org/showthread.php?t=180433
he/she write in sourceforge :
Is vapoursynth supported?
Starting build 20171229, it was compiled with vapoursynth. If you want to use vapoursynth's filters, make sure to install vapourysnth and python3 on your own. Portable version should also works. You can read how-to setup here:
so this is lie :mad:
stax76
10th April 2020, 21:14
It supports vs and ffmpeg filters but not vs source support with ffmpeg libavformat, these are two independent things.
amichaelt
10th April 2020, 22:48
he/she write in sourceforge :
so this is lie :mad:
No, you just misread what they wrote in that post.
Just read the output of what you posted:
[ 5.731][v][cplayer] finished playback, unrecognized file format (reason 4)
[ 5.731][e][cplayer] Failed to recognize file format.
amayra
10th April 2020, 23:09
No, you just misread what they wrote in that post.
Just read the output of what you posted:
i thought this mean mpv can't unrecognized vpy after new VS version
so what this mean than ?
amichaelt
11th April 2020, 04:07
i thought this mean mpv can't unrecognized vpy after new VS version
so what this mean than ?
It means there's something wrong with mpv or with your build. You need to open a ticket with the person who makes the build scripts.
There github page also says:
vapoursynth (R48)
So they need to fix something.
stax76
11th April 2020, 05:05
It means there's something wrong with mpv or with your build. You need to open a ticket with the person who makes the build scripts.
You understand mpv and what I wrote before?
amayra
11th April 2020, 15:19
to be honest i couldn't build mpv by myself, maybe i'm too stupid or compilation process it's just a too complicated without reason
anyway used shinchiro build with R48 and python 37 and this give me this error:
[lavf] avformat_open_input() failed
my conclusion is as follows MPV doesn't support Vapoursynth file by default :'(
sl1pkn07
11th April 2020, 15:35
to be honest i couldn't build mpv by myself, maybe i'm too stupid or compilation process it's just a too complicated without reason
anyway used shinchiro build with R48 and python 37 and this give me this error:
my conclusion is as follows MPV doesn't support Vapoursynth file by default :'(
try with https://github.com/mpv-player/mpv/blob/master/DOCS/man/vf.rst (the vapoursynth part)
stax76
11th April 2020, 16:34
try with https://github.com/mpv-player/mpv/blob/master/DOCS/man/vf.rst (the vapoursynth part)
It's not exactly what he wants, that is opening a vpy file:
mpv test.vpy
That is not supported by shinchiros builds because ffmpeg is configured without vapoursynth support. One way I'm aware to check this is:
launching mpv from the console
open osd console
enter input command: print-text ${demuxer-lavf-list}
This will print the supported demuxer list to the attached console, this can also be done with mpv.net as it has advanced console support but since it uses also shinchiros builds it can't open vpy either, but it's on my to-do list to enable it for mpv.net by making my own builds.
sl1pkn07
11th April 2020, 17:32
play directly vpy files with mpv is a secury flaw, because vpy is in essential a python script. you can craft a python script as vpy wich delete or formated enterely the hardisk and ejecute it with mpv
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/7074a7ccd9a4d4e445252780fd182aa0b3778b79
LigH
11th April 2020, 17:47
Need ffmpeg / mpv with VapourSynth support? Compile it yourself with the media-autobuild suite.
stax76
11th April 2020, 18:00
play directly vpy files with mpv is a secury flaw, because vpy is in essential a python script. you can craft a python script as vpy wich delete or formated enterely the hardisk and ejecute it with mpv
https://git.ffmpeg.org/gitweb/ffmpeg...182aa0b3778b79
If possible I consider disabling it by default with a setting, mpc-be has it enabled by default btw.
Need ffmpeg / mpv with VapourSynth support? Compile it yourself with the media-autobuild suite.
I might take a look, primary resource will be a guide written by quot27. It's just one of many things I might do at one time.
sl1pkn07
11th April 2020, 19:26
ffmpeg needs set ' --enable-vapoursynth' (needs the headers for compile) , mpv is autoconfigurable if detect vapursynth, only have a option for disable it
--disable-vapoursynth
disable VapourSynth filter bridge [autodetect]
stax76
11th April 2020, 21:21
Sorry but I cannot follow.
qyot27
12th April 2020, 00:05
shinchiro's builds have had vapoursynth enabled in ffmpeg since December when this came up before. It's up to the user to pass --demuxer-lavf-format=vapoursynth to mpv or put it in their config file.
stax76
12th April 2020, 00:25
You mean it's supposed to work now? I tried print-text ${demuxer-lavf-list} in the osd console and it shows vapoursynth, in mpv.conf I have:
[extension.vpy]
demuxer-lavf-format = vapoursynth
But it's still not playing vpy, process just dies, both mpv and mpv.net, shinchiro builds from last month.
qyot27
12th April 2020, 00:56
https://github.com/shinchiro/mpv-winbuild-cmake/commit/70ecb49318950f6e4518d91b28770e06eea2d74c
All the builds after that should have had their ffmpeg updated if the build script is run in total every time. But I did check the most recent build, mpv-x86_64-20200405-git-c5f8ec7.7z, and all it needed was demuxer-lavf-format.
And with https://github.com/shinchiro/mpv-winbuild-cmake/commit/0810de172dd335a4168fdd7cbe07b59919c53849, it'll use R49 and Python 3.8 (but there's currently no builds including that, just the script).
stax76
12th April 2020, 01:28
OK, waiting for the next build then, thanks.
feisty2
12th April 2020, 14:38
@Myrsloik
is thread_local (https://en.cppreference.com/w/cpp/language/storage_duration) compatible with the multi-threading mechanism of vaporsynth? I have to use a global variable to extend the lifetime of temporary objects in some corner cases. (https://github.com/IFeelBloated/vsFilterScript/blob/master/Map.hxx#L84) the thread_local variable is exclusive to each thread like regular local variables, but has a lifetime similar to static variables, it should work with any form of multi-threading, but I just wanna make sure here.
Myrsloik
12th April 2020, 19:50
@Myrsloik
is thread_local (https://en.cppreference.com/w/cpp/language/storage_duration) compatible with the multi-threading mechanism of vaporsynth? I have to use a global variable to extend the lifetime of temporary objects in some corner cases. (https://github.com/IFeelBloated/vsFilterScript/blob/master/Map.hxx#L84) the thread_local variable is exclusive to each thread like regular local variables, but has a lifetime similar to static variables, it should work with any form of multi-threading, but I just wanna make sure here.
Anything goes. Thread local has no magic properties.
amayra
12th April 2020, 22:56
Need ffmpeg / mpv with VapourSynth support? Compile it yourself with the media-autobuild suite.
do you even realize this is not something average joe can do simply ?
_Al_
13th April 2020, 01:42
Is BestAudioSource.dll working with portable setup? For latest downloads it gives me error that it is older API 3.6 and BestAudioSource needs 3.7.
from vapoursynth import core
print(vs)
print(core.version())
core.std.LoadPlugin(r'F:\portable_vs\vapoursynth64\plugins\BestAudioSource.dll')
#
audio = vs.core.bas.Source('video.mp4', track=-1)
audio.set_output(1)
F:\portable_vs>python --version
Python 3.8.2
F:\portable_vs>python audio.py
<module 'vapoursynth' from 'F:\\portable_vs\\vapoursynth.cp38-win_amd64.pyd'>
VapourSynth Video Processing Library
Copyright (c) 2012-2020 Fredrik Mellbin
Core R49
API R3.6
Options: -
Traceback (most recent call last):
File "audio.py", line 6, in <module>
core.std.LoadPlugin(r'F:\portable_vs\vapoursynth64\plugins\BestAudioSource.dll')
File "src\cython\vapoursynth.pyx", line 1852, in vapoursynth.Function.__call__
vapoursynth.Error: Core only supports API R3.6 but the loaded plugin requires API R3.7; Filename: F:\portable_vs\vapoursynth64\plugins\BestAudioSource
.dll; Name: Best Audio Source
feisty2
13th April 2020, 11:09
I tried to move the vsapi global variable out of the Create function by using getVapourSynthAPI(), I got an undefined symbol error (undefined reference to getVapourSynthAPI)
Myrsloik
13th April 2020, 12:09
Is BestAudioSource.dll working with portable setup? For latest downloads it gives me error that it is older API 3.6 and BestAudioSource needs 3.7.
from vapoursynth import core
print(vs)
print(core.version())
core.std.LoadPlugin(r'F:\portable_vs\vapoursynth64\plugins\BestAudioSource.dll')
#
audio = vs.core.bas.Source('video.mp4', track=-1)
audio.set_output(1)
F:\portable_vs>python --version
Python 3.8.2
F:\portable_vs>python audio.py
<module 'vapoursynth' from 'F:\\portable_vs\\vapoursynth.cp38-win_amd64.pyd'>
VapourSynth Video Processing Library
Copyright (c) 2012-2020 Fredrik Mellbin
Core R49
API R3.6
Options: -
Traceback (most recent call last):
File "audio.py", line 6, in <module>
core.std.LoadPlugin(r'F:\portable_vs\vapoursynth64\plugins\BestAudioSource.dll')
File "src\cython\vapoursynth.pyx", line 1852, in vapoursynth.Function.__call__
vapoursynth.Error: Core only supports API R3.6 but the loaded plugin requires API R3.7; Filename: F:\portable_vs\vapoursynth64\plugins\BestAudioSource
.dll; Name: Best Audio Source
Obviously audio things only work in the experimental audio builds
feisty2
13th April 2020, 12:51
ahh... it seems I have to link vaporsynth.lib for this function
_Al_
13th April 2020, 22:29
Obviously audio things only work in the experimental audio builds
Ok, thank you.
LoRd_MuldeR
19th April 2020, 23:51
I noticed the following problem after updating to VapourSynth r49:
[Check for VapourSynth support]
VapourSynth thread has been created, please wait...
VapourSynth 64-Bit support is being tested.
VapourSynth EXE: C:/Program Files/VapourSynth/core/vspipe.exe
VapourSynth DLL: C:/Program Files/VapourSynth/core/vapoursynth.dll
VSPIPE.EXE failed with code 0xC0000135 -> discarding all output!
When I try to run vspipe.exe manually, from the VapourSynth directory, then I get this:
https://i.imgur.com/csSJdII.png
Note that Python v3.8 is installed on my system, and it also was recognized properly by the VapourSynth r49 installer. Tried to re-install, but didn't change anything.
Anyway, went back to r48 and everything works fine:
[Check for VapourSynth support]
VapourSynth 64-Bit support is being tested.
VapourSynth EXE: C:/Program Files/VapourSynth/core/vspipe.exe
VapourSynth DLL: C:/Program Files/VapourSynth/core/vapoursynth.dll
VapourSynth version was detected successfully.
VapourSynth 64-Bit edition found!
VapourSynth thread finished.
VapourSynth support is officially enabled now! [x86=0, x64=1]
https://i.imgur.com/g5KcS7V.png
Any idea what is going on with VapourSynth r49? Apparently vspipe.exe (or more specifically vsscript.dll) fails to locate/load the Python DLL.
stax76
20th April 2020, 00:23
Are both python and vapoursynth in path? I had a minor hiccup updating to python 3.8 and vs r49 but could solve it after 2 minutes.
LoRd_MuldeR
20th April 2020, 00:32
Are both python and vapoursynth in path?
Nope, they are not. But that's the same for Python 3.8 and Python 3.7! Still, the 'vspipe.exe' from VapurSynth r48 obviously was able to find and load the Python DLL.
IMO, applications should not rely on PATH for DLL loading anyway, as it is highly unreliable. And it also opens the attack vector of picking up "malicious" DLLs from any of the directories that happen to be on PATH.
stax76
20th April 2020, 00:46
Made a test and removed vs from path, staxrip and mpc-be still work but mpv(.net) now cannot open vpy, I think mpv uses lavf to open vpy and the authors of that code are mpv authors.
Removed python from path, both mpc-be and staxrip stopped working... not even vfw based VirtualDub2 can open vpy now.
python and vs are per user installed.
edit:
Maybe part of the problem is that there are different python versions and distributions and setup options, and they use all different reg keys, staxrip finds it with multiple strategies:
https://github.com/staxrip/staxrip/blob/master/General/Package.vb#L2118
https://github.com/staxrip/staxrip/blob/master/General/Package.vb#L2226
But it doesn't even need python, it only verifies it because if staxrip cannot find it then vs will probably also not find it and not work.
Patman
20th April 2020, 21:00
Any idea what is going on with VapourSynth r49? Apparently vspipe.exe (or more specifically vsscript.dll) fails to locate/load the Python DLL.
I also had problems updating to Vapoursynth R49. The following helped me: Vapoursynth R48 / R49 and Python 3.7.x / 3.8.x completely uninstalled (including registration files), install Python 3.8.2 globally for all users (customized installation) and then install Vapoursynth R49 as admin. That should actually work. An update from Python 3.7.x to 3.8.x does not work properly ...
LoRd_MuldeR
20th April 2020, 21:10
I also had problems updating to Vapoursynth R49. The following helped me: Vapoursynth R48 / R49 and Python 3.7.x / 3.8.x completely uninstalled (including registration files), install Python 3.8.2 globally for all users (customized installation) and then install Vapoursynth R49 as admin. That should actually work. An update from Python 3.7.x to 3.8.x does not work properly ...
I have Python 3.8 installed globally, for all users (customized installation).
The problem is that 'vspipe.exe' depends 'vsscript.dll', which in turn depends on 'python38.dll'. The dependency of 'vspipe.exe' to 'vsscript.dll' is no problem at all, as they both reside in the same directory (VapurSynth install directory). However, the 'python38.dll' resides in the separate Python 3.8 install directory, which can not be assumed to be on PATH, or any other directory that Windows searches for DLLs by default.
Now, there actually is code in the vsscript_init() function in 'vsscript.dll' that will determine the path of Python from the registry and explicitly load 'python38.dll' via LoadLibraryEx() function. Unfortunately, starting with VapourSynth r49, we don't even get to that point! There now seems to be a "static" dependency of 'vsscript.dll' to 'python38.dll', so that the Windows loader fails to load/run the 'vspipe.exe' at all...
VapourSynth r48:
https://i.imgur.com/hFncIQa.png
VapourSynth r49:
https://i.imgur.com/bawwzCx.png
Myrsloik
20th April 2020, 21:25
I have Python 3.8 installed globally, for all users (customized installation).
The problem is that 'vspipe.exe' depends 'vsscript.dll', which in turn depends on 'python38.dll'. The dependency of 'vspipe.exe' to 'vsscript.dll' is no problem at all, as they both reside in the same directory (VapurSynth install directory). However, the 'python38.dll' resides in the separate Python 3.8 install directory, which can not be assumed to be on PATH, or any other directory that Windows searches for DLLs by default.
Now, there actually is code in the vsscript_init() function in 'vsscript.dll' that will determine the path of Python from the registry and explicitly load 'python38.dll' via LoadLibraryEx() function. Unfortunately, starting with VapourSynth r49, we don't even get to that point! There now seems to be a "static" dependency of 'vsscript.dll' to 'python38.dll', so that the Windows loader fails to load/run the 'vspipe.exe' at all...
Never mind. Forgot to change the linker flag to delay load python38.dll instead of the 37 one. Expect R50 to be release within a week with some other mixed fixes.
Patman
20th April 2020, 21:37
I have Python 3.8 installed globally, for all users (customized installation).
The problem is that 'vspipe.exe' depends 'vsscript.dll', which in turn depends on 'python38.dll'. The dependency of 'vspipe.exe' to 'vsscript.dll' is no problem at all, as they both reside in the same directory (VapurSynth install directory). However, the 'python38.dll' resides in the separate Python 3.8 install directory, which can not be assumed to be on PATH, or any other directory that Windows searches for DLLs by default.
Now, there actually is code in the vsscript_init() function in 'vsscript.dll' that will determine the path of Python from the registry and explicitly load 'python38.dll' via LoadLibraryEx() function. Unfortunately, starting with VapourSynth r49, we don't even get to that point! There now seems to be a "static" dependency of 'vsscript.dll' to 'python38.dll', so that the Windows loader fails to load/run the 'vspipe.exe' at all...
Yes you are right. I tested it again and if you don't add Python to the path, vspipe will return a bug like yours. You have to pay attention to the little things ;) :thanks:
LoRd_MuldeR
20th April 2020, 23:28
Never mind. Forgot to change the linker flag to delay load python38.dll instead of the 37 one. Expect R50 to be release within a week with some other mixed fixes.
:thanks:
feisty2
21st April 2020, 19:39
if a python function is passed to a filter as an argument, and is invoked in the filter via callFunc, is the return value of the function always associated with "val" key in the output map? what happens if the python function returns multiple values, especially multiple values of different types?
Myrsloik
21st April 2020, 21:30
if a python function is passed to a filter as an argument, and is invoked in the filter via callFunc, is the return value of the function always associated with "val" key in the output map? what happens if the python function returns multiple values, especially multiple values of different types?
It has to follow the required form of the function as specified by the filter you pass it to. The return value always has to be convertible to a VSMap or callFunc fails so returning different types isn't possible.
lansing
25th April 2020, 03:28
What is the fastest way to create a video with a still image? Something like with blankclip where we can specify the length and frame rate of the clip?
Lypheo
25th April 2020, 11:49
If I’m getting this right and you want to extend a single frame clip by repetition, just use the * operator, e.g.: src = core.imwri.Read(…) * 10000
_Al_
25th April 2020, 23:27
or to assume desired frame rate if needed, but it might be specified by imwri, don't know now
src = core.std.AssumeFPS(clip=src, fpsnum=30000, fpsden=1001)
but I think you know that,
Not sure what would be another way to load an image in a simple manner. Like using numpy and opencv or PIL together with ModifyFrame and placeholder clip (attribute clip). That seems like much longer procedure (for RGB image).
lansing
25th April 2020, 23:55
If I’m getting this right and you want to extend a single frame clip by repetition, just use the * operator, e.g.: src = core.imwri.Read(…) * 10000
Thanks, this solution seems good enough
Myrsloik
26th April 2020, 21:39
R50-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R50-RC1). It's a pure bugfix release so if you use R48 or R49 you should definitely give it a try.
r50:
updated zimg to latest v2.9 so grayscale colorspace are supported
fixed crash in textfilter line wrapping introduced in r49 (sekrit-twc)
fixed regression introduced in r48 where 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
tuanden0
27th April 2020, 17:09
R50-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R50-RC1). It's a pure bugfix release so if you use R48 or R49 you should definitely give it a try.
r50:
updated zimg to latest v2.9 so grayscale colorspace are supported
fixed crash in textfilter line wrapping introduced in r49 (sekrit-twc)
fixed regression introduced in r48 where 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
It still show R49 instead of 50
→ C:\Users\Home› vspipe --version
VapourSynth Video Processing Library
Copyright (c) 2012-2020 Fredrik Mellbin
Core R49
API R3.6
Options: -
HuBandiT
1st May 2020, 19:20
Greetings,
I noticed that when I AverageFrames() a clip in vs.RGBS format, when weights[] is longer than the documented - but not enforced - maximum of 31, AverageFrames() darkens the result - the longer weights[] is, the more darkening.
I am on x86.
Looking at the source I see averageFramesFloatSSE2() computes the weighted sum of only 31 frames, but then - incorrectly - multiplies the result with the scale computed for the entire weights[] array.
Desired result #1 (preferred): allow arbitrary length averaging. (I hope for this, because this is the only codepath where I saw this 31 hardcoded - the others might actually allow unlimited?)
Desired result #2 (not preferred): prevent incorrect usage by giving a hard error message
Rationale: I am working on modernizing "talking head" type of instructional videos from DVD MPEG-2, with lots of static background (for minutes), where it would not be unreasonable to frame average the background areas over 5-10 seconds to attempt to average out camera photon noise distorted by MPEG-2. The source is 50i PAL, I deinterlace it to 50p, then comes the noise reduction. But 31 frames is limiting, since at 50p coming from 50i it is about 15-16 original interlaced frames, which is about the length of a single GOP so this precludes me from averaging over GOPs, also it is only about 0.6 seconds. When I diff the resulting frames, even truncated to 8 bit depth, I still have too many artifacts.
Thank you in advance. VapourSynth is awesome.
PS: For this type of filtering, I always use "weights = [1] * number", so a performance optimization could be to omit the multiplications when all the weights are equal and factor them into the scaler.
Myrsloik
1st May 2020, 19:49
Greetings,
I noticed that when I AverageFrames() a clip in vs.RGBS format, when weights[] is longer than the documented - but not enforced - maximum of 31, AverageFrames() darkens the result - the longer weights[] is, the more darkening.
I am on x86.
Looking at the source I see averageFramesFloatSSE2() computes the weighted sum of only 31 frames, but then - incorrectly - multiplies the result with the scale computed for the entire weights[] array.
Desired result #1 (preferred): allow arbitrary length averaging. (I hope for this, because this is the only codepath where I saw this 31 hardcoded - the others might actually allow unlimited?)
Desired result #2 (not preferred): prevent incorrect usage by giving a hard error message
Rationale: I am working on modernizing "talking head" type of instructional videos from DVD MPEG-2, with lots of static background (for minutes), where it would not be unreasonable to frame average the background areas over 5-10 seconds to attempt to average out camera photon noise distorted by MPEG-2. The source is 50i PAL, I deinterlace it to 50p, then comes the noise reduction. But 31 frames is limiting, since at 50p coming from 50i it is about 15-16 original interlaced frames, which is about the length of a single GOP so this precludes me from averaging over GOPs, also it is only about 0.6 seconds. When I diff the resulting frames, even truncated to 8 bit depth, I still have too many artifacts.
Thank you in advance. VapourSynth is awesome.
PS: For this type of filtering, I always use "weights = [1] * number", so a performance optimization could be to omit the multiplications when all the weights are equal and factor them into the scaler.
Doh, found the typo in the weights check so please verify that it's really fixed in the next RC.
Arbitrary length averaging will never be supported because for float you'll at some point accumulate a huge rounding error or for integer formats you'll overflow.
If you need longer averaging you can simply do something like clip.misc.AverageFrames(weights=[1]*31)[::31].misc.AverageFrames(weights=[1]*31)
The multiply is probably so fast it doesn't matter compared to all the memory access.
HuBandiT
1st May 2020, 21:37
Doh, found the typo in the weights check so please verify that it's really fixed in the next RC.
Thank you, will do.
Arbitrary length averaging will never be supported because for float you'll at some point accumulate a huge rounding error or for integer formats you'll overflow.
Indeed, I did not actually mean "arbitrary". But maybe a higher than the current 31 frame limit then? At least for higher precision formats? Maybe set the limit based on some analysis of the numerical precision of the format chosen? 32 bit float RGBS has a 24 bit significand. Reserving two bits from those 24 for the 4.5 multiplier near the foot of rec.601/rec.709, I have about 22 bits of linear precision left. So when I target rec.709 YUV420P8, YUV420P10 or YUV420P12, I have 22-8=14, 22-10=12, 22-12=10 bits of headroom in precision before rounding errors show up in the output; it seems that even in the worst case I could use those bits to average 2^14=16384, 2^12=4096 and 2^10=1024 frames respectively? The current 31 frame limit limits me to use only 5 of those extra bits meaningfully, leaving me with 9, 7 and 5 "unusable" bits of headroom.
The multiply is probably so fast it doesn't matter compared to all the memory access.
The very point is reducing memory access: if all the weights are the same (and with integer formats - although it probably will also work just well enough with floats on real material), you could simply update the running average by subtracting the sample falling out the window and adding the sample newly entering the window, instead of calculating the entire sum from scratch anew each time; in fact one could just add the difference between the falling out sample and the newly entering sample, to be one small step farther away from overflow. Not frame parallelizable for sure (although it would be parallelizable spatially with frame slices), but it might still end up being a huge win for long averages because of the drastically reduced memory access from O(n) to about O(4): read from 2 source frames, read/modify/store the running average; and should the internal running average use higher precision - say double for float inputs, or 32 bit integer for 16 bit inputs, which might make sense - finally downconverting the running average into the desired output precision. Not great for simplistic benchmarks perhaps, but my hunch is that if there is any meaningfully heavy processing happening after the average, the runtime contribution of the averaging operation will be negligible compared to that. It would be nice to at least have the option.
If you need longer averaging you can simply do something like clip.misc.AverageFrames(weights=[1]*31)[::31].misc.AverageFrames(weights=[1]*31)
Yes, I, too, was pondering a hierarchical approach like this. I'll have think about this, as at first sight I don't think it would give equivalent results. Plus boundary issues (scene detection).
Myrsloik
1st May 2020, 22:33
You do have a point with most things but that's an extremely specialized filter. Feel free to write it.
In regards to the bits of headroom you kinda want a general filter to be able to support equivalent settings for all formats. It simply makes sense for the users. That's why the limit is 31 frames. At some point all the ifs and buts of a filter become too complicated.
HuBandiT
1st May 2020, 23:47
You do have a point with most things but that's an extremely specialized filter. Feel free to write it.
Alright. Pointers to how to write VapourSynth filters in C++ are welcome. Also how to decide on a namespace? Can I piggyback onto an existing namespace, or do I need to pick a separate one?
In regards to the bits of headroom you kinda want a general filter to be able to support equivalent settings for all formats. It simply makes sense for the users. That's why the limit is 31 frames. At some point all the ifs and buts of a filter become too complicated.
I don't think this is conceptually different from, say, the limitations of the crop filters: they do have limitations based on the format: subsampled formats can only be cropped by multiples of the subsampling factors; otherwise things would get difficult - but when there is no subsampling, the limitations don't apply, so not enforced.
feisty2
2nd May 2020, 17:09
Alright. Pointers to how to write VapourSynth filters in C++ are welcome. Also how to decide on a namespace? Can I piggyback onto an existing namespace, or do I need to pick a separate one?
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.
LoRd_MuldeR
2nd May 2020, 21:59
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!
HuBandiT
3rd May 2020, 03:34
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. :D
Myrsloik
3rd May 2020, 20:40
R50-RC2 (https://github.com/vapoursynth/vapoursynth/releases/tag/R50-RC2)
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.
l33tmeatwad
7th May 2020, 05:01
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.
HuBandiT
8th May 2020, 02:21
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?)
Myrsloik
8th May 2020, 07:22
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:
|--------------------|
Myrsloik
8th May 2020, 16:17
R50 is released. Bug fixes only so everyone should update.
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
Boulder
9th May 2020, 10:11
Thank you for the new release :)
Txico
12th May 2020, 00:29
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?
jackoneill
12th May 2020, 17:09
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:
make LIBS="$(python3-config --libs --embed)"
(It has nothing to do with threads.)
Txico
12th May 2020, 17:59
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
14th May 2020, 10:11
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?
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:
$ cat /usr/lib64/python3.6/site-packages/vapoursynth-autoload.pth
/home/youruser/vapoursynth-python-modules
Selur
14th May 2020, 14:21
@Txico: you can also do something like:
# 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?
ChaosKing
16th May 2020, 20:29
Lets talk again about this problem here https://forum.doom9.org/showthread.php?p=1840996#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
https://i.imgur.com/gLvGYsY.gif
I don't think that all 4 plugins are storing temporal state incorrectly.
Example script:
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"
feisty2
18th May 2020, 19:15
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
clips = core.???.filter(...)
#clips[0], clips[1], ...
or
clip1, clip2, ... = core.???.filter(...)
?
2) does audio support break compatibility with the current API? where can I find the audio API?
Myrsloik
18th May 2020, 20:00
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
clips = core.???.filter(...)
#clips[0], clips[1], ...
or
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.
HuBandiT
25th May 2020, 19:34
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.
feisty2
2nd June 2020, 20:20
why does vspipe freeze then crash if I comment out this line (https://github.com/IFeelBloated/vsFilterScript/blob/master/Examples/ModifyFrame.hxx#L7) (which assumes the default multithreading mode, fmParallel (https://github.com/IFeelBloated/vsFilterScript/blob/master/include/Interface.vxx#L36))?
the default multithreading mode however seems to work with vsedit (preview)
Myrsloik
2nd June 2020, 20:34
why does vspipe freeze then crash if I comment out this line (https://github.com/IFeelBloated/vsFilterScript/blob/master/Examples/ModifyFrame.hxx#L7) (which assumes the default multithreading mode, fmParallel (https://github.com/IFeelBloated/vsFilterScript/blob/master/include/Interface.vxx#L36))?
the default multithreading mode however seems to work with vsedit (preview)
Does this require a C++20 comoiler to test?
feisty2
2nd June 2020, 20:42
Does this require a C++20 comoiler to test?
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 (https://github.com/vapoursynth/vapoursynth/blob/master/src/core/simplefilters.c#L1718).
ortoni
3rd June 2020, 10:41
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
Myrsloik
3rd June 2020, 10:52
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
Update to latest master and try again. And specify that it's master you're compiling next time.
ortoni
4th June 2020, 00:31
Update to latest master and try again. And specify that it's master you're compiling next time.
And that did the trick! Thanks for this - and thanks for the all-around majorly awesome VapourSynth project. You, Sir, are a scholar and a gentleman.
ortoni
7th June 2020, 06:26
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
poisondeathray
7th June 2020, 07:05
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
Enclose in square brackets
outclip = core.std.StackVertical([clip,clip,clip,clip])
feisty2
7th June 2020, 19:17
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/vsFilterScript/blob/master/include/Map.vxx#L159
ortoni
7th June 2020, 23:54
Enclose in square brackets
outclip = core.std.StackVertical([clip,clip,clip,clip])
...aaaand thank you! Normal service has resumed :)
Myrsloik
10th June 2020, 09:26
Those of you who are interested in audio support should take a look at the latest audio build and the audio development thread (https://forum.doom9.org/showthread.php?t=177623).
nacho
14th June 2020, 04:18
Hi I need some help.
I have a clip with the property 'Scenechange' added to all frames (by WWXD (https://github.com/dubhater/vapoursynth-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.
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
stax76
15th June 2020, 19:05
Is there maybe something like AviSynth AddAutoloadDir?
ChaosKing
15th June 2020, 19:15
I don't think so but it's easy to make your own Autoloaddir with something like
import glob
plugins = glob.glob(r"C:\plugins64\*.dll")
for plugin in plugins:
try:
vs.core.std.LoadPlugin(plugin)
except:
print("some err")
stax76
15th June 2020, 19:30
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.
lansing
15th June 2020, 19:30
It feels like we should have a database for code snippets for all common tasks so other can just copy and paste. It's a lot easier for them than to start everything from scratch.
stax76
15th June 2020, 19:38
Wasn't an issue for me however since staxrip generally uses manual loading and iterating through DLLs of a directory is not difficult, I had asked because I wanted to know the most efficient solution.
Myrsloik
15th June 2020, 23:51
Is there maybe something like AviSynth AddAutoloadDir?
Nope, I do have plans to let it be overridden some day in the maybe not too distant future.
nacho
16th June 2020, 09:23
@HolyWu Sorry I'm pretty new to python and I don't quite understand the logic. I've run your code and it seems to work.
I would think this:
for n in range(clip.num_frames):
for i in range(-1, 3):
target = n + i
if 0 <= target < clip.num_frames and sc_frame_no.count(target):
label_frame_no.append(n)
if not label_frame_no.count(n):
delete_frame_no.append(n)
should be:
for n in range(clip.num_frames):
for i in range(-2, 2):
target = n + i
if 0 <= target < clip.num_frames and sc_frame_no.count(n):
label_frame_no.append(target)
if not label_frame_no.count(n):
delete_frame_no.append(n)
I thought the inner loop range should make target go from 2 before n to 1 after n: range(-2,2) where does (-1,3) come from? For the next bit I would think we want to check if frame 'n' is in the list of scene changes, and if it is then add the surrounding frames (targets) to the list label_frame_no. I now realise this isn't what you're doing, but can't quite understand what's going on. Edit: Ahh you check every frame if it's within 4 frames of a scene change, rather than finding a scene change and then getting the 4 around it.
Also len(sc_frame_no) prints the total number of scene changes on all the frames. I'd like it to start at 0/1 and increment for each group of 4 frames. Sorry I'm asking you to write code for me but it's very frustrating knowing exactly what I want but not knowing how to implement it.
ortoni
19th June 2020, 00:47
The VS docs say "When mode is “h” or “v”, this must be an array of 3 to 25 numbers, with an odd number of elements."
Does that mean a h-only convolution can accept more than 5 coefficients?
Reason I ask is I'm looking to do a 7-"tap" horizontal convolution.
Can't quite see it from the code since there is a lot of cool SSE and AVX going on!
One other quick question: preferred method to input a clip with alpha channel e.g. Apple Animation or ProRes. AVISynth allowed decoding directly to BGR32 iirc, but VS warns off using this format ;-)
TIA
poisondeathray
19th June 2020, 01:50
One other quick question: preferred method to input a clip with alpha channel e.g. Apple Animation or ProRes. AVISynth allowed decoding directly to BGR32 iirc, but VS warns off using this format ;-)
ffms2 with alpha=True
The clip will be [0] in the native pixel format, and the alpha channel will be [1] as Gray
(Lsmash would be ideal, because MOV does not require indexing, but it does not support alpha channel formats. Maybe HolyWu can add it some time in the future)
Not sure about 7x7 convolution
ortoni
19th June 2020, 05:34
Thx @poisondeathray for the ffms2 solution, I'll give that a whirl.
BTW not looking for square 7x7 convolution, but horizontal 7x1, hence the uncertainty.
Myrsloik
19th June 2020, 10:53
Thx @poisondeathray for the ffms2 solution, I'll give that a whirl.
BTW not looking for square 7x7 convolution, but horizontal 7x1, hence the uncertainty.
Yes, you can do that.
feisty2
19th June 2020, 11:48
I see there're quite some changes in vaporsynth.h in the audio branch
will you make a list of all API changes when the audio development is done?
Myrsloik
19th June 2020, 12:17
I see there're quite some changes in vaporsynth.h in the audio branch
will you make a list of all API changes when the audio development is done?
Yes, I always document things when they're done. The audio API is 99% similar to the video one anyway so anyone who wants to start prototyping things can do so. Look at audiofilters.cpp if you're curious.
ortoni
20th June 2020, 11:20
Another possibly dumb question, apologies in advance!
I'm trying to present the R channel of an RGB clip to a plugin which is YUV/Y only.
But core.std.ShufflePlanes(clips=[RGBclip], planes=[0], colorfamily=vs.GRAY) gives a "Resize error 1026: GREY color family cannot have RGB matrix coefficients".
I wasn't expecting that since it looked like ShufflePlanes was kinda designed to do this with minimal error checking. Switching to colorfamily=vs.YUV gives "YUV color family cannot..."
Is there any way around this?
Thx
PS adding audio to VS is possibly the greatest thing since sliced bread.
Myrsloik
20th June 2020, 12:23
Another possibly dumb question, apologies in advance!
I'm trying to present the R channel of an RGB clip to a plugin which is YUV/Y only.
But core.std.ShufflePlanes(clips=[RGBclip], planes=[0], colorfamily=vs.GRAY) gives a "Resize error 1026: GREY color family cannot have RGB matrix coefficients".
I wasn't expecting that since it looked like ShufflePlanes was kinda designed to do this with minimal error checking. Switching to colorfamily=vs.YUV gives "YUV color family cannot..."
Is there any way around this?
Thx
PS adding audio to VS is possibly the greatest thing since sliced bread.
You're not getting the error from ShufflePlanes...
You split the plane but it's still got the _matrix and other properties set to ones that correspond to RGB (Gray format is basically equivalent to a Y plane) so you need to remove/correctly set the _matrix property before resizing.
poisondeathray
20th June 2020, 17:15
Is it possible to get a single vspipe instance to send 2 streams, video and audio , index 0 and 1 or whatever number ?
Myrsloik
20th June 2020, 21:29
Is it possible to get a single vspipe instance to send 2 streams, video and audio , index 0 and 1 or whatever number ?
No. That'd require vspipe to mux the streams into some more complex container and that's a pain in the ass.
Pat357
21st June 2020, 20:36
The VS docs say "When mode is “h” or “v”, this must be an array of 3 to 25 numbers, with an odd number of elements."
Does that mean a h-only convolution can accept more than 5 coefficients?
Reason I ask is I'm looking to do a 7-"tap" horizontal convolution.
Can't quite see it from the code since there is a lot of cool SSE and AVX going on!
One other quick question: preferred method to input a clip with alpha channel e.g. Apple Animation or ProRes. AVISynth allowed decoding directly to BGR32 iirc, but VS warns off using this format ;-)
TIA
As I understand it, both "v" mode and "h" mode can do up to 25 elements, meaning the pixel itself and up to 12 neighbor pixels in both directions from the same row/column.
The "s" mode is limited to a 3x3 or a 5x5 matrix : 7x7 matrix for example will not work.
I guess you need the "h" mode with 7 or 15 elements depending how you count your tabs.
When you say 7 tabs, do you mean using 7 pixels left from the center pixel and 7 right from the center pixel or just 7 pixels in total (= 3 left + center + 3 right) ??
Anyway both 7 and 15 would fit for v/h mode.
LigH
22nd June 2020, 06:56
7 taps (interpolation points) means the actual pixel + 3 in each direction, 7 in total.
As far as I understand the documentation, specifying a horizontal-only kernel works just as assumed.
lansing
27th June 2020, 06:46
I got the error when installing 32 bit version after double clicking the installer.
"Python 3.8 (32-bit) is installed for the current user only. Run the installer again and select "Install for me only" or install Python for all users.
Update: nvm, I was messing with the Windows' environment variable for python that was causing this, removing it fixed it.
Myrsloik
27th June 2020, 10:37
R51-test1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R51-test1)
Go test it. It has plenty of changes in how python environments are handled to fix rare corner cases. Apart from that it's mostly bugfixes.
r51:
updated visual studio 2019 runtime version
fixed compilation when avs+ master is used
fixed lut and lut2 triggering a fatal error when invalid planes were specified
fixed property append operations on non-empty keys not properly copying the underlying data
fixed wave64 headers generated by avfs
fixed infinite loop in expr with certain expressiosn (sekrit-twc)
fixed crash in averageframes with odd number of clips (sekrit-twc)
scale averageframes for integer chroma by distance from grey (sekrit-twc)
several fixes and improvements regarding handling of the active script environment in python (stuxcrystal)
plugin loading now has better error messages (jackoneill)
using get_core() in python now generates a deprecation warning since it's been deprecated for years
DJATOM
27th June 2020, 10:49
So audio will not make it into r51. That's kinda sad
Myrsloik
27th June 2020, 11:33
So audio will not make it into r51. That's kinda sad
You can always use the audio releases if you don't mind the bugs and lack of testing. 100% compatibility with existing scripts is retained but it's simply a bit too untested and missing a few things too many for me to unleash it on the public.
At this point you should consider the master branch (normal releases) as the stable branch with mostly bugfixes. All major development happens in the doodle1 branch (audio support, major code cleanups and and a major api revision). I expect everyone to slowly migrate over time when they feel it's worth it.
It's now been almost 8 years since the first public release and some of the original mistakes and quirks definitely should be fixed.
DJATOM
27th June 2020, 12:04
Btw audioSplice is kind of broken. I tried to figure it out and seems https://github.com/DJATOM/vapoursynth/commit/dfbd1e9ed84febf9af593a1bbedc0ba8c53cef49 fixes it, but at some conditions it now silently crashes. I'm busy with work now and can't debug deeper.
Myrsloik
27th June 2020, 14:22
Btw audioSplice is kind of broken. I tried to figure it out and seems https://github.com/DJATOM/vapoursynth/commit/dfbd1e9ed84febf9af593a1bbedc0ba8c53cef49 fixes it, but at some conditions it now silently crashes. I'm busy with work now and can't debug deeper.
Must only happen with specific combinations of clips merged. I need to know the exact format and length you made it crash with. You're right that reqStartOffset is set in the wrong place and I've fixed that.
vcmohan
28th June 2020, 07:26
You can always use the audio releases if you don't mind the bugs and lack of testing. 100% compatibility with existing scripts is retained but it's simply a bit too untested and missing a few things too many for me to unleash it on the public.
At this point you should consider the master branch (normal releases) as the stable branch with mostly bugfixes. All major development happens in the doodle1 branch (audio support, major code cleanups and and a major api revision). I expect everyone to slowly migrate over time when they feel it's worth it.
It's now been almost 8 years since the first public release and some of the original mistakes and quirks definitely should be fixed. I have developed some plugins for Vapoursynth back in 2014. There after I have been using avisynth+ upto 2017. Recently I got a push from a youngster to upgrade to latest versions. I completed for avisynth+ and want to utilize my free time during the present lock down by upgrading for vapoursynth. It appears a lot of changes happened since then. Request guidance as to which version I should start and link to get the new header files. Also I may try for your almost ready to release version.
Pat357
28th June 2020, 18:29
It seems that the latest audio-enabled version from VS (VapourSynth64-Portable-R51-audio-test4) has broken adding -w or --w64 headers to the output.
vspipe -w myaudio.vpy - | ffplay -i pipe:
does work for the previous VapourSynth64-Portable-audio-test3 (song plays), but is broken again in test4 (invalid/corrupted input reported reported by ffplay).
vspipe --wav myaudio.vpy - | ffplay -i pipe: plays both in test3 and test4.
So WAV header added by --wav still works ok with test4.
Also with test4 :
vspipe -w myaudio.vpy test.w64 (and)
vspipe --w64 myaudio.vpy test.w64
The resulting test.w64 can not be played by any w64 aware player like Foobar, MPV, VLC, FFplay : all players report an invalid/corrupted file.
These also work perfect with test3 : all above players played the resulting test.w64 perfectly
Myrsloik
28th June 2020, 23:51
I have developed some plugins for Vapoursynth back in 2014. There after I have been using avisynth+ upto 2017. Recently I got a push from a youngster to upgrade to latest versions. I completed for avisynth+ and want to utilize my free time during the present lock down by upgrading for vapoursynth. It appears a lot of changes happened since then. Request guidance as to which version I should start and link to get the new header files. Also I may try for your almost ready to release version.
Not much has changed, really. The API is the same and no real changes have happened. The latest headers are included (select the SDK option in the installer). Always use the latest release.
tebasuna51
29th June 2020, 00:52
The length of the 'fmt' Subchunk is wrong and the Subchunk 'data' is not found, the same w64 with previous version:
ChunkID .....: riff ChunkID .....: riff
RiffLength ..: 13824128 RiffLength ..: 13824128
Container ...: wave Container ...: wave
SubchunkID ..: fmt (Length: 40) SubchunkID ..: fmt (Length: 32) <--------
AudioFormat .: 65534 (WAVE_FORMAT_EXTENSIBLE) AudioFormat .: 65534 (WAVE_FORMAT_EXTENSIBLE)
NumChannels .: 6 NumChannels .: 6
SampleRate ..: 48000 SampleRate ..: 48000
ByteRate ....: 1152000 ByteRate ....: 1152000
BlockAlign ..: 24 BlockAlign ..: 24
BitsPerSample: 32 BitsPerSample: 32
ValidBitsPS .: 32 ValidBitsPS .: 32
MaskChannels : 63 (FL FR FC LF BL BR) MaskChannels : 63 (FL FR FC LF BL BR)
SubType .....: 3 (Float) SubType .....: 3 (Float)
SubchunkID ..: data (Length: 13824000) SubchunkID ..: ? <--------
Offset data .: 128
Duration ....: 12 sec., (0h. 0m. 12s.)
Pat357
29th June 2020, 19:04
@tebasuna51 : What tool did you use to retrieve the info you posted from an audio file ? Seems extremely useful with detailed output. Is it public available ?
It's a bit strange that the previous version you say also causes missing info in the w64 header, while om my system ffmpeg was able to play the files. :confused::confused:
What version do you mean by the previous version ? Can you state the date stamps from for example Vspipe ?
The version that worked for me was VapourSynth64-Portable-R50-audio3 compiled on 16/06/2020.
I believe VapourSynth64-Portable-R50-audio3 has been updated without changing the filename or download location, so it could be that I have a different "previous" version than you...
Can you try if the following simple commands work on your previous version ?
vspipe -w myaudio.vpy - | ffplay -i pipe:
vspipe --w64 myaudio.vpy - | ffplay -i pipe:
myaudio.vpy is in fact just a 2-liner :
import vapoursynth as vs
from vapoursynth import core
a1 = core.bas.Source(r"d:\test\audio\samples\mp3\Mena1.mp3", track=-1)
a1.set_output()
All the above works for me when I use the 16/06/2020 version, but is broken in the newest test4 with compile date 27/06/2020.
tebasuna51
29th June 2020, 21:44
@tebasuna51 : What tool did you use to retrieve the info you posted from an audio file ? Seems extremely useful with detailed output. Is it public available ?
Is a very old tool (https://forum.doom9.org/showthread.php?p=1522330#post1522330) than I make long time ago.
It's a bit strange that the previous version you say also causes missing info in the w64 header, while om my system ffmpeg was able to play the files.
Don't worry about old versions, the next one was the better.
In a previous version the headers are 'simple', corrects but without the channelmask info than offer the 'WAVE_FORMAT_EXTENSIBLE' headers.
vcmohan
2nd July 2020, 13:48
Not much has changed, really. The API is the same and no real changes have happened. The latest headers are included (select the SDK option in the installer). Always use the latest release.
In RGB packed samples supported by avisynth the left bottom corner is the 0,0 coordinate. In the RGB24 format of vapoursynth where is this 0,0 ? I am finding in one of my plugins it to be Left Top corner, but in another Left Bottom. My code must be wrong in one of the cases. Request clarify.
feisty2
2nd July 2020, 13:54
vaporsynth plugins do not support packed formats, packed formats are only there for compatibility with avisynth plugins.
Myrsloik
2nd July 2020, 14:12
In RGB packed samples supported by avisynth the left bottom corner is the 0,0 coordinate. In the RGB24 format of vapoursynth where is this 0,0 ? I am finding in one of my plugins it to be Left Top corner, but in another Left Bottom. My code must be wrong in one of the cases. Request clarify.
In planar RGB 0,0 is always the top left corner, just like for YUV.
feisty2
4th July 2020, 04:33
how do I materialize a vpy script that outputs RGB30 using ffmpeg? I'd like to encode the vpy output to r210 (uncompressed 10bpc RGB) with ffmpeg and the y4m tool does not support RGB streams.
stax76
4th July 2020, 11:18
this works here:
ffmpeg -f vapoursynth -i aaa.vpy -c:v r210 aaa.mov
feisty2
4th July 2020, 13:08
where can I find this ffmpeg with vaporsynth extension?
stax76
4th July 2020, 13:36
You can find it in the Apps dialog of staxrip, it provides web, help and download URLs, in many cases it shows a mediafire folder of Patman:
https://www.mediafire.com/folder/vkt2ckzjvt0qf/StaxRip_Tools
poisondeathray
4th July 2020, 17:31
Alternatively, vspipe supports rawvideo . (In ffmpeg, gbrp10le for RGB30)
eg
vspipe RGB30.vpy - | ffmpeg -f rawvideo -pix_fmt gbrp10le -r (framerate) -s (width)x(height) -i - -c:v r210 output_r210.mov
Also you can set up the media-autobuild suite to compile ffmpeg for you, including all the codecs and features you need. Even combinations of licenses which may not be distributed in public.
vcmohan
13th July 2020, 12:54
I have as input 2 clips A and B. My output C has a copy of B as base on which some new pixels are drawn. I have following questions.
1. Can I specify (ret, B = ret,...) as input string when I want the A clip also be the base for my C. Should I test if they are same and set up a flag for ArInitial, or not required? Can I specify B to be opt and if not specified make it same as ret?
2. If I need to set up a flag then can the arInitial be
// Request the source frame on the first call
vsapi->requestFrameFilter(n, d->node[0], frameCtx);
if( clipsNotSame)
vsapi->requestFrameFilter(n, d->node[1], frameCtx);
Is such construct allowed? Or there is no need to have if statement?
3. In all frames ready section should I use
if(clipsNotSame){
bkg = vsapi->getFrameFilter(n, d->node[1], frameCtx);
i
VSFrameRef *dst = vsapi->copyFrame(bkg, core);
}
else
VSFrameRef *dst = vsapi->newVideoFrame(fi, width, height, src, core);
4. out of 2 methods getting new video frame and copying with bltbit ior using copyFrame, which is preferable?
Myrsloik
13th July 2020, 14:07
I have as input 2 clips A and B. My output C has a copy of B as base on which some new pixels are drawn. I have following questions.
1. Can I specify (ret, B = ret,...) as input string when I want the A clip also be the base for my C. Should I test if they are same and set up a flag for ArInitial, or not required? Can I specify B to be opt and if not specified make it same as ret?
2. If I need to set up a flag then can the arInitial be
// Request the source frame on the first call
vsapi->requestFrameFilter(n, d->node[0], frameCtx);
if( clipsNotSame)
vsapi->requestFrameFilter(n, d->node[1], frameCtx);
Is such construct allowed? Or there is no need to have if statement?
3. In all frames ready section should I use
if(clipsNotSame){
bkg = vsapi->getFrameFilter(n, d->node[1], frameCtx);
i
VSFrameRef *dst = vsapi->copyFrame(bkg, core);
}
else
VSFrameRef *dst = vsapi->newVideoFrame(fi, width, height, src, core);
4. out of 2 methods getting new video frame and copying with bltbit ior using copyFrame, which is preferable?
1. You mean that you have a function that takes two clips and want to see if they're identical? There's no way to compare clips for equality since the pointers are only a reference object and can (and most likely will) be different for the same clip. The most correct way to solve it is to mark the clip B argument as optional and only use clip A. Argument list:
"clipa:clip;clipb:clip:opt;"
2. It's harmless to request the same frame from the same clip twice. If you know it's the same clip it's still slightly faster to avoid doing it tough.
3. Yes, that works.
4. copyFrame, it will always copy the minimal amount of data using an effective method if you're only going to modify a small portion of the frame.
vcmohan
14th July 2020, 07:17
Thanks. Being a novice coder, I use with avisynth the ThrowError mssage having printf format for debugging. For vapoursynth for debugging in the areAllFramesReady section what messaging code should I use so that I can see some values on screen?
Exaris
15th July 2020, 22:48
I am getting a "Failed to initialize VapourSynth" error whenever I try to use it. Where can I get a more verbose log?
Vapoursynth: VapourSynth 64bit (R50 final)
Frontend: StaxRip (2.1.3.0)
Python: Python 3.8.4 64bit (build 3.8.4150.1013)
OS: Windows 10 Pro 1909 64bit (build 18363.836)
Best available "log":
------------------------ Error opening source ------------------------
Failed to initialize VapourSynth
import os, sys
import vapoursynth as vs
core = vs.get_core()
sys.path.append(r"C:\Users\Dante\Desktop\Random\Util\StaxRip-2.1.3.0\Apps\Plugins\VS\Scripts")
core.std.LoadPlugin(r"C:\Users\Dante\Desktop\Random\Util\StaxRip-2.1.3.0\Apps\Support\DGDecodeNV\DGDecodeNV.dll")
clip = core.dgdecodenv.DGSource(r"G:\2020-07-14 17-14-06_temp\2020-07-14 17-14-06.dgi")
clip.set_output()
P.S. This crash occurs with any source (LibavSMASHSource/LWLibavsource/DGDecodeNV)
stax76
16th July 2020, 01:17
This message shows when vsscript_init fails which probably means that vapoursynth does generally not work.
Is VapourSynth is installed, for all or current user, in which location?
Portable mode is disabled in the staxrip settings? (it's enabled by default)
Does the script open in other apps such as VirtualDub2, MPC-BE or VapourSynth Editor?
Exaris
16th July 2020, 01:53
I've uninstalled Vapoursynth and enabled the use of the portable version but the problem persists.
If by "the script" you mean the .vpy file in the _temp folder then yes, MPC-BE plays it just fine.
stax76
16th July 2020, 11:44
The VapourSynth docs on vsscript_init:
This function will only fail if the VapourSynth installation is broken in some way.
Please try the last Beta StaxRip 2.1.3.7.
If portable mode is enabled in the settings then the paths in the Apps dialog for VapourSynth and Python should both point to Apps\FrameServer\VapourSynth.
Maybe just a runtime is missing, here is an all-in-one package:
https://github.com/abbodi1406/vcredist/releases/tag/v0.33.0
Exaris
16th July 2020, 18:46
I've just tried the beta, same problem.
Portable mode is enabled and pointing to Apps\FrameServer\VapourSynth.
I installed that repack and its still not working.
Also MPC-BE plays the .vpy in _temp perfectly as well.
Myrsloik
20th July 2020, 14:51
I'm not dead, just working on the next big api version. Proper graph dumping included.
https://www.dropbox.com/s/k6m0uxfy9lnn4j6/graphviz.svg?dl=0
vcmohan
21st July 2020, 07:49
In one of the functions of my plugin I return a frame of same input format but having different width and height, as in stack horizontal or any resize filter. I get a new frame of these dimensions, but I think I should not return this as subsequent filters will be unaware. Where can I look at the source code of resize to learn the coding required. As vi is a const I am prevented to change it.
Myrsloik
21st July 2020, 08:04
In one of the functions of my plugin I return a frame of same input format but having different width and height, as in stack horizontal or any resize filter. I get a new frame of these dimensions, but I think I should not return this as subsequent filters will be unaware. Where can I look at the source code of resize to learn the coding required. As vi is a const I am prevented to change it.
It's only the vi of existing clips that's const. You can create a copy and modify it any way you want like in the stackhorizontal/vertical filter.
https://github.com/vapoursynth/vapoursynth/blob/master/src/core/simplefilters.c#L1143
Myrsloik
23rd July 2020, 16:13
Usage question of the day:
Does anyone actually use the --start and --end arguments of vspipe?
DJATOM
23rd July 2020, 18:15
Yes, but rare. It was good for partial renders when I was lazy to copy script with different trims and just made a list of commands with different -s -e options and output names.
zorr
23rd July 2020, 20:31
Usage question of the day:
Does anyone actually use the --start and --end arguments of vspipe?
Yes. I need them on some scripts which are not utilizing the cores efficiently. So I split the clip into ranges and run them simultaneously and combine the parts in the end. This can be up to 12 times faster than running the script as is (Ryzen 3900X).
stax76
23rd July 2020, 21:19
Does anyone actually use the --start and --end arguments of vspipe?
The chunk encoding feature of staxrip uses it.
https://staxrip.readthedocs.io/usage.html#chunk-encoding
ChaosKing
23rd July 2020, 22:10
I use it sometimes too.
vcmohan
24th July 2020, 08:15
Is there an equivalent of avisynth scriptclip in vapoursynth? How does one get current frame number in scripting?
ChaosKing
24th July 2020, 09:59
Is there an equivalent of avisynth scriptclip in vapoursynth? How does one get current frame number in scripting?
http://www.vapoursynth.com/doc/functions/frameeval.html
import functools
def MyFunc(n, c):
if (n % 2) == 0:
return c.text.Text("Frame: " + str(n))
else:
return c.text.Text("Frame: " + str(n)).text.Text("\nThats odd...")
clip = core.std.FrameEval(clip, functools.partial(MyFunc, c=clip))
Myrsloik
24th July 2020, 10:53
You have successfully saved the --start and --end arguments then.
Now for the new vspipe experiment of the day. How many of your scripts would break if --preserve-cwd was made the default option?
ChaosKing
24th July 2020, 11:14
Looks like zero breaks for me.
zorr
24th July 2020, 17:06
Couldn't find anything with --preserve-cwd. What is it?
ChaosKing
24th July 2020, 17:21
cwd = current working dir
Myrsloik
26th July 2020, 11:47
R51-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R51-RC1)
This should be a quick release process. Only bug fixes this time (and probably forever until the glorious audio branch is ready)
r51:
updated visual studio 2019 runtime version
fixed an extremely rare threading issue only affecting fmparallelrequests filters and arframeready events
fixed compilation when avs+ master is used
fixed lut and lut2 triggering a fatal error when invalid planes were specified
fixed property append operations on non-empty keys not properly copying the underlying data
fixed wave64 headers generated by avfs
fixed crash in averageframes with odd number of clips (sekrit-twc)
scale averageframes for integer chroma by distance from grey (sekrit-twc)
several fixes and improvements regarding handling of the active script environment in python (stuxcrystal)
plugin loading now has better error messages (jackoneill)
using get_core() in python now generates a deprecation warning since it's been deprecated for years
feisty2
27th July 2020, 05:54
r51:
using get_core() in python now generates a deprecation warning since it's been deprecated for years
how do I specify constants like vs.GRAY or vs.RGB if I switch
import vapoursynth as vs
core = vs.get_core()
to
from vapoursynth import core
?
ChaosKing
27th July 2020, 07:12
You can use this from vapoursynth import core, YUV, GRAY and then use just GRAY instead of vs.GRAY
OR
use core = vs.core instead of core = vs.get_core()
EDIT
whoops I was too slow :)
feisty2
28th July 2020, 02:55
is there any filter that actually uses VSActivationReason::arFrameReady and queryCompletedFrame()? I haven't been able to find any example for this
Myrsloik
28th July 2020, 06:52
is there any filter that actually uses VSActivationReason::arFrameReady and queryCompletedFrame()? I haven't been able to find any example for this
Not that I know of. I'm thinking about removing it completely for the next api revision since I couldn't think of a single useful filter that needs it.
QueryCompletedFrame is also half broken...
Myrsloik
28th July 2020, 19:53
R51-RC2 (https://github.com/vapoursynth/vapoursynth/releases/tag/R51-RC2)
Found a few more trivially fixable bugs when developing the glorious new branch. So here's another RC. If you have far too much time on your hands you could compare the speed and memory usage with R50.
Changes
r51:
updated visual studio 2019 runtime version
fixed a cache shrinking issue
fixed a crash when removing a message handler without a free function
fixed an extremely rare threading issue only affecting fmparallelrequests filters and arframeready events
fixed compilation when avs+ master is used
fixed lut and lut2 triggering a fatal error when invalid planes were specified
fixed property append operations on non-empty keys not properly copying the underlying data
fixed wave64 headers generated by avfs
fixed crash in averageframes with odd number of clips (sekrit-twc)
scale averageframes for integer chroma by distance from grey (sekrit-twc)
several fixes and improvements regarding handling of the active script environment in python (stuxcrystal)
plugin loading now has better error messages (jackoneill)
using get_core() in python now generates a deprecation warning since it's been deprecated for years
HuBandiT
29th July 2020, 14:03
is there any filter that actually uses VSActivationReason::arFrameReady and queryCompletedFrame()? I haven't been able to find any example for this
Not that I know of. I'm thinking about removing it completely for the next api revision since I couldn't think of a single useful filter that needs it.
QueryCompletedFrame is also half broken...
A few years ago there was talk about potentially getting GPUs involved into VS and VS filters, at which point it might suddenly make sense to hide RAM->GPU transfer latencies by initiating transfer of each individual incoming frame as soon as it becomes available (arFrameReady), instead of initiating transfer of all frames in one large batch (arAllFramesReady). The same would hold in the hypothetical case of writing a multi-node distribution layer for VS (think renderfarm for video filtering).
Myrsloik
29th July 2020, 14:17
A few years ago there was talk about potentially getting GPUs involved into VS and VS filters, at which point it might suddenly make sense to hide RAM->GPU transfer latencies by initiating transfer of each individual incoming frame as soon as it becomes available (arFrameReady), instead of initiating transfer of all frames in one large batch (arAllFramesReady).
GPUs are kinda dead in this space. You can get 64 cores in a single socket UMA configuration for almost nothing now. I plan to focus on making things run as well as possible with many threads.
You also don't need arFrameReady events unless your filter implementation is a monolithic monstrosity. Have a separate filter to do transfers to the GPU an one after processing to transfer back if needed. That's more or less how I'd handle GPU support if I ever officially added it anyway.
HuBandiT
29th July 2020, 20:43
Purely academic as I agree it is not worth pursuing this for now:
GPUs are kinda dead in this space. You can get 64 cores in a single socket UMA configuration for almost nothing now. I plan to focus on making things run as well as possible with many threads.
Processing paralellism (cores) yes - but memory paralellism...? Plus you do tie up your CPUs while leaving your GPUs idle, which might be a factor for certain workloads.
You also don't need arFrameReady events unless your filter implementation is a monolithic monstrosity. Have a separate filter to do transfers to the GPU an one after processing to transfer back if needed. That's more or less how I'd handle GPU support if I ever officially added it anyway.
For a very forward-looking discussion: OpenCV went through similar CPU memory <-> GPU memory teething pains some years back, and as I recall, they decided to go for making the core (built-in) image structure/class/type/object aware of in which memory domain (CPU or GPU - and for that matter, which GPU if there are several) it currently resides on or has copies in, and having both CPU and GPU versions of most built-in filters, so that transfers between memory domains could be elided in many cases. (Not sure how far they went on optimizing those filter graphs, whether that was statically decided by the programmer, or dynamically optimized during runtime, etc.)
Myrsloik
29th July 2020, 22:44
CPUs with more cores have more memory channels and bandwidth too. Unless it's a crippled server cpu being sold to enthusiasts.
The current filter model of operating on whole frames is also very memory bandwidth inefficient. Adding support for filters that work per scanline/tile will allow for huge improvements since then L3 and L2 cache speed would be the limit and not ram.
It's it's the curse of having a simple and developer friendly filter model.
Writing two versions of filters, even the basic ones, is unsustainable for a project of this size. And I don't only mean in terms of development time but also the number of users that test things. It would most likely constantly end up broken.
Cary Knoop
29th July 2020, 23:07
CPUs with more cores have more memory channels and bandwidth too. Unless it's a crippled server cpu being sold to enthusiasts.
The current filter model of operating on whole frames is also very memory bandwidth inefficient. Adding support for filters that work per scanline/tile will allow for huge improvements since then L3 and L2 cache speed would be the limit and not ram.
It's it's the curse of having a simple and developer friendly filter model.
Writing two versions of filters, even the basic ones, is unsustainable for a project of this size. And I don't only mean in terms of development time but also the number of users that test things. It would most likely constantly end up broken.
Or, have an interface that allows CUDA filters using a CUDA source file that gets compiled on Vapoursynth invocation?
DaVinci Resolve uses this model, you can write a CUDA file with a given interface like so:
__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, __TEXTURE__ p_TexR, __TEXTURE__ p_TexG, __TEXTURE__ p_TexB)
{
float3 x = make_float3(_tex2D(p_TexR, p_X, p_Y),
_tex2D(p_TexG, p_X, p_Y),
_tex2D(p_TexB, p_X, p_Y));
// Do something here with a 3-pixel:
x.x += x.x + 0.1f;
return x;
}
A more fancy extension would be to have a prior and next frame pointer as well.
Myrsloik
29th July 2020, 23:13
Achooo
I'm allergic to proprietary crap
Cary Knoop
29th July 2020, 23:15
Achooo
I'm allergic to proprietary crap
Then use OpenCL.
I think having such an interface would be a great addition to Vapoursynth. And once you have the inferface spec one could write other adapters like for CUDA or other GPU languages.
HuBandiT
31st July 2020, 00:20
The current filter model of operating on whole frames is also very memory bandwidth inefficient. Adding support for filters that work per scanline/tile will allow for huge improvements since then L3 and L2 cache speed would be the limit and not ram.
Amen! One day perhaps the JIT in VS will be enhanced enough to allow users to write filter chains and then do Expression Templates (https://en.wikipedia.org/wiki/Expression_templates)-type optimization on them, fully exploiting available locality. :D
(Until then maybe vsFilterScript will get there first.)
stax76
31st July 2020, 12:46
VapourSynth is not mentioned in the Wikipedia Frameserver article (https://en.wikipedia.org/wiki/Frameserver). I don't have much time and Wikipedia experience.
feisty2
31st July 2020, 19:45
vsFilterScript is now ready for general purpose use, and ready to retire vsxx as the modern vs C++ api wrapper.
it has successfully achieved zero cost abstraction, the test filter runs even faster than the corresponding core filter bundled with vaporsynth (https://forum.doom9.org/showthread.php?p=1919843#post1919843).
and it comes with much prettier syntax and higher level of abstraction FOR FREE!
Myrsloik
1st August 2020, 22:29
R51 released! (https://github.com/vapoursynth/vapoursynth/releases/tag/R51)
Not that exciting. Get ready for the considerably more exciting audio and api development builds soon.
mastrboy
1st August 2020, 23:29
Get ready for the considerably more exciting audio and api development builds soon.
Nice, I might finally switch over from Avisynth after audio support has been released.
Will there be source filters for audio available when the core gets audio support?
Myrsloik
2nd August 2020, 14:32
Nice, I might finally switch over from Avisynth after audio support has been released.
Will there be source filters for audio available when the core gets audio support?
BestAudioSource is already available. How else could I test things?
I encourage the the curious among you to take a look at the audio test builds (https://forum.doom9.org/showthread.php?t=177623).
lansing
7th August 2020, 00:47
I have problem setting the color of blankclip referenced from a YUV444P16 clip.
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
color_clip = core.std.BlankClip(clip_yuv16, color=[0, 0, 220])
color_clip.set_output()
This gives me a dark green frame
Myrsloik
7th August 2020, 01:07
I have problem setting the color of blankclip referenced from a YUV444P16 clip.
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
color_clip = core.std.BlankClip(clip_yuv16, color=[0, 0, 220])
color_clip.set_output()
This gives me a dark green frame
Sounds right with those values. Why do you think it should be something else?
lansing
7th August 2020, 01:29
Sounds right with those values. Why do you think it should be something else?
I think it should take RGB values and converted it to the destine format implicitly, because at the end of the day, we only need to produce a simple colored blankclip, people shouldn't need to look up the equation on their own in order to convert RGB value to YUV.
_Al_
7th August 2020, 01:40
yeah, it is yuv because of format, is value 220 as 8 bit? For 16 bit it would be:
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
MaxSize16bit = 2**16-1
color_clip = core.std.BlankClip(clip_yuv16, color=[0, 0, 220/255*MaxSize16bit])
color_clip.set_output()
setting colors in yuv could get weird if not gray, better set it in RGB and then convert it
lansing
7th August 2020, 04:29
yeah, it is yuv because of format, is value 220 as 8 bit? For 16 bit it would be:
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
MaxSize16bit = 2**16-1
color_clip = core.std.BlankClip(clip_yuv16, color=[0, 0, 220/255*MaxSize16bit])
color_clip.set_output()
setting colors in yuv could get weird if not gray, better set it in RGB and then convert it
Is the "color" argument ordered as R,G,B? Because RGB(0,0,220) should be blue but the function gave me red.
_Al_
7th August 2020, 04:50
If format is YUV or attribute clip has that format then it is [Y,U,V].
To start as RGB you'd need one more conversion line, to set your 8bit 220 blue for final YUV 16bit for exampler:
color_clip = core.std.BlankClip(format=vs.RGB24, color=[0,0,220])
color_clip = color_clip.resize.Point(format=vs.YUV444P16, matrix_s='709')
color_clip.set_output()
Myrsloik
7th August 2020, 08:34
I think it should take RGB values and converted it to the destine format implicitly, because at the end of the day, we only need to produce a simple colored blankclip, people shouldn't need to look up the equation on their own in order to convert RGB value to YUV.
I give full control to the user. It makes no sense to not allow the user to set certain YUV values that can't be represented as RGB. If you say "automatic conversion" I simply say: which matrix and transfer function?
feisty2
7th August 2020, 08:34
ShufflePlanes should automatically strip the "_Matrix" property if the target color family is vs.GRAY. otherwise an error message pops up bitchin' about "no _Matrix stuff allowed for GRAY" or whatever and you have to manually remove the "_Matrix" thingy before ShufflePlanes which is very annoying.
feisty2
7th August 2020, 08:47
you can reproduce the error using the following script
clp = core.std.BlankClip(format=vs.YUV444PS)
clp = core.fmtc.matrix(clp, "601")
clp = core.std.ShufflePlanes(clp, 0, vs.GRAY) # Resize error 1026: GRAY color family cannot have RGB matrix coefficients
ChaosKing
7th August 2020, 09:48
Can reproduce with R51 and also with R51-audio-test5.
Did you copy the text? Because my GRAY is spelled GREY here:
Resize error 1026: GREY color family cannot have RGB matrix coefficients
feisty2
7th August 2020, 09:57
nah, I was replying on my phone so I typed the error message shown on my computer, I didn't pay that much attention to the spelling of each word while I was typing
Myrsloik
7th August 2020, 10:05
ShufflePlanes should automatically strip the "_Matrix" property if the target color family is vs.GRAY. otherwise an error message pops up bitchin' about "no _Matrix stuff allowed for GRAY" or whatever and you have to manually remove the "_Matrix" thingy before ShufflePlanes which is very annoying.
There's no right answer here. Often it's reassembled again and then you want the matrix to be carried over.
lansing
10th August 2020, 16:46
Found another memory leak when calling the evaluateScript function:
https://forum.doom9.org/showthread.php?p=1920641#post1920641
Way to reproduced it, with vseditor 2, load a script, open the PF window, and spam switching between the YUV channels (it is calling evaluateScript internally). memory would kept going up and wouldn't come down even when the script was closed.
vcmohan
11th August 2020, 08:42
http://www.vapoursynth.com/doc/functions/frameeval.html
I tried using this construct. VsEditor checks it OK but when I run virtualdub hangs. My code is
base = core.vcmove.deBarrel(ret,a = 0.05, b= 0.05, c = 0.05,test = 1)
def animator(n,clip):
if n > 20:
return clip
else:
return core.vcmove.deBarrel(ret,a = n * 0.0025 + 0.0005, b= 0.05, c = 0.05, test = 1)
ret = core.std.FrameEval(base,functools.partial(animator,clip=base))
Whats wrong with my code?
ChaosKing
11th August 2020, 09:03
Shouldn't it be vcmove.DeBarrel ?
You have a type. it should be clip and not ret
return core.vcmove.deBarrel(ret,a = n * 0.0025 + 0.0005, b= 0.05, c = 0.05, test = 1)
Check only can not spot every error, use the preview function in vsedit, because it is triggert on frame request.
EDIT
ok check does spot this error too...
EDIT2
Oh and YUV444 (10-32bit) produces a green image, rgb & YUV444P8 looks both okay.
https://i.imgur.com/yG1FPzp.png
EDIT3
only RGB24 is ok higher precision is also broken for rgb.
Or is it just not supported?
vcmohan
11th August 2020, 12:14
Thanks to @ChaosKing. Now I am changing the name to deBarrel. It is in my computer. Not yet uploaded. I will address issues pointed out by you.
feisty2
15th August 2020, 20:08
fun stuff: https://github.com/IFeelBloated/VaporMagik/blob/master/VaporMagik.py
tired of the verbosity of filter calling syntax? cannot patch cython types like vs.VideoNode and list?
with VaporMagik, no more
clip = core.std.StackHorizontal([clip, core.std.Expr([clip, Adjust(clip, -0.4)], "x y + 2 /")])
instead, you can use the member function calling syntax, like in avisynth!
clip = [clip, [clip, clip.Adjust(-0.4)].Expr("x y + 2 /")].StackHorizontal() (https://github.com/IFeelBloated/VaporMagik/blob/master/Test.vpy#L17)
Myrsloik
15th August 2020, 21:40
fun stuff: https://github.com/IFeelBloated/VaporMagik/blob/master/VaporMagik.py
tired of the verbosity of filter calling syntax? cannot patch cython types like vs.VideoNode and list?
with VaporMagik, no more
clip = core.std.StackHorizontal([clip, core.std.Expr([clip, Adjust(clip, -0.4)], "x y + 2 /")])
instead, you can use the member function calling syntax, like in avisynth!
clip = [clip, [clip, clip.Adjust(-0.4)].Expr("x y + 2 /")].StackHorizontal() (https://github.com/IFeelBloated/VaporMagik/blob/master/Test.vpy#L17)
Interesting alternative. Btw, what happens if there are duplicate function names in different plugins?
DJATOM
16th August 2020, 07:52
https://github.com/Endilll/vapoursynth/commit/055b083ef7b5b11c8591f6d17bdafeca718fbc4d - yet another way to do that (it's just enough to call core.augment(locals) after imports).
feisty2
16th August 2020, 09:00
Interesting alternative. Btw, what happens if there are duplicate function names in different plugins?
C++ filters, user defined python functions and other attributes are currently manually registered thru the Injector object, I haven't decided a proper way to auto-register everything but for manual attribute registration, the user can specify unique names for attributes with conflicting symbols or define some customized logic to manually solve the conflicts
def Super(self, *args, **kw):
if self.format.bits_per_sample == 32:
return core.mvsf.Super(self, *args, **kw)
else:
return core.mv.Super(self, *args, **kw)
Injector.TargetType = VideoNode
Injector["Super"] = Super
clp1 = core.std.BlankClip(format = GRAYS)
clp2 = core.std.BlankClip(format = GRAY16)
clp1 = clp1.Super() # calls core.mvsf.Super
clp2 = clp2.Super() # calls core.mv.Super
the Injector object is also capable of dynamically attaching attributes to built-in types like list or str to enable magic syntax like these:
clp = [clp1, clp2].Expr("x y + 2 /")
clp = "x y + 2 /".Render([clp1, clp2])
ideas on how to solve name conflicts of different plugins or even conflicts between C++ filters and python functions for auto-registration are welcome!
Jukus
17th August 2020, 12:44
How do I use std.AssumeFPS but still keep the original duration?
LigH
17th August 2020, 13:30
If you change the duration of every frame, but keep the number of frames constant, the overall playtime must change as well. Rule of proportion.
Typical example: "PAL speedup" – changing the frame rate from 24 fps to 25 fps causes a 1/25 shorter playtime.
Myrsloik
20th August 2020, 19:04
R52-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R52-RC1)
Everyone should update from R51 due to some nasty bugs that were recently discovered. Expect a release soon if nothing serious is found.
r52:
updated visual studio 2019 runtime version
updated zimg
updated vsrepo with support for python wheel packages
vsgenstubs is now included with vsrepo
fixed deadlock in fmserial filters introduced in r51
fixed maximum for 16 bit input with diagonal filters and optimizations
fixed more averageframes bugs (sekrit-twc)
Cary Knoop
20th August 2020, 19:15
R52-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R52-RC1)
Everyone should update from R51 due to some nasty bugs that were recently discovered. Expect a release soon if nothing serious is found.
r52:
updated visual studio 2019 runtime version
updated zimg
updated vsrepo with support for python wheel packages
vsgenstubs is now included with vsrepo
fixed deadlock in fmserial filters introduced in r51
fixed maximum for 16 bit input with diagonal filters and optimizations
fixed more averageframes bugs (sekrit-twc)
Ah, that explains, thanks for the update!
ChaosKing
20th August 2020, 20:17
Will you keep the "new name" vspackages3.json for the vsrepo file?
Myrsloik
20th August 2020, 20:19
Will you keep the "new name" vspackages3.json for the vsrepo file?
Yes, that way it won't create conflicts with older versions.
Myrsloik
23rd August 2020, 14:29
R52 (https://github.com/vapoursynth/vapoursynth/releases/tag/R52)
Identical to RC1 if you don't want to redownload. Mostly regression fixes for R51.
mastrboy
25th August 2020, 02:20
Is there something similar to Avisynth TCPServer for Vapoursynth?
I have a headless Debian Linux server that I would like to utilize for Vapoursynth, and run a Gui script editor like VapoursynthEditor on a different Windows machine.
t3nzin
25th August 2020, 04:41
Is there something similar to Avisynth TCPServer for Vapoursynth?
I have a headless Debian Linux server that I would like to utilize for Vapoursynth, and run a Gui script editor like VapoursynthEditor on a different Windows machine.
https://github.com/Beatrice-Raws/VapourSynth-TCPClip
lansing
25th August 2020, 07:28
I have a function in vseditor that create a vscore from the api and then free it right away, however the memory didn't get released.
const VSAPI * cpVSAPI = m_pVSScriptLibrary->getVSAPI();
VSCore *pCore = cpVSAPI->createCore(0);
cpVSAPI->freeCore(pCore);
Each call to the function leaked about 9 MB.
Myrsloik
25th August 2020, 10:51
R52 portable updated since I forgot to include the VS2019 runtime dlls.
mastrboy
25th August 2020, 14:49
https://github.com/Beatrice-Raws/VapourSynth-TCPClip
Thanks.
Having an issue getting it to work though:
Error:
vspipe test.vpy -
Script evaluation failed:
Python exception: name 'get_output' is not defined
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 2244, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 2245, in vapoursynth.vpy_evaluateScript
File "test.vpy", line 9, in <module>
Server('0.0.0.0', 14322, get_output(), threads=8, log_level='info')
NameError: name 'get_output' is not defined
Script:
import vapoursynth as vs
from vapoursynth import core
from TCPClip import Server
video = core.std.BlankClip(width=640,height=480, format=vs.RGB24, length=500, fpsnum=2997, fpsden=125, color=[0, 0, 0])
video.set_output()
Server('0.0.0.0', 14322, get_output(), threads=8, log_level='info')
get_output should be a VapourSynth function according to the docs: http://www.vapoursynth.com/doc/pythonreference.html#get_output
Any idea what I'm doing wrong here?
vspipe --version
VapourSynth Video Processing Library
Copyright (c) 2012-2020 Fredrik Mellbin
Core R52
API R3.6
Options: -
DJATOM
25th August 2020, 15:37
> import vapoursynth as vs
So it goes to vs.get_output(), I assume. I imported it into script directly, so no namespace in example.
mastrboy
25th August 2020, 16:11
> import vapoursynth as vs
So it goes to vs.get_output(), I assume. I imported it into script directly, so no namespace in example.
That worked, thanks.
Another thing I noticed, which I'm unsure if it's a bug or user error on my side.
The frameserving works as expected now, when running it with python: python3 test.vpy
Server [info]: socket created.
Server [info]: socket bind complete.
Server [info]: listening the socket.
Server [info]: accepting connection from 192.168.10.5:65514.
Server [info]: connection 192.168.10.5:65514 closed.
But gives errors with vspipe:
vspipe test.vpy -
Server [info]: socket created.
Server [info]: socket bind complete.
Server [info]: listening the socket.
Server [info]: accepting connection from 192.168.10.5:65368.
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 674, in vapoursynth.frameDoneCallbackRaw
File "src/cython/vapoursynth.pyx", line 604, in vapoursynth.RawCallbackData.receive
File "src/cython/vapoursynth.pyx", line 600, in vapoursynth.RawCallbackData.handle_future
File "src/cython/vapoursynth.pyx", line 355, in vapoursynth.use_environment
TypeError: cannot create weak reference to 'NoneType' object
DJATOM
25th August 2020, 17:22
Yeah, because you need to run server side via python. Client side might be used as python script in case you just need to encode result from the other server. That mode will be more efficient as no extra data copy will occur. Also you can use VS source mode if you want to split procession between servers. Received data will be copied into re-created clip (it makes std.BlankClip internally and stuff it with server's data using std.FrameEval).
mastrboy
25th August 2020, 21:56
Yeah, because you need to run server side via python. Client side might be used as python script in case you just need to encode result from the other server. That mode will be more efficient as no extra data copy will occur. Also you can use VS source mode if you want to split procession between servers. Received data will be copied into re-created clip (it makes std.BlankClip internally and stuff it with server's data using std.FrameEval).
I see, so calling the scripts through python and not vspipe is the correct usage when TCPClip is involved on the server side.
Are you planning on adding Huffman/Gzip compression like Avisynth TCPServer has?
I'm currently bottle-necked by my network bandwidth, probably since the frames are transferred uncompressed.
DJATOM
26th August 2020, 15:25
I thought about adding LZO compression, it should be fast and probably effective enough for 1080p content. The other option is involving ffv1, which can save more bandwidth, but I'll have to overhaul script's logic to support that (for example, we will need to encode output by chunks and send those chunks, not frames). Anyway I've got a lot of work last months and don't have enough time for TCPClip development. Once I'll have more free time, I'll consider that.
Selur
27th August 2020, 16:24
using:
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020cl", range_in=0, range=0)
I get:
Resize error 3074: invalid colorspace definition (5/10/2 => 10/10/2). May need to specify additional colorspace parameter
So I'm guessing I'm missing some additional colorspace parameter.
Looking at http://www.vapoursynth.com/doc/functions/resize.html
Didn't really help and using, trying to add a transfer characteristics with:
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020cl", range_in=0, range=0,transfer_in="470m")
I get
Python exception: invalid literal for int() with base 10: '470m'
-> would be nice if someone could update the documentation (http://www.vapoursynth.com/doc/functions/resize.html) in a way that it includes the int values.
=> Can someone tell me what parameters are additionally needed and if they map to int, where to lookup those int values.
Cu Selur
Cary Knoop
27th August 2020, 16:42
Resize error 3074: invalid colorspace definition (5/10/2 => 10/10/2). May need to specify additional colorspace parameter
Do you get this message by viewing the result with Vapoursynth Editor?
You do not need to use a transfer characteristic for a matrix transform but you do need it for instance if you want to change the primaries because that requires a linear operation.
poisondeathray
27th August 2020, 17:26
-> would be nice if someone could update the documentation (http://www.vapoursynth.com/doc/functions/resize.html) in a way that it includes the int values.
_Al_ posted a link before
https://github.com/UniversalAl/view/blob/02bbbd982b346d0131e479478ab9949690c4bf7b/view.py#L121
TRANSFER = {
#transfer_in or transfer : transfer_in_s or transfer_s
0:'reserved',
1:'709',
2:'unspec',
3:'reserved',
4:'470m',
5:'470bg',
6:'601',
7:'240m',
8:'linear',
9:'log100',
10:'log316',
11:'xvycc',
13:'srgb',
14:'2020_10',
15:'2020_12',
16:'st2084',
18:'std-b67'
}
MATRIX = {
#matrix_in or matrix : matrix_in_s or matrix_s
0:'rgb',
1:'709',
2:'unspec',
3:'reserved',
4:'fcc',
5:'470bg',
6:'170m',
7:'240m',
8:'ycgco',
9:'2020ncl',
10:'2020cl' ,
12:'chromancl',
13:'chromacl',
14:'ictcp'
}
PRIMARIES = {
#primaries_in or primaries : primaries_in_s or primaries_s
1 : '709' ,
2 : 'unspec' ,
4 : '470m' ,
5 : '470bg' ,
6 : '170m' ,
7 : '240m' ,
8 : 'film' ,
9 : '2020' ,
10 : 'st428' , #'xyz'
11 : 'st431-2',
12 : 'st432-1',
22 : 'jedec-p22'
}
Selur
27th August 2020, 20:48
Do you get this message by viewing the result with Vapoursynth Editor?
yes.
You do not need to use a transfer characteristic for a matrix transform but you do need it for instance if you want to change the primaries because that requires a linear operation.
Okay, now I have still no clue what parameter is missing. :)
_Al_ posted a link before
Thanks for the info about the numbers. Sorry, in advance. I'll probably ask this every few months till this is also somewhere in the documentation or like matrix_in_s and matrix_s you can also use the string names for transfer_in_s, transfer_s, primaries_in_s , primaries_s . :)
-> so still hoping someone can tell me what additional parameters are needed. :)
Cu Selur
Cary Knoop
27th August 2020, 21:03
yes.
Okay, now I have still no clue what parameter is missing. :)
The problem is the Vapoursynth Editor.
If you call this hack function the problem goes away:
def TrickIt(c):
c = core.std.SetFrameProp(c,prop="_Matrix",delete=True)
c = core.std.SetFrameProp(c,prop="_Transfer",delete=True)
c = core.std.SetFrameProp(c,prop="_Primaries",delete=True)
return c
But don't use this when you actually encode the video.
Selur
28th August 2020, 16:10
Thanks I'll try it. :)
Selur
28th August 2020, 19:09
@Cary Knoop: Doesn't help here.
using:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# loading source: F:\TestClips&Co\files\test.avi
# color sampling YUV420P8@8, matrix:470bg, scantyp: progressive
# luminance scale TV
# resolution: 640x352
# frame rate: 25 fps
# input color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25
# Loading source using FFMS2
clip = core.ffms2.Source(source="F:/TestClips&Co/files/test.avi",cachefile="E:/Temp/avi_078c37f69bb356e7b5fa040c71584c40_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
clip = core.std.SetFrameProp(clip,prop="_Matrix",delete=True)
clip = core.std.SetFrameProp(clip,prop="_Transfer",delete=True)
clip = core.std.SetFrameProp(clip,prop="_Primaries",delete=True)
# ColorMatrix: adjusting color matrix from 470bg to 2020cl
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020cl", range_in=0, range=0)
# Output
clip.set_output()
I still get:
Error getting the frame number 0:
Resize error: Resize error 3074: invalid colorspace definition (5/2/2 => 10/2/2). May need to specify additional colorspace parameters.
Cu Selur
_Al_
28th August 2020, 19:37
To delete props before resize does not make sense, only after resize if you want to trick whatever folows (vsedit).
_Al_
28th August 2020, 19:43
And what happen if you serve it for vsedit in RGB, so it does not do anything, only just converting it losslessly to QT5 pixmap?
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020cl", range_in=0, range=0)
clip = core.resize.Point(clip=clip, matrix_in_s="2020cl", format=vs.RGB24)
clip.set_output()
Selur
28th August 2020, 19:51
Seems to work fine if I set a transfer beforehand for example:
# ColorMatrix: adjusting color matrix from 470bg to 2020ncl
clip = core.std.SetFrameProp(clip,prop="_Transfer",intval=1)
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="2020ncl", range_in=0, range=0)
Not sure what vsViewer does internally (to lazy to check he code atm.), settings a transfer value is fine for me.
Cu Selur
Ps.: Still the documentation isn't really helping and should be adjusted.
Selur
29th August 2020, 21:50
What's needed here:
clip = core.resize.Bicubic(clip=clip, matrix_in_s="709", matrix_s="ictcp", range_in=0, range=0)
gives me:
invalid colorspace definition (1/1/2 => 14/1/2). May need to specify additional colorspace parameter
adding '_Transfer' doesn't help,...
Cu Selur
DJATOM
30th August 2020, 13:50
I see, so calling the scripts through python and not vspipe is the correct usage when TCPClip is involved on the server side.
Are you planning on adding Huffman/Gzip compression like Avisynth TCPServer has?
I'm currently bottle-necked by my network bandwidth, probably since the frames are transferred uncompressed.
I had some rest day recently and managed to implement LZO compression (not yet pushed in the repo).
What I have found on that matter - single-threaded compression is slow, it might end up in a bottleneck for your script. So to deal with that there are two options: 1) set lzo level 1, which near 30% less size (compared to uncompressed) and still fast enough (60 fps for 1080p not "flat" content, I've tested with Ergo Proxy OP), 2) actually use multi-threaded execution. While single-threaded lzo level 2 compression performs like at 1.8-2.2 fps in general, with 24 threads (3900x) I've got 33.88 fps (near 15x speed-up). Of course you don't want to waste your CPU for intermediate compression, so I'll make compression defaults at "level = 1, threads = 1", you can tune it on your side. I will publish that update after minor code clean-up.
mastrboy
31st August 2020, 15:09
I had some rest day recently and managed to implement LZO compression (not yet pushed in the repo).
What I have found on that matter - single-threaded compression is slow, it might end up in a bottleneck for your script. So to deal with that there are two options: 1) set lzo level 1, which near 30% less size (compared to uncompressed) and still fast enough (60 fps for 1080p not "flat" content, I've tested with Ergo Proxy OP), 2) actually use multi-threaded execution. While single-threaded lzo level 2 compression performs like at 1.8-2.2 fps in general, with 24 threads (3900x) I've got 33.88 fps (near 15x speed-up). Of course you don't want to waste your CPU for intermediate compression, so I'll make compression defaults at "level = 1, threads = 1", you can tune it on your side. I will publish that update after minor code clean-up.
That was fast, thank you.
I testet a little, without compression on a 2700x on the server side I get ~40fps.
And with various compression options:
Compression level 1 and compression thread 1: 30-35fps
Compression level 1 and compression thread 2: 55-60fps
Compression level 1 and compression thread 4: 80-85fps
Compression level 1 and compression thread 8: 85-90fps (maxing network).
Compression level 2 and compression thread 8: 10fps
Compression level 2 and compression thread 16: 12-15fps
It's a very nice boost with 2-4 threads as long as I have CPU resources to spare.
Above compression level 1 seems too slow for my CPU though.
DJATOM
31st August 2020, 16:20
Glad it helped with your stuff. I want to do some code improvements later, now it's a new week for my work stuff :)
Myrsloik
31st August 2020, 22:15
I have a function in vseditor that create a vscore from the api and then free it right away, however the memory didn't get released.
const VSAPI * cpVSAPI = m_pVSScriptLibrary->getVSAPI();
VSCore *pCore = cpVSAPI->createCore(0);
cpVSAPI->freeCore(pCore);
Each call to the function leaked about 9 MB.
I figured out why. Some dlls leak memory when freed. I'm currently trying to figure out the exact compiler/configuration that causes this.
lansing
1st September 2020, 16:18
Myrsloik, I have a question about node cloning.
If I have a VSNodeRef returned from a slow script(a lot of filters) and I cloned it to a new VSNodeRef, and then I request a frame from both nodes at the same time, will the time it takes to complete doubled?
Myrsloik
1st September 2020, 16:38
Myrsloik, I have a question about node cloning.
If I have a VSNodeRef returned from a slow script(a lot of filters) and I cloned it to a new VSNodeRef, and then I request a frame from both nodes at the same time, will the time it takes to complete doubled?
No, you're only cloning the reference. No work will ever be duplicated assuming the second request is made before the first one completes.
lansing
2nd September 2020, 04:00
No, you're only cloning the reference. No work will ever be duplicated assuming the second request is made before the first one completes.
What if I take the cloned nodeRef and run a filter to it programatically? Does its process start all over again with "slow script + new filter" or does it starts where I cloned it, that is without the slow script part?
lansing
4th September 2020, 03:26
Is there a proper way to add a vapoursynth script to a VSNodeRef programatically? I have a script in vseditor and I want to add some filters just for preview, right now I'm doing this by having the original script and the filter scripts join on script evaluation, but the problem with this is that between switching the filters on and off, the entire script has to be rerun again.
jackoneill
4th September 2020, 21:17
Is there a proper way to add a vapoursynth script to a VSNodeRef programatically? I have a script in vseditor and I want to add some filters just for preview, right now I'm doing this by having the original script and the filter scripts join on script evaluation, but the problem with this is that between switching the filters on and off, the entire script has to be rerun again.
Yes:
https://github.com/dubhater/Wobbly/blob/f74f85a284b4552ed82c966249385a79c21db27f/src/shared/WobblyProject.cpp#L3335
lansing
4th September 2020, 22:36
Yes:
https://github.com/dubhater/Wobbly/blob/f74f85a284b4552ed82c966249385a79c21db27f/src/shared/WobblyProject.cpp#L3335
You're also doing script joining->evaluate, I want to do user_script->evaluate_to_node->append_filter_script_from_node, with this I can have both the node from the original script where I can get videoInfo/frameInfo, and the node from the filter script for display.
To do this with script joining, I will need to evaluate the original script to get one node, and then evaluate the original script (again) + filter script to get the display node. It would evaluate the original script twice.
feisty2
5th September 2020, 04:19
is there a way for vspipe to partially evaluate a script and write the result to hard disk, then read the partially evaluated result form hard disk and continue the rest of evaluation? something like a breakpoint in a debugger.
clip = very_slow_filter_1(clip, ...).mark_for_breakpoint()
# when evaluating the script, vspipe will first solely evaluate very_slow_filter_1
then continue the evaluation of very_slow_filter_2 when the evaluation of very_slow_filter_1 completes
clip = very_slow_filter_2(clip, ...)
clip.set_output()
jackoneill
5th September 2020, 10:45
You're also doing script joining->evaluate, I want to do user_script->evaluate_to_node->append_filter_script_from_node, with this I can have both the node from the original script where I can get videoInfo/frameInfo, and the node from the filter script for display.
To do this with script joining, I will need to evaluate the original script to get one node, and then evaluate the original script (again) + filter script to get the display node. It would evaluate the original script twice.
You can do that with vsscript_setVariable/vsscript_getVariable (http://www.vapoursynth.com/doc/api/vsscript.h.html#vsscript-getvariable).
lansing
6th September 2020, 03:30
You can do that with vsscript_setVariable/vsscript_getVariable (http://www.vapoursynth.com/doc/api/vsscript.h.html#vsscript-getvariable).
vsscript_setVariable saves the variable into a vsmap, but I couldn't find a function that evaluate a script with vsmap. I came up with something like this, will it work?
VSScriptLibrary->vsscript_evaluateScript(&userScriptEnv, userScript);
VSNodeRef * userScriptNode = VSScriptLibrary->getOutput(userScriptEnv, 0);
VSScriptLibrary->vsscript_evaluateScript(&userScriptEnv, filterScript)
VSNodeRef * previewNode = VSScriptLibrary->getOutput(userScriptEnv, 0);
filter script.vpy
clip = vs.get_output()
# filtering
clip.set_output()
jackoneill
6th September 2020, 18:37
vsscript_setVariable saves the variable into a vsmap, but I couldn't find a function that evaluate a script with vsmap. I came up with something like this, will it work?
VSScriptLibrary->vsscript_evaluateScript(&userScriptEnv, userScript);
VSNodeRef * userScriptNode = VSScriptLibrary->getOutput(userScriptEnv, 0);
VSScriptLibrary->vsscript_evaluateScript(&userScriptEnv, filterScript)
VSNodeRef * previewNode = VSScriptLibrary->getOutput(userScriptEnv, 0);
filter script.vpy
clip = vs.get_output()
# filtering
clip.set_output()
Perhaps read the documentation for vsscript_setVariable again. And the function signature.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.