Installing ofxGstreamer dependencies on OS X with Homebrew

I’m setting up a new OS X machine for work on an app for capturing RSTP streams to Syphon streams. I’d like to install the dependencies with Homebrew, if possible.

I’m tracking @arturo 's README for ofxGstreamer and the list of required packages:

gstreamer-1.0-1.7.1-x86_64.pkg installs the necesary libraries for applications to run

gstreamer-1.0-devel-1.7.1-x86_64.pkg installs the development files needed to compile gst applications

gstreamer-1.0-1.7.1-x86_64-packages.dmg contains some additional packages that are needed to encode some formats like h264, some of these packages have GPL license or use patented formats. Download the dmg and install the following packages from that collection:

…and wondering if I can get it all with Homebrew. I have installed:

and I’m trying to build an empty app with the ofxGstreamer addon in XCode 13.2.1; i’m getting:

/Users/te/Documents/of_v0.11.2_osx_release/libs/openFrameworks/video/ofGstUtils.h:10:10: 'gst/gst.h' file not found

What am I missing?

I have confirmed that if I install the the same gstreamer verions (1.18.5) as homebrew using the packags provided by gstreamer I am able to build successfully. So the question is, can I make this work with homebrew installation?

Update:
Actually, after installing the gstreamer packages directly and not from homebrew, the app DOES build successfully, but then crashes immediately with a different error:

dyld[11812]: Library not loaded: /Users/matt/Projects/cerbero/build/dist/darwin_universal/x86_64/lib/GStreamer
  Referenced from: /Users/te/Documents/of_v0.11.2_osx_release/apps/myApps/RTSP-Syphon/bin/RTSP-SyphonDebug.app/Contents/MacOS/RTSP-SyphonDebug
  Reason: tried: '/Users/te/Documents/of_v0.11.2_osx_release/apps/myApps/RTSP-Syphon/bin/GStreamer' (no such file), '/usr/lib/system/introspection/GStreamer' (no such file), '/Users/matt/Projects/cerbero/build/dist/darwin_universal/x86_64/lib/GStreamer' (no such file), '/usr/local/lib/GStreamer' (no such file), '/usr/lib/GStreamer' (no such file)
(lldb) 

I’m not matt :slight_smile: so there is a path hardcoded somehwere; to be clear, this is just a blank app made with the ProjectGenerator with that includes the ofxGStreamer addon…

It looks like it is not finding the library. It is trying to load a dynamic library which is not where it is supposed to be.
which OSx version are you using.
I am on 10.14 and have no problem running ofxGstreamer. Let me double check if I did anything differently.

This is on an old mac pro tower running Max OS 12.1.

When I had just the home brew gstreamer, the app couldn’t find the gst headers. Once I installed with the GStreamer packages, it finds the headers and builds but then crashes as above…

and is gstreamer in any of the paths that are shown in the error?
GStreamer gets installed as a Framework, which should be at /Library/Frameworks/GStreamer.framework/. Is it there?
Did you try with the example rather than with the empty project?
I can see that ofxGStreamer has the single function ofxGStreamerSetBundleEnvironment(); which looks like it could be relevant. try calling it from setup

and is gstreamer in any of the paths that are shown in the error?
GStreamer gets installed as a Framework, which should be at /Library/Frameworks/GStreamer.framework/ . Is it there?

If I install with Homebrew, then no; but when I install from the packages from GStreamer then yes, I do have GStream in my /Library/Frameworks:

Did you try with the example rather than with the empty project?
I can see that ofxGStreamer has the single function ofxGStreamerSetBundleEnvironment(); which looks like it could be relevant. try calling it from setup

Yes, I did. Still the same error/crash after a successful build:

I also tried the same experiment with a newer max (an M1 MacBook Pro) and OS (also on OS 12.1); here I had to install a newer version of GStreamer to have ARM support (version 1.20.0 Runtime and Dev).

I see that the error I’m getting is complaining about not finding something cerbero related. I also notice that in the example from ofxGStreamer there is a cerbero folder in a utils folder at the same level as the src folder. Am I supposed to copy that into my app, and if so, where in the XCode project should it go?

I also tried putting a copy of /Library/Frameworks/GStreamer.framework/Versions/1.0/GStreamer in of/apps/myApp/myAppName/bin. This is probably not the right way make the project find Gstreamer, but it lets me go past the above error but stops me with this error:

dyld[5319]: Library not loaded: @rpath/lib/libgsttag-1.0.0.dylib
  Referenced from: /Users/ali/Documents/Dev/of_v0.11.2_osx_release/apps/myApps/RTSP-to-Syphon/bin/GStreamer
  Reason: tried: '/Users/ali/Documents/Dev/of_v0.11.2_osx_release/apps/myApps/RTSP-to-Syphon/bin/libgsttag-1.0.0.dylib' (no such file), '/usr/lib/system/introspection/libgsttag-1.0.0.dylib' (no such file), './lib/libgsttag-1.0.0.dylib' (no such file), '/Users/ali/Documents/Dev/of_v0.11.2_osx_release/apps/myApps/RTSP-to-Syphon/bin/../lib/libgsttag-1.0.0.dylib' (no such file), '/Users/ali/Documents/Dev/of_v0.11.2_osx_release/apps/myApps/RTSP-to-Syphon/bin/RTSP-to-SyphonDebug.app/Contents/MacOS/../lib/libgsttag-1.0.0.dylib' (no such file), '/Users/ali/Documents/Dev/of_v0.11.2_osx_release/apps/myApps/RTSP-to-Syphon/bin/../lib/lib/libgsttag-1.0.0.dylib' (no such file), '/Users/ali/Documents/Dev/of_v0.11.2_osx_release/apps/myApps/RTSP-to-Syphon/bin/RTSP-to-SyphonDebug.app/Contents/MacOS/../lib/lib/libgsttag-1.0.0.dylib' (no such file), '/usr/local/lib/libgsttag-1.0.0.dylib' (no such file), '/usr/lib/libgsttag-1.0.0.dylib' (no such file)
(lldb) 

I believe that I’m missing the base plugins for GStreamer; however, I can’t figure out how to install those without Homebrew…?

Update on this:
I’m able to get thru the various missing library complains if I (for now) copy the required dynamic libraries (.dynlib) into the bin folder of my project. So far, I’m able to find all of them in the base, good, bad and ugly GStreamer plugins EXCEPT:

dyld[1258]: Library not loaded: @rpath/lib/libgstvulkan-1.0.0.dylib

Where is libgstvulkan-1.0.0.dylib?

-Ali

As of the Homebrew vs gstreamer packages install, homebrew always installs its stuff in /usr/local/Cellar which might not be in the library search paths of the proyect, or even in PATH

A cheap and easy fix is as you did, putting the dylibs next to the executable. Most usually you want to have these in /apps/myApp/myAppName/bin/myAppName/Contents/MacOS which is where the actual executable is.

as of libgstvulkan-1.0.0.dylib I have no idea. That sounds nasty, as it involves Vulkan which might lead to a rabithole I would try to avoid.

Thanks @roymacdonald .
The answer was to remove all homebrew installs and install the gstreamer packags from the gstreamer site; I sent with version 1.18.6 (both the base and the dev) and now i can build!

1 Like

glad to know!