Selur's Little Message Board
Hybrid 2022.03.20.1: No module named 'vsdpir' - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: Hybrid 2022.03.20.1: No module named 'vsdpir' (/thread-2330.html)

Pages: 1 2 3 4 5 6 7 8


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Dan64 - 31.03.2022

I installed the new dev version and the preview window is working perfectly, but there is still the problem regarding the parser of y4m header.

I think that the problem is in the program "vspipe.exe", this is the output of the program when I run the encoding using the command line

[Image: Debug-Encode-vspipe.png]

When I'm using the vsViewer to preview the movie, which is working perfectly, the same error is reported, but the encoding starts in any case, as shown in the following picture

[Image: Debug-Encode-working.png]

I think that Hybrid should implement the same behavior.


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Selur - 31.03.2022

Try switching to the normal Terminal as default, instead of PowerShell, I suspect this is causing problems with the piping.
https://www.digitalcitizen.life/switch-cmd-powershell-terminal/

Cu Selur


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Dan64 - 31.03.2022

Same problem. I tried to remove "-c y4m" and I get exactly the same error, it seems that vspipe build a wrong y4m header.


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Selur - 31.03.2022

Problem is I can't reproduce this here. Sad
That said I just fixed another problem, so I'll send you a link to an updated dev version in a few minutes. Wink
Also try rebooting after switching the default command line tool, iirc I also had a similar problem when switching to Windows 11 and it was fixed after I switched to command line tool.
iirc. PowerShell does some additional stuff when it sees a pipe.

Cu Selur


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Dan64 - 31.03.2022

I tried to understand the source of the problem.

I have 2 different versions of Hybrid installed on my PC, using the portable mode (i.e. local settings).

The version 2021.12.10.1 is working perfectly (no crash), while the last version 2022.03.31.1 is unable to encode the movies if I use Vapoursynth filters.

using Hibrid I generate 2 Vapoursynth script which are doing exactly the same job but are generated using the 2 different versions.

The script generated using the version 2021.12.10.1 (script V1) is the following.

# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# source: 'F:\VideoTests\Test_vsDpir\Test_video_1m.mkv'
# current color space: YUV420P10, bit depth: 10, resolution: 1280x712, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading F:\VideoTests\Test_vsDpir\Test_video_1m.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/VideoTests/Test_vsDpir/Test_video_1m.mkv", format="YUV420P10", cache=0, fpsnum=25)
# making sure input color matrix is set as 709
clip = core.resize.Bicubic(clip, matrix_in_s="709",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# denoising using KNLMeansCL
clip = core.knlm.KNLMeansCL(clip=clip)
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()

The script generated using the version 2022.03.31.1 (script V2) is the following

# Imports
import os
import sys
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'D:/Programs/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc
# source: 'F:\VideoTests\Test_vsDpir\Test_video_1m.mkv'
# current color space: YUV420P10, bit depth: 10, resolution: 1280x712, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading F:\VideoTests\Test_vsDpir\Test_video_1m.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/VideoTests/Test_vsDpir/Test_video_1m.mkv", format="YUV420P10", cache=0, fpsnum=25)
# Setting color matrix to 709.
clip = core.std.SetFrameProps(clip, _Matrix=1)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# denoising using KNLMeansCL
clip = havsfunc.KNLMeansCL(clip=clip)
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()

Then, to be sure that the proper Vapoursynth varsion is loaded, I executed the following command in the Vapoursynth folder of the selected Hybrid version.

\Vapoursynth> .\vspipe.exe "F:\VideoTests\Test_vsDpir\encodingTempSynthSkript_2022-03-31@19_42_16_V1.vpy" - -c y4m | ..\x265.exe --input - --output-depth 10 --y4m --crf 18.00 --preset fast --output "F:\VideoTests\Test_vsDpir\Test.265"

\Vapoursynth> .\vspipe.exe "F:\VideoTests\Test_vsDpir\encodingTempSynthSkript_2022-03-31@19_42_16_V2.vpy" - -c y4m | ..\x265.exe --input - --output-depth 10 --y4m --crf 18.00 --preset fast --output "F:\VideoTests\Test_vsDpir\Test.265"


The scripts were executed properly. But when I tried to execute the scripts using the Vapoursynth folder of the new Hybrid version, I started to get errors.

The First error was

Script evaluation failed:
Python exception: Plugin D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll already loaded (com.Khanattila.KNLMeansCL) from D:/Programs/VapourSynth64Portable/VapourSynth64/vapoursynth64/plugins/KNLMeansCL.dll

Traceback (most recent call last):
  File "src\cython\vapoursynth.pyx", line 2832, in vapoursynth._vpy_evaluate
  File "src\cython\vapoursynth.pyx", line 2833, in vapoursynth._vpy_evaluate
  File "F:\VideoTests\Test_vsDpir\encodingTempSynthSkript_2022-03-31@19_42_16_V1.vpy", line 6, in <module>
    core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
  File "src\cython\vapoursynth.pyx", line 2580, in vapoursynth.Function.__call__
vapoursynth.Error: Plugin D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll already loaded (com.Khanattila.KNLMeansCL) from D:/Programs/VapourSynth64Portable/VapourSynth64/vapoursynth64/plugins/KNLMeansCL.dll

x265 [error]: unable to open input file <->

Then I commented out from the scripts the loading of dlls, but I got the following error

Script evaluation failed:
Python exception: knlm.KNLMeansCL: only YUV444P10 and RGB30 are supported!

Traceback (most recent call last):
  File "src\cython\vapoursynth.pyx", line 2832, in vapoursynth._vpy_evaluate
  File "src\cython\vapoursynth.pyx", line 2833, in vapoursynth._vpy_evaluate
  File "F:\VideoTests\Test_vsDpir\encodingTempSynthSkript_2022-03-31@19_42_16_V2.vpy", line 28, in <module>
    clip = havsfunc.KNLMeansCL(clip=clip)
  File "D:\Programs\Hybrid\64bit\vsscripts\havsfunc.py", line 5410, in KNLMeansCL
    return clip.knlm.KNLMeansCL(d=d, a=a, s=s, h=h, wmode=wmode, wref=wref, device_type=device_type, device_id=device_id).knlm.KNLMeansCL(
  File "src\cython\vapoursynth.pyx", line 2580, in vapoursynth.Function.__call__
vapoursynth.Error: knlm.KNLMeansCL: only YUV444P10 and RGB30 are supported!

x265 [error]: unable to open input file <->


So I suspect the y4m header problem is due to the fact that the execution of script fails.


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Selur - 31.03.2022

Seems like your other portable puts the libraries into the autoload folder, so calls like:
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
will cause double loading.
Nagging the main developer or Vapoursynth for ~1 year to please add an option to stop autoloading inside a script, but it's not there yet.

And yes, this is totally unrelated to the issue before.

Cu Selur


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Dan64 - 31.03.2022

But the same scripts executed using the old version of Hybrid are working perfectly (no autoload of dll)

After having installed the last version, the error message changed in:

PS D:\Programs\Hybrid\64bit\Vapoursynth> .\vspipe.exe "F:\VideoTests\Test_vsDpir\encodingTempSynthSkript_2022-03-31@19_42_16_V2.vpy" - -c y4m | ..\x265.exe --input - --output-depth 10 --y4m --crf 18.00 --preset fast --output "F:\VideoTests\Test_vsDpir\Test.265"
Failed to initialize VSScript
x265 [error]: unable to open input file <->

No reason is shown for the failure in initializing the script.


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Selur - 31.03.2022

Quote:Python exception: knlm.KNLMeansCL: only YUV444P10 and RGB30 are supported!
current Hybrid version assumes that KNLMeansCL supports YUVXXX and RGBX
Which is correct, I just tested it:

import vapoursynth as vs
import os
import sys
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'i:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc
# source: 'G:\TestClips&Co\files\10bit Test.mkv'
# current color space: YUV420P10, bit depth: 10, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading G:\TestClips&Co\files\10bit Test.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="G:/TestClips&Co/files/10bit Test.mkv", format="YUV420P10", cache=0)
# Setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=5)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# denoising using KNLMeansCL
clip = havsfunc.KNLMeansCL(clip=clip)
# adjusting output color from: YUV420P10 to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
works fine here.

Regarding the auto loading:
a. Check your environment variables, there should be nothing related to Vapoursynth in it.
b. Check the python39._pth files and the paths they point to.
c. Check your Vapoursynth\vapoursynth64\plugins folders, they should be empty.

Quote:Plugin D:/Programs/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll already loaded (com.Khanattila.KNLMeansCL) from D:/Programs/VapourSynth64Portable/VapourSynth64/vapoursynth64/plugins/KNLMeansCL.dll
Clearly states that your VapourSynth64Portable install dlls are autoloaded and that autoloading is system wide,... Smile like I wrote "Nagging the main developer or Vapoursynth for ~1 year to please add an option to stop autoloading inside a script, but it's not there yet." to avoid such things.

-> unless I can reproduce your problems I can't fix them.
So first thing you should do is uninstall any other Vapoursynth installations, otherwise you probably just run into other issues.

Cu Selur

Ps.: going to be now


RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Dan64 - 31.03.2022

After having installed the last version also the Preview Window is not working any more.

Is shown the following error (never happen before)

Failed to initialize VapourSynth environment!
Failed to evaluate the script.



RE: Hybrid 2022.03.20.1: No module named 'vsdpir' - Selur - 31.03.2022

Install every Vapoursynth version, uninstall Hybrid.
Install Hybrid and addon.

N8