View Full Version : Vapoursynth
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.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.