fzwoch / obs-gstreamer

GStreamer OBS Studio plugin
GNU General Public License v2.0
349 stars 34 forks source link

obs-gstreamer build for arm64 (m1 mac) #112

Open noname77 opened 1 month ago

noname77 commented 1 month ago

hey,

thanks for the great project!

after an evening of struggle I have finally managed to build your plugin for an M1 mac with gstreamer installed through homebrew

thought I'd share for anyone without a free evening to mess with this

its currently a manual mess which ill try to clean up for future reference, but this might also never happen so 🤷

brew install --cask obs
brew install gstreamer

extract and put obs-gstreamer.plugin under ~/Library/Application\ Support/obs-studio/plugins or /Applications/OBS.app/Contents/PlugIns

obs-gstreamer.plugin.zip

- macOS 14.0
- obs 30.2.3
- obs-gstreamer 0.4.1
- gstreamer 1.24.7 
- glib 2.80.4

enjoy

danielamar101 commented 1 month ago

God bless you and your beautiful soul

danielamar101 commented 1 month ago

You should open a PR so I can take a look at it.

noname77 commented 1 month ago

You should open a PR so I can take a look at it.

I would if I managed to automate this an any sensible way in docker unfortunately, the set up involved many manual steps which I failed to document at the time

will try to get back to this when I return from holiday, but im pretty busy with day job and other side projects recently so not sure when this will happen realistically

I'll try to at least do a write up on the manual steps to contribute anything back

thanks again for the great work!

noname77 commented 1 month ago

I went ahead and tried to get this off my head straight away. probably won't be able to clean this up any time soon, so leaving it like this for anyone interested

disclaimer: its my first contact with gstreamer and meson, hacked together by trial and error to just get it working. im sure theres a cleaner way of achieving the same

the included libraries are hard copied from homebrew install

brew install gstreamer
brew list gstreamer
(...)
/opt/homebrew/Cellar/gstreamer/1.24.7
brew list glib
(...)
/opt/homebrew/Cellar/glib/2.80.4

I copied them to homebrew-libs (and included in my fork's feat/homebrew-gstreamer branch, ouch! 😓)

mkdir -p ./homebrew-libs
cp -r /opt/homebrew/Cellar/gstreamer/1.24.7 ./homebrew-libs/gstreamer-1.24.7
cp -r /opt/homebrew/Cellar/glib/2.80.4 ./homebrew-libs/glib-2.80.4

if you have different versions you currently need to update both the Dockerfile and meson.build

steps: clone my fork

git clone https://github.com/noname77/obs-gstreamer.git
cd obs-gstreamer

checkout the feat/homebrew-gstreamer branch

git checkout feat/homebrew-gstreamer

build image

docker build . -t obs-gstreamer-homebrew

create a temporary container and copy .so

docker cp $(docker create --name tc obs-gstreamer-homebrew):/macos-aarch64/obs-gstreamer.so ./obs-gstreamer.so && docker rm tc

copy the .so to obs-gstreamer.plugin from regular build under Contents/MacOS/obs-gstreamer

copy obs-gstreamer.plugin to /Applications/OBS.app/Contents/PlugIns

fzwoch commented 1 month ago

If you have a native macOS arm machine is should be fairly easy when it comes to GStreamer. If installed via brew it should be found by meson just fine. You may need to have to point it to libobs.. unless brew by now has a proper obs-studio formula..

JesseFPV commented 4 days ago

Thank you! I was struggling for an hour to get it working on my M1 macbook until I read this issue post. Got it working within a few minutes.