I'm trying to use vlc3 (libvlc) with Qt(5.14) clang under MacOsx(10.15)
So I'm using vlc/doc/libvlc/QtPlayer
but at runtime I always have the message : Could not init libVLC
It's because libvlc_new(0,NULL) return nil !!
Trying change args to init vlc
Code: Select all
const char * const vlc_args[] = {"--verbose=2","--vout=macosx"};
vlcInstance = libvlc_new(sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);
pro file links libraries with :
Code: Select all
INCLUDEPATH += /Applications/VLC.app/Contents/MacOS/include
LIBS += -L/Applications/VLC.app/Contents/MacOS/lib
To be sure there is no @rpath problems in vlc libraries, I keep the tree structure of VLC.app by copying directly in build/qtvlc.app/Contents/MacOS/ :
VLC.app/Contents/Frameworks/
VLC.app/Contents/MacOS/lib/
VLC.app/Contents/MacOS/plugins/
I add @rpath to MacOS/qtvlc executable :
Code: Select all
sudo install_name_tool -delete_rpath /Users/amn/Qt/5.15.0/clang_64/lib /Users/amn/test-vlc/vlc-3.0/doc/libvlc/build/qtvlc.app/Contents/MacOS/qtvlc
sudo install_name_tool -add_rpath @executable_path/lib/ /Users/amn/test-vlc/vlc-3.0/doc/libvlc/build/qtvlc.app/Contents/MacOS/qtvlc
sudo install_name_tool -add_rpath @executable_path/plugins/ /Users/amn/test-vlc/vlc-3.0/doc/libvlc/build/qtvlc.app/Contents/MacOS/qtvlc
---
Then If I'm trying to use libvlc (libvlcpp/vlcpp/*) in my own project, with the same deployment process, at runtime, libvlc instanciation crashes.
Code: Select all
const char * const vlc_args[] = {"--verbose=2","--vout=macosx"};
new VLC::Instance(sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Wrapping a NULL instance
I don't have this problem with vlc4 (no crash at runtime), but I can't see the video output with vlc4 even if the video is played (I hear the sound)
So, I'm trying with vlc3, but it crashes.
---
If somebody can explain how deploy vlc3 in vlc/doc/libvlc/QtPlayer,
according to avoid libvlc_new(0,NULL) return nil,
it would be really appreciated.
Thanks a lot in advance.