Log in

View Full Version : Can't open freshly compiled BestSource on MacOS


ChibiBoi
3rd February 2025, 01:17
I just compiled BestSource today, but I get this error when I tried using VapourSynth editor. I don't remember when I installed Python or VapourSynth on my MacOS so I don't know how to check what architecture I installed. But I'm currently using MacOS Sonoma 14.6.1 with the Apple M1 Pro chip. How do I fix this compatibility issue?

Failed to load /usr/local/lib/vapoursynth/bestsource.dylib. Error given: dlopen(/Library/Frameworks/VapourSynth.framework/lib/vapoursynth/bestsource.dylib, 0x0001): tried: '/Library/Frameworks/VapourSynth.framework/lib/vapoursynth/bestsource.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/VapourSynth.framework/lib/vapoursynth/bestsource.dylib' (no such file), '/Library/Frameworks/VapourSynth.framework/lib/vapoursynth/bestsource.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

elcoyote
3rd February 2025, 04:38
Since you have a M1 and that the error says you need x86_64 (intel), I would assume that either Python and/or Vapoursynth you installed is x86.

If you want to continue using a x86 installation which should work under Rosetta emulation, you have to either compile or find a x86 version of the dylib.

Or better yet, you install the arm64 version of vapoursynth/python and bestsource (but some plugins have not been ported yet and installation documentation is pretty sparse).

Edit:
here's a compiled dylib for mac x86:
https://github.com/Stefan-Olt/vs-plugin-build/releases/download/vsplugin/com.vapoursynth.bestsource/R7/darwin-x86_64/2024-10-01T19.44.38%2B00.00Z/BestSource-R7-darwin-x86_64.zip

ChibiBoi
4th February 2025, 03:31
Since you have a M1 and that the error says you need x86_64 (intel), I would assume that either Python and/or Vapoursynth you installed is x86.

If you want to continue using a x86 installation which should work under Rosetta emulation, you have to either compile or find a x86 version of the dylib.

Or better yet, you install the arm64 version of vapoursynth/python and bestsource (but some plugins have not been ported yet and installation documentation is pretty sparse).

Edit:
here's a compiled dylib for mac x86:
https://github.com/Stefan-Olt/vs-plugin-build/releases/download/vsplugin/com.vapoursynth.bestsource/R7/darwin-x86_64/2024-10-01T19.44.38%2B00.00Z/BestSource-R7-darwin-x86_64.zip

Thanks for that! I was looking for a compiled version for x86 but I couldn't. That link seemed to have worked but now It gave me a new error:

Failed to load /usr/local/lib/vapoursynth/bestsource.dylib. Error given: dlopen(/Library/Frameworks/VapourSynth.framework/lib/vapoursynth/bestsource.dylib, 0x0001): Library not loaded: /usr/local/opt/libx11/lib/libX11.6.dylib
Referenced from: /Library/Frameworks/VapourSynth.framework/lib/vapoursynth/bestsource.dylib
Reason: tried: '/usr/local/opt/libx11/lib/libX11.6.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libx11/lib/libX11.6.dylib' (no such file), '/usr/local/opt/libx11/lib/libX11.6.dylib' (no such file)


Is there a way for me to try to install the x86_64 version using VSRepo? I can't remember how to use VSRepo tbh. I installed Vapoursynth on my laptop probably over a year ago.

I tried compiling my own version using Rosetta but it gave me this error at the command ninja -C build:

BestAudioSource::BestAudioSource(std::__1::__fs::filesystem::path const&, int, int, int, int, std::__1::__fs::filesystem::path const&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>> const*, double, std::__1::function<bool (int, long long, long long)> const&) in src_audiosource.cpp.o
BestAudioSource::IndexTrack(std::__1::function<bool (int, long long, long long)> const&) in src_audiosource.cpp.o
LWVideoDecoder::GetSourceSize() const in src_videosource.cpp.o
BestVideoSource::BestVideoSource(std::__1::__fs::filesystem::path const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, int, int, int, int, int, std::__1::__fs::filesystem::path const&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>> const*, std::__1::function<bool (int, long long, long long)> const&) in src_videosource.cpp.o
BestVideoSource::IndexTrack(std::__1::function<bool (int, long long, long long)> const&) in src_videosource.cpp.o
"_avutil_version", referenced from:
WriteBSHeader(std::__1::unique_ptr<__sFILE, std::__1::default_delete<__sFILE>>&, bool) in src_bsshared.cpp.o
ReadBSHeader(std::__1::unique_ptr<__sFILE, std::__1::default_delete<__sFILE>>&, bool) in src_bsshared.cpp.o
ld: symbol(s) not found for architecture x86_64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Is there a script for me to check which version of Python I have installed?

elcoyote
5th February 2025, 00:34
For the python version, chatgpt is your friend:

import platform

print("Python version:", platform.python_version())
print("Architecture:", platform.machine())

For libX11, this is a bit weird but not related to vapoursynth. I guess X11 is used by VSEdit. Maybe you could install it with brew install libx11 ? I personally don't use VSEdit anymore, just vs-preview with VS Code. But I'm also using the arm64 version of everything so it's a different situation than yours.

VSRepo works on mac with a few quirks (I needed to install p7zip and I also find that the default install path of the plugins is kind of non standard...)