Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac installation #21

Open
exocode opened this issue Oct 28, 2020 · 2 comments
Open

Mac installation #21

exocode opened this issue Oct 28, 2020 · 2 comments

Comments

@exocode
Copy link

exocode commented Oct 28, 2020

For anyone who is struggling with MacOS Catalina installation (QT version at compile time differs from runtime) (you can see this in log file of OBS)
This could be used to update the MacOS "how to" or someone who searches for a solution.

20:01:55.234: os_dlopen(/Library/Application Support/obs-studio/plugins/obs-transition-matrix/bin/obs-transition-matrix.so->/Library/Application Support/obs-studio/plugins/obs-transition-matrix/bin/obs-transition-matrix.so): dlopen(/Library/Application Support/obs-studio/plugins/obs-transition-matrix/bin/obs-transition-matrix.so, 257): Library not loaded: @rpath/QtWidgets
20:01:55.234:   Referenced from: /Library/Application Support/obs-studio/plugins/obs-transition-matrix/bin/obs-transition-matrix.so
20:01:55.234:   Reason: Incompatible library version: obs-transition-matrix.so requires version 5.15.0 or later, but QtWidgets provides version 5.14.0
20:01:55.234: 
20:01:55.234: Module '/Library/Application Support/obs-studio/plugins/obs-transition-matrix/bin/obs-transition-matrix.so' not loaded
20:01:55.251: [obs-websocket] you can haz websockets (version 4.8.0)
20:01:55.251: [obs-websocket] qt version (compile-time): 5.10.1 ; qt version (run-time): 5.14.1
20:01:55.253: [obs-websocket] module loaded!
20:01:55.253: ---------------------------------
20:01:55.253:   Loaded Modules:
20:01:55.253:     obs-websocket.so
20:01:55.253:     obs-ndi.so
20:01:55.253:     move-transition.so
20:01:55.253:     cloud_captions_plugin.so
20:01:55.253:     advanced-scene-switcher.so
20:01:55.253:     StreamDeckPlugin.so
20:01:55.253:     vlc-video.so
20:01:55.253:     text-freetype2.so
20:01:55.253:     rtmp-services.so
20:01:55.253:     obs-x264.so
20:01:55.253:     obs-vst.so
20:01:55.253:     obs-transitions.so
20:01:55.253:     obs-outputs.so
20:01:55.253:     obs-libfdk.so
20:01:55.253:     obs-filters.so
20:01:55.253:     obs-ffmpeg.so
20:01:55.253:     obs-browser.so
20:01:55.253:     mac-vth264.so
20:01:55.253:     mac-syphon.so
20:01:55.253:     mac-decklink.so
20:01:55.253:     mac-capture.so
20:01:55.253:     mac-avcapture.so
20:01:55.253:     linux-jack.so
20:01:55.253:     image-source.so
20:01:55.253:     frontend-tools.so
20:01:55.253:     decklink-ouput-ui.so
20:01:55.253:     coreaudio-encoder.so
20:01:55.253: ---------------------------------

So installation is not easy, because the version you need is not available anymore. You have to overwrite a file:
(BTW: I already have cmake and xcode-tools installed)

  • I deleted: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/qt.rb
  • then I run brew create https://gist.githubusercontent.com/DDRBoxman/b3956fab6073335a4bf151db0dcbd4ad/raw/ed1342a8a86793ea8c10d8b4d712a654da121ace/qt.rb
  • confirm "qt" as name
  • window opens in your favourite editor: copy and paste the whole content of this file (https://gist.githubusercontent.com/DDRBoxman/b3956fab6073335a4bf151db0dcbd4ad/raw/ed1342a8a86793ea8c10d8b4d712a654da121ace/qt.rb) into that one in the editor and save it.
  • run brew install qt
  • run brew pin qt
  • go to your home folder cd ~
  • follow the instructions from "Build OBS and necessary obs-libraries":
  • wget --quiet --retry-connrefused --waitretry=1 https://obs-nightly.s3.amazonaws.com/osx-deps-2018-08-09.tar.gz tar -xf ./osx-deps-2018-08-09.tar.gz -C /tmp
  • git clone https://github.com/obsproject/obs-studio
  • cd obs-studio
  • git checkout 24.0.6
  • run:
mkdir build && cd build
cmake .. \
    -DBUILD_CAPTIONS=true \
    -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
    -DDISABLE_PLUGINS=true \
    -DENABLE_SCRIPTING=0 \
    -DDepsPath=/tmp/obsdeps \
    -DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \
&& make -j4
  • cd ~ to your home directory again
  • run :
git clone https://github.com/admshao/obs-transition-matrix.git
cd obs-transition-matrix
mkdir build && cd build
cmake .. \
    -DQTDIR=/usr/local/opt/qt \
    -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" \
    -DLIBOBS_LIB="../../obs-studio/build/libobs/libobs.dylib" \
    -DOBS_FRONTEND_LIB="$(pwd)/../../obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \
    -DCMAKE_INSTALL_PREFIX="/usr" \
&& make -j4


install_name_tool \
        -add_rpath @executable_path/../Frameworks/QtWidgets.framework/Versions/5/ \
        -add_rpath @executable_path/../Frameworks/QtGui.framework/Versions/5/ \
        -add_rpath @executable_path/../Frameworks/QtCore.framework/Versions/5/ \
        -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @rpath/QtWidgets \
        -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @rpath/QtGui \
        -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \
        obs-transition-matrix.so

sudo mkdir -p /Library/Application\ Support/obs-studio/plugins/obs-transition-matrix/bin
sudo cp -r ../data /Library/Application\ Support/obs-studio/plugins/obs-transition-matrix/
sudo cp obs-transition-matrix.so /Library/Application\ Support/obs-studio/plugins/obs-transition-matrix/bin

So with that exact steps I got it built successfully and run on macOS Catalina (10.15.7 (19H2))

Bildschirmfoto 2020-10-28 um 20 57 15

@AlbertBaubleDeem
Copy link

AlbertBaubleDeem commented Jun 18, 2021

Great step by step tutorial. I am working in Big Sur. ATM some calls in the file (https://gist.githubusercontent.com/DDRBoxman/b3956fab6073335a4bf151db0dcbd4ad/raw/ed1342a8a86793ea8c10d8b4d712a654da121ace/qt.rb) are deprecated. See below:

Warning: Calling `sha256 "digest" => :tag` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256 tag: "digest"` instead.
Please report this issue to the homebrew/core tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
  /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/qt.rb:12

Warning: Calling `sha256 "digest" => :tag` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256 tag: "digest"` instead.
Please report this issue to the homebrew/core tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
  /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/qt.rb:13

Warning: Calling `sha256 "digest" => :tag` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256 tag: "digest"` instead.
Please report this issue to the homebrew/core tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
  /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/qt.rb:14

==> Downloading https://ghcr.io/v2/homebrew/core/qt/manifests/5.10.1
##O#- #                                                                       
curl: (22) The requested URL returned error: 404 
Error: Failed to download resource "qt_bottle_manifest"
Download failed: https://ghcr.io/v2/homebrew/core/qt/manifests/5.10.1

It seems like it can be fixed by fixing the code. I will try rewriting the code in the file according to the brew warnings and installing the qt again.

Any other ideas? Is anyone working on this?

@petaren
Copy link

petaren commented Dec 8, 2021

Would someone be able to build a macOS binary, I have an M1 Mac so I can't build OBS to be able to build this plugin myself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants