Reinaldo Junior

Um outro tech-blog

How to build GStreamer from source

| Comments

This post shows how to build and install GStreamer from source. It targets building GStreamer for Mac OS X Lion. The procedure is quite similar if you want to build GStreamer for Linux.

The GStreamer is organized into several modules. The required modules are gstreamer, gst-plugins-base and gst-plugins-good (if you want to do anything useful). This post will show how to build also gst-plugins-bad and qt-gstreamer modules.

Pre-requisites

1
2
3
4
5
6
7
8
brew update
brew install gettext pkg-config glib

#autopoint is missing on Lion
PATH="$PATH:`brew --prefix gettext`/bin/"

#Required libs provided by homebrew
brew install libiconv libffi

Environment

1
2
3
4
5
BUILD_ROOT=~/gstreamer-src
BUILD_TARGET=~/gstreamer

mkdir $BUILD_TARGET
mkdir $BUILD_ROOT && cd $BUILD_ROOT

Getting the source

1
2
3
4
5
git clone git://anongit.freedesktop.org/gstreamer/gstreamer
git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-base
git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-good
git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-bad
git clone git://anongit.freedesktop.org/gstreamer/qt-gstreamer

Building the base module (gstreamer)

1
2
3
4
5
6
7
8
9
10
11
12
cd $BUILD_ROOT/gstreamer

GST_CONFIG_PATH="`brew --prefix libiconv`/lib/pkgconfig:`brew --prefix libffi`/lib/pkgconfig:`brew --prefix gettext`/lib/pkgconfig"

./autogen.sh --noconfigure
./configure --disable-gtk-doc --disable-debug --with-pkg-config-path=$GST_CONFIG_PATH --prefix=$BUILD_TARGET

make
make install

# Required
GSTP_CONFIG_PATH="$BUILD_TARGET/lib/pkgconfig"

Building the plugin base module (gst-plugins-base)

1
2
3
4
5
6
7
8
9
10
11
12
13
# liborc support
# http://code.entropywave.com/projects/orc/
brew install orc

# Vorbis support
brew install libvorbis

cd "$BUILD_ROOT/gst-plugins-base"
./autogen.sh --noconfigure
./configure --disable-gtk-doc --disable-debug --with-pkg-config-path=$GSTP_CONFIG_PATH --prefix=$BUILD_TARGET

make
make install

Building the “good” plugins (gst-plugins-good)

1
2
3
4
5
6
cd "$BUILD_ROOT/gst-plugins-good"
./autogen.sh --noconfigure
./configure --disable-gtk-doc --disable-debug --disable-goom --disable-libpng --with-pkg-config-path=$GSTP_CONFIG_PATH --prefix=$BUILD_TARGET

make
make install

Building the “bad” plugind (gst-plugins-bad)

Note: osxvideosrc and qtwrapper are disabled because they use deprecated APIs (more info).

1
2
3
4
5
6
7
8
9
# dependencies
brew install rtmpdump libvpx libmms faac faad2

cd "$BUILD_ROOT/gst-plugins-bad"
./autogen.sh --noconfigure
./configure --disable-gtk-doc --disable-debug --disable-apexsink --with-pkg-config-path=$GSTP_CONFIG_PATH --prefix=$BUILD_TARGET

make
make install

Comments