View Full Version : VapourSynth Setup Problem -- cannot load vsscript.dll
MysteryX
17th April 2020, 19:35
I have installed Python 3.8 and VapourSynth both x64 and x86 versions using the installer on the website.
When I try to run a script, however, it says that "vsscript.dll" cannot be loaded.
It seems there's something wrong with the installer. The DLL isn't properly registered to be found?
amayra
17th April 2020, 20:40
where did you try your script ?
what version of windows do you have ?
stax76
17th April 2020, 20:54
Running a script can mean many things, there is a vfw wrapper and there the vs api and different apps use the api in a different way, the most important way is using following reg key:
https://github.com/staxrip/staxrip/blob/master/FrameServer/VapourSynthServer.cpp#L49
If LoadLibrary to this DLL fails then there is probably something wrong with the DLL or something with load time linked DLLs, the OS unfortunately does not tell which DLL.
MysteryX
18th April 2020, 00:51
I tried with VapourSynth Editor (says it can't load script resources on startup) and with my VapourSynth Multi-Viewer (fails to load vsscript.dll)
http://www.vapoursynth.com/2014/08/a-new-editor/
If I have to read the DLL path from the registry, then I can do that.
...
but also it's failing to open in a video player; and even vspipe.exe is failing on a basic "blankclip" script
I'm using Windows 10 x64
stax76
18th April 2020, 01:29
If you need to research error codes you can use this tool:
https://www.microsoft.com/en-us/download/details.aspx?id=100432
If there is an issue with load time linked DLLs I think the OS will just show some stupid code like 126 but I read that tools like ProcessMonitor or FileMon can reveal which DLL exactly is the problem.
Issues with installing VapourSynth are not exactly uncommon, restarting an app or the OS can help, or re-installing Python and VapourSynth.
MysteryX
18th April 2020, 01:50
Opening VapourSynth Editor throws
Failed to load vapoursynth script library!
Please set up the library search paths in settings.
However, opening the Python console and typing this does work, both in x86 and x64
from vapoursynth import core
print(core.version())
As for running it via VapourSynth Multi-Viewer, the error is pretty explicit:
Unable to load DLL 'vsscript.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E
Of course, I can specify the path explicitly, but that won't solve for opening it in a media player.
ChaosKing
18th April 2020, 08:22
Is python installed globally or is it a per user installation? You are using VS R49? R48 and lower only work with python 3.7.
MysteryX
18th April 2020, 17:39
I installed Python globally; after creating a new user account and running into the problem that a lot of software needed to be reinstalled. R49
Mystery Keeper
19th April 2020, 07:50
I had that problem recently. Rebooting my PC helped.
MysteryX
24th April 2020, 21:22
Rebooting the PC didn't help. I tried reinstalling Python for the current user only, that didn't help either.
stax76
24th April 2020, 21:38
I'm usually against codec and runtime packages but if nothing else helps maybe try an AIO VC redist package.
Maybe here is something helpful:
https://stackoverflow.com/questions/14361992/dll-load-library-error-code-126
You are an experienced programmer, right? :)
MysteryX
26th April 2020, 05:04
Of course I could make it work by explicitely pointing to the right DLL folder, but I'm more concerned about making it work in MPC-HC and making sure it works reliably if I install it on a client computer.
If you tell me the current behavior is "by design", then I could work with it, but that doesn't seem to be the case.
MysteryX
3rd May 2020, 17:22
Nobody? Ok... how is it designed to work? With Avisynth, we copy Avisynth.dll into the system folder so that it finds it.
Is an application like MPC-HC supposed to find the DLLs on its own?
How is the DLL supposed to be found after setup?
- system folder
- DLL registered in the registry
- each application must find the DLL path and load it manually
Myrsloik
3rd May 2020, 20:02
You either find the path through one of the VS registry entries (when installed) or simply assuming it's somewhere in the path (portable version).
MysteryX
4th May 2020, 00:21
I can find the DLL via registry no problem if I want to do that for a custom software; but that won't make it work in a video player. Just checking how it's supposed to work.
stax76
4th May 2020, 01:13
It's probably an issue of the video player, in mpv it works if both python and vapoursynth are in path and if mpv has some extra configuration:
https://github.com/stax76/mpv.net/blob/master/Manual.md#advanced-features
Patman
4th May 2020, 13:25
@MisterXY please update Vapoursynth to R50-RC2 and test again. There is a problem with Python 3.8 and Vapoursynth R49 (Link) (https://forum.doom9.org/showthread.php?p=1908492#post1908492).
MysteryX
4th May 2020, 17:23
@MisterXY please update Vapoursynth to R50-RC2 and test again. There is a problem with Python 3.8 and Vapoursynth R49 (Link) (https://forum.doom9.org/showthread.php?p=1908492#post1908492).
Great, now it's working! Indeed something was wrong.
I find it strange, however, that the sample script I was using before is no longer working
import vapoursynth as vs
core = vs.get_core()
video = core.std.BlankClip(length=100, format=vs.YUV444P8, color=[100, 0, 0])
video.set_output()
Python exception: Resize error: bad value: matrixin_s
Patman
4th May 2020, 19:38
Do a complete new installation! Uninstall all previous versions and reinstall Python and Vapoursynth. Then test again.
poisondeathray
6th May 2020, 17:12
I find it strange, however, that the sample script I was using before is no longer working
import vapoursynth as vs
core = vs.get_core()
video = core.std.BlankClip(length=100, format=vs.YUV444P8, color=[100, 0, 0])
video.set_output()
Python exception: Resize error: bad value: matrixin_s
typo? it should be matrix_in_s
what application are you running that in ?
does vspipe give error ?
vspipe --info script.vpy -
MysteryX
6th May 2020, 20:55
Typo indeed
https://i.postimg.cc/341SzgTS/Vapoursynth-Error.png (https://postimg.cc/341SzgTS)
I'm using my own app. Actually I was inserting a script at the end to display it to the screen.
import vapoursynth as vs
core = vs.get_core()
video = core.std.BlankClip(length=100, format=vs.YUV444P8, color=[100, 0, 0])
video.set_output()
# This is appended to scripts to convert to COMPATBGR32 format for display
import vapoursynth as viewernet_vs
viewernet_node = viewernet_vs.get_output(index=0)
viewernet_format = viewernet_node.format
viewernet_params = { "format": viewernet_vs.COMPATBGR32 }
if viewernet_node.height <= 480:
viewernet_matrix = "603"
else:
viewernet_matrix = "709"
if viewernet_format is None or (viewernet_format.color_family != viewernet_vs.RGB and viewernet_format.id != viewernet_vs.COMPATBGR32):
viewernet_params["matrix_in_s"] = viewernet_matrix
viewernet_node = viewernet_node.resize.Bicubic(**viewernet_params).std.FlipVertical()
viewernet_node.set_output()
Running this in VSPIPE gives
Script evaluation failed:
Python exception: Resize error: bad value: matrix_in_s
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1956, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 1957, in vapoursynth.vpy_evaluateScript
File "_test.vpy", line 17, in <module>
viewernet_node = viewernet_node.resize.Bicubic(**viewernet_params).std.FlipVertical()
File "src\cython\vapoursynth.pyx", line 1862, in vapoursynth.Function.__call__
vapoursynth.Error: Resize error: bad value: matrix_in_s
Has there been breaking changes in the syntax of accepted color matrices?
poisondeathray
6th May 2020, 21:09
if viewernet_node.height <= 480:
viewernet_matrix = "603"
maybe typo again? what is "603" ?
probably should be "170m" for NTSC
MysteryX
7th May 2020, 03:21
Rec.709 vs Rec.601
wow I can't believe I left bugs like that in the VapourSynth Multi-Viewer, I'll have to publish a fixed version.
But... I still get the same error after changing it to "601". Changing the value to "709" works though. I guess I had never tested it with small videos.
poisondeathray
7th May 2020, 03:44
But... I still get the same error after changing it to "601". Changing the value to "709" works though. I guess I had never tested it with small videos.
There is no "601" for vapoursynth
"170m" for NTSC or "470bg" for PAL . Functionally the same values
http://www.vapoursynth.com/doc/functions/resize.html
Patman
7th May 2020, 17:43
I think unspec is the best alternative for 601
MysteryX - '601' is one string value for transfer_s or transfer_in_s not for matrix_s or matrix_in_s, not sure if tables below are 100% correct, was "fishing" it out from all kinds of sources. I remember testing it but do not recall if testing all values, there could be simple test done in loop to check if those values are correct, except 'jedec-p22' or maybe couple of others:
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'
}
you can also assign integer argument values instead of strings:
if viewernet_node.height <= 480:
viewernet_matrix = 6 #for NTSC or 5 for PAL, but it should not matter in this case
else:
viewernet_matrix = 1
if viewernet_format is None or (viewernet_format.color_family != viewernet_vs.RGB and viewernet_format.id != viewernet_vs.COMPATBGR32):
viewernet_params["matrix_in"] = viewernet_matrix
note I replaced "matrix_in_s" for "matrix_in"
MysteryX
8th May 2020, 03:36
Woah no 601 in Vapoursynth? Are NTSC and PAL technically using different matrices? If so, that would mean all those old Thai VCDs I've been encoding had distorted colors?
l33tmeatwad
8th May 2020, 04:44
Woah no 601 in Vapoursynth? Are NTSC and PAL technically using different matrices? If so, that would mean all those old Thai VCDs I've been encoding had distorted colors?
It's complicated, but basically SMPTE 170m = BT.601.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.