GStreamer Daemon - Building GStreamer Daemon

From RidgeRun Developer Wiki


Previous: GStreamer Daemon Basics Index Next: Quick Start Guide




This page describes the process of getting, building, and installing GStreamer Daemon.

Getting the Code

The official repository is hosted in GitHub. In order to clone the latest version you may run:

git clone https://github.com/RidgeRun/gstd-1.x.git

This code will always point to the latest stable version.

Development Version

By default, the command above will clone the master branch, which will always contain the latest software release. To clone the development version, you may run:

git clone -b develop https://github.com/RidgeRun/gstd-1.x.git

or equivalently

git clone https://github.com/RidgeRun/gstd-1.x.git
git checkout develop

This clone will contain the latest source currently being developed, but it may not be as stable as the master branch. Unless there is a good reason to use the develop branch, master should be used.

Previous Versions

You may switch to a previous version of GStreamer Daemon by referring to the existing project tags. In order to list the existing tags (versions), you may run:

git tag

To use a specific code version, run:

git tag v0.5.0-rc1

where v0.5.0-rc1 is the version to build.

Dependencies

Your build environment will need the following packages installed in order to build GStreamer Daemon:

  • automake
  • gstreamer and gstreamer-base
  • gio-2.0
  • json-glib-1.0
  • libjansson
  • gtk-doc
  • libedit
  • ncurses or ncursesw
  • Compiler toolchain
  • libtool
  • pkg-config
  • libsoup2.4
  • python3-pip (for the python client)

Apt Get Installation

sudo apt-get install \
automake \
libtool \
pkg-config \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libglib2.0-dev \
libjson-glib-dev \
gtk-doc-tools \
libncursesw5-dev \
libdaemon-dev \
libjansson-dev \
libsoup2.4-dev \
python3-pip \
libedit-dev

Dnf Installation

sudo dnf install \
automake \
libtool \
pkg-config \
gstreamer1-devel \
gstreamer1-plugins-base-devel \
glib2-devel \
json-glib \
json-glib-devel \
gtk-doc \
readline-devel \
ncurses-devel \
libdaemon-devel \
jansson-devel \
libsoup-devel \
python3 \
python3-pip

Building GStreamer Daemon

GStreamer Daemon is an Autotools and a Meson project. This makes it easy to build software packages for a variety of operating systems and platforms, including embedded devices.

Autotools

Building Natively

Building for a host computer is straightforward. You may run the following commands:

./autogen.sh
./configure 
make

Specify ./configure --prefix $INSTALL_PATH if you want the build to be configured for installation in a directory other than /usr/local.

Also, the configure script has two options to set the location of the PID file for rundir and to set the location of the logs of the gstd: --with-gstd-runstatedir, --with-gstd-logstatedir respectively.

Cross-Compiling for Other Platforms

The process to build for other platforms is similar that the one for x86.

./autogen.sh
./configure --host <platform-host-name> 
make

In the previous commands <platform-host-name> is the prefix that would be added to the cross-compiler as: <platform-host-name>-gcc". I.E.: arm-none-linux.

Advanced Configuration

The following command may be used as a template for more advanced configurations

PKG_CONFIG_PATH=</alternative/path/lib/pkg-config/> ./configure --host <platform-host-name> \
  --prefix </alternative/prefix/> CFLAGS="<Additional cflags>" LDFLAGS="<Additional ldflags>"

In order to see the full list of configuration options you may run:

./configure --help

Installing the Binaries

Once the make command completes, you can install the generated binaries:

make install

If you are trying to install to a system location you will need to run with sudo privileges.

sudo make install

Meson

Extra Dependencies

Please also install meson and ninja-build

pip3 install meson
sudo apt install ninja-build

Edit your .bashrc to inlude the meson binary path

export PATH=$PATH:~/.local/bin

Building for x86

Building for a host computer is straightforward. Make sure yo have at least meson 0.47.0. You can run the following commands:

meson build 
ninja -C build

Specify meson --prefix $INSTALL_PATH build, if you want the build to be configured for installation in a directory other than /usr/local. We recommend meson --prefix /usr build

Advanced Configuration

In order to see the full list of configuration options you may run:

meson configure build

Installing the Binaries

Once the ninja -C build command completes, you can install the generated binaries:

ninja -C build install

If you are trying to install to a system location you will need to run with sudo privileges.

sudo ninja -C build install

Common build problems and how to resolve them

Building for a host computer is straightforward. You may run the following commands:

As build issues are reported, we will capture the error message and provide the steps on how to resolve the issue. Don't be shy, open an issue at github repo, and let us help you get unstuck.

gst-launch works but gst-client create_pipeline fails

Restart GStreamer Daemon. I ran into this problem when I installed another package (the good plug-ins) after I started GStreamer Daemon. Since GStreamer Daemon already built it database of installed plug-ins, I had to restart GStreamer Daemon for the good plug-in elements to be in GStreamer Daemon's database.

gstd -k
gstd

./autogen.sh: line 24: gtkdocize: command not found

Need to install gtk-doc package.

Example builds

Qualcomm RBx

If you are using Linux Ubuntu 20.4, you might already have GstD installed. If you wish to upgrade to a newer version, remove the existing package with the following command:

apt remove gstd gstd-dbg

Now proceed with the same steps described at the beginning of this wiki. In case you find a dependency conflict with the libjansson package, you can simply downgrade to the required version with the following command:

apt-get install libjansson4=2.12-1build1

Then proceed to install the required dependencies:

sudo apt-get install \
automake \
libtool \
pkg-config \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libglib2.0-dev \
libjson-glib-dev \
gtk-doc-tools \
libncursesw5-dev \
libdaemon-dev \
libjansson-dev \
libsoup2.4-dev \
python3-pip \
libedit-dev

Now you can proceed to build and install, following the instructions provided in at the beginning of this wiki.

Mac OSX 10.12.4 Sierra

I created a fresh OSX VM, downloaded macports, then ran these commands:

# Fetch and install macports
cd $HOME/Downloads
open MacPorts-2.4.1-10.12-Sierra.pkg # use installer default settings
# open a new terminal window
port version # verify install went okay
port list # verify package database install went okay

# Install needed packages
sudo port install autoconf automake gtk-doc json-glib  # install xcode
sudo port install gstreamer1 gstreamer1-gst-plugins-base gstreamer1-gst-plugins-good
# Fetch GStreamer Daemon source code
DEVDIR=$HOME/projects/gstd
mkdir -p $(dirname $DEVDIR)
cd $(dirname $DEVDIR)
git clone https://github.com/RidgeRun/gstd-1.x.git $(basename $DEVDIR)

# Build and install GStreamer Daemon
cd $DEVDIR
./autogen.sh
./configure 
make
sudo make install

# verify GStreamer Daemon installed and working correctly
gstd -e
gst-client pipeline_create testpipe videotestsrc name=vts ! autovideosink
gst-client pipeline_play testpipe
sleep 4
gst-client element_set testpipe vts pattern ball
sleep 4
gst-client  pipeline_stop testpipe
gst-client  pipeline_delete testpipe
gstd -k


Previous: GStreamer Daemon Basics Index Next: Quick Start Guide