The University of Queensland Homepage
School of ITEE ITEE Main Website

 GStreamer Binary Installer for Mac OS X
The lack of a user-friendly binary installer for the GStreamer open source multimedia framework on Mac OS X platforms has been a longstanding issue. Although work is already underway to create an official installer (see the links below), I needed an installer immediately for the OpenSHAPA project.

MacPorts was used to download, compile, and install GStreamer into an absolute path on the file system: /System/Library/Frameworks/GStreamer.framework. Two separate MacPorts builds were then used to compile both 32-bit and 64-bit versions of GStreamer with the following ports: gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-ffmpeg gnonlin. Files unrelated to GStreamer were subsequently deleted from the MacPorts installations. Finally, the remaining files were bundled together into a standard OS X package installer using the XCode Package Maker.

Download

Download the GStreamer 0.10.29 Installer (combined 32/64-bit) (136 MB)

Note: Requires Mac OS X 10.6 (Snow Leopard). Due to MacPorts compilation errors, the 32-bit version does not include the libmodplug and libid3tag libraries. The 64-bit version does not include the osxvideosrc library as it is based on the Carbon API (32-bit only).

Usage

Using GStreamer from the command line. Once this GStreamer package has been installed, you can use the GStreamer command line utilities such as gst-inspect and gst-launch directly from a Terminal console:

Daves-MacBook-Pro:~ dave$ gst-inspect
y4menc: y4menc: YUV4MPEG video encoder
xvid: xvidenc: XviD video encoder
xvid: xviddec: XviD video decoder
ximagesrc: ximagesrc: Ximage video source
ximagesink: ximagesink: Video sink
x264: x264enc: x264enc
wavparse: wavparse: WAV audio demuxer
[snip...]
gnonlin: gnlsource: GNonLin Source
gnonlin: gnlcomposition: GNonLin Composition
gnonlin: gnloperation: GNonLin Operation
gnonlin: gnlurisource: GNonLin URI Source
gnonlin: gnlfilesource: GNonLin File Source
staticelements: bin: Generic bin
staticelements: pipeline: Pipeline object

Total count: 181 plugins, 1030 features
Daves-MacBook-Pro:~ dave$

Embedding GStreamer inside your own application. Your application can bind directly to one of the appropriate library folders in /System/Library/Frameworks/GStreamer.framework/Versions depending upon which version is required:

  • /System/Library/Frameworks/GStreamer.framework/Versions/Current/lib - any version of GStreamer (32 or 64 bits)
  • /System/Library/Frameworks/GStreamer.framework/Versions/0.10-i386/lib - 32-bit version of any 0.10.x library
  • /System/Library/Frameworks/GStreamer.framework/Versions/0.10-x64/lib - 64-bit version of any 0.10.x library
  • /System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-i386/lib - 32-bit version of 0.10.29
  • /System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-x64/lib - 64-bit version of 0.10.29

    Calling GStreamer from within Java. Applications using gstreamer-java can bind to GStreamer by adding the following startup code, e.g. in main():

    if (com.sun.jna.Platform.isMac()) {
       final String jnaLibraryPath = System.getProperty("jna.library.path");
       final StringBuilder newJnaLibraryPath = new StringBuilder(jnaLibraryPath != null ? (jnaLibraryPath + ":") : "");
       newJnaLibraryPath.append("/System/Library/Frameworks/GStreamer.framework/Versions/0.10-" + (com.sun.jna.Platform.is64Bit() ? "x64" : "i386") + "/lib:");
       System.setProperty("jna.library.path", newJnaLibraryPath.toString());
    }

    Instructions for building the installer package

    These steps are only needed if you want to create your own binary installer package (as above) - you can ignore this if you just want to download and use GStreamer.

    GStreamer was built separately for 32-bit and 64-bit platforms due to problems with the source code for GStreamer that prevented the --with-universal-archs setting from being used.

    1. Download, compile and install a 32-bit version of GStreamer using MacPorts.

    (a) Install MacPorts from source:

    ./configure --build=i386 --prefix=/System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-i386
    make
    make install

    (b) (Optional.) Add a local mirror to /System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-i386/etc/macports/sources.conf to speed up the package downloading process.

    (c) Install GStreamer using MacPorts:

    sudo port install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-ffmpeg gnonlin

    Note: You may encounter some errors when compiling for 32-bit mode in Snow Leopard. See Andres Colubri's directions for workarounds.

    2. Remove the MacPorts files that are not required in the GStreamer binary distribution.

    (a) Delete (or temporarily relocate) all of the folders in /System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-i386 EXCEPT the folders bin, include, lib, and libexec, and share.

    (b) Delete (or temporarily relocate) all of the files in /System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-i386/bin EXCEPT the gst-* files.

    (c) Delete (or temporarily relocate) all of the files in /System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-i386/libexec EXCEPT the libexec/gstreamer-0.10/ files.

    (d) Delete (or temporarily relocate) all of the files in /System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-i386/share EXCEPT the share/gstreamer-0.10/ files.

    3. Repeat the above steps for the 64-bit build of GStreamer.

    (a) Install MacPorts from source:

    ./configure --build=x86_64 --prefix=/System/Library/Frameworks/GStreamer.framework/Versions/0.10.29-x64
    make
    make install

    (b) Install GStreamer using MacPorts as above in Step 1.

    (c) Delete the unnecessary files as in Step 2.

    4. Create symlinks to this version of GStreamer:

    cd /System/Library/Frameworks/GStreamer.framework/Versions
    sudo ln -Ffs 0.10.29-i386 0.10-i386
    sudo ln -Ffs 0.10.29-x64 0.10-x64

    sudo ln -Ffs 0.10.29-i386 0.10
    sudo ln -Ffs 0.10 Current

    cd 0.10.29-i386
    sudo ln -Ffs lib Library
    sudo ln -Ffs bin Commands
    sudo ln -Ffs include Headers

    cd ../0.10.29-x64
    sudo ln -Ffs lib Library
    sudo ln -Ffs bin Commands
    sudo ln -Ffs include Headers

    sudo ln -Ffs /System/Library/Frameworks/GStreamer.framework/Versions/Current/Commands/gst-feedback-0.10 /usr/bin/gst-feedback
    sudo ln -Ffs /System/Library/Frameworks/GStreamer.framework/Versions/Current/Commands/gst-inspect-0.10 /usr/bin/gst-inspect
    sudo ln -Ffs /System/Library/Frameworks/GStreamer.framework/Versions/Current/Commands/gst-launch-0.10 /usr/bin/gst-launch
    sudo ln -Ffs /System/Library/Frameworks/GStreamer.framework/Versions/Current/Commands/gst-typefind-0.10 /usr/bin/gst-typefind
    sudo ln -Ffs /System/Library/Frameworks/GStreamer.framework/Versions/Current/Commands/gst-visualise-0.10 /usr/bin/gst-visualise
    sudo ln -Ffs /System/Library/Frameworks/GStreamer.framework/Versions/Current/Commands/gst-xmlinspect-0.10 /usr/bin/gst-xmlinspect
    sudo ln -Ffs /System/Library/Frameworks/GStreamer.framework/Versions/Current/Commands/gst-xmllaunch-0.10 /usr/bin/gst-xmllaunch

    5. Use the XCode PackageMaker tool (located in /Developer/Applications/Utilities/PackageMaker) to create an installer package that includes the /System/Library/Frameworks/GStreamer.framework tree, along with the /usr/bin symlinks created in the previous step. This package is approximately 150 MB for GStreamer 0.10.29 (including both the 32-bit and 64-bit versions).

    External Links

  • http://code.google.com/p/ossbuild/wiki/MacBuild
  • http://codeanticode.wordpress.com/2010/08/31/building-gstreamer-on-osx/
  • http://codeanticode.wordpress.com/2009/04/03/gstreamer-installer-for-macosx/


    Last updated: 12th October 2010.

    Locations of visitors to this page