Replies: 4 comments 25 replies
-
这样弄在单独使用python时是不是有问题,便携版python不止vapoursynth需要用到, |
Beta Was this translation helpful? Give feedback.
-
我用的安装版python,只要确保python和VSScript所在路径在PATH环境变量里,vapoursynth.cp312-win_amd64.pyd所在路径在PYTHONPATH环境变量里就足够了吧 |
Beta Was this translation helpful? Give feedback.
-
can make this file to be in portable_config? and the VapourSynth folder there as well? |
Beta Was this translation helpful? Give feedback.
-
按上面操作后,显示依赖错误 请问这个该怎么办? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
一般来说mpv使用vapoursynth都需要把VapourSynth Portable版解压到mpv.exe的同一目录里,并且还常搭配便携版python一起使用。这么一来mpv文件夹中就变得相当混乱了,对于有洁癖的用户可能难以忍受。
我的方法:将下面压缩包里的VSScript.dll放在mpv.exe旁边,新建一个
VapourSynth
文件夹,把VapourSynth还有便携版Python都放在这个文件夹里(vs插件的dll也要放到VapourSynth
文件夹里面的vs-plugins
中),按照VapourSynth文档的说明安装。已在windows 10/11 64位系统 + mpv 64位 + VapourSynth R69 64位 + 便携版python 3.12 上测试使用svp 4,至少stats上显示正常,mpv没有报错退出VSScript.zip
ps:我此处提供的VSScript.dll是64位的,32位系统的就不要试了。
效果如图:


在Windows目前版本的mpv中(基于shinchiro/mpv-winbuild-cmake的编译工具链),当mpv需要使用VapourSynth功能时,会先在同一目录下寻找VSScript.dll,通过这个dll来调用VapourSynth,而VapourSynth再去寻找python运行环境。
我从dll劫持的相关文章中发现可以使用转发的方法来实现:让mpv调用一个定制的VSScript.dll,这个定制的VSScript.dll会再去我们预先设定的位置调用真正的VSScript.dll。
简单理解就是:用一个同名的dll文件中转调用
由于我不会这些,所以借助了现成的项目 https://github.com/itisluiz/DLLForward , 略作修改,使生成的VSScript.dll会转发到相对路径
./VapourSynth/
里的VSScript.dll源码: VSScript-source.zip
使用visual studio 2022编译。如果想要修改成其他路径的,自行修改VSScript.h的188行
Beta Was this translation helpful? Give feedback.
All reactions