GstRtspSink - Building the plug-in

From RidgeRun Developer Wiki


Previous: Evaluating_GstRtspSink Index Next: Basic_usage




This page describes the process of building the GstRtspSink plug-in using both, RidgeRun's professional SDK and as a standalone GStreamer project.

Building on Yocto

RidgeRun offers a Yocto layer containing RidgeRun commonly used packages. You can download this package from
repository https://github.com/RidgeRun/meta-ridgerun.
It contains a recipe to build the plugin but you need to purchase Gst-Rtsp-Sink with full source code, from the RidgeRun Online Store

Adding meta-ridgerun to your Yocto build

First you need to copy meta-ridgerun in your sources directory:

cp -r meta-ridgerun $YOCTO_DIRECTORY/sources/

Then add the RidgeRun meta-layer to your bblayers.conf file. First, go to the build configuration directory

cd $YOCTO_DIRECTORY/build/conf/

Open the bblayers.conf file and add the RidgeRun meta layer path $YOCTO_DIRECTORY/sources/meta-ridgerun to BBLAYERS

Building GstRtspSink

  • Once you have access to the repository, please open gst-rtsp-sink_0.5.bb in $YOCTO_DIRECTORY/sources/meta-ridgerun/recipes-multimedia/gstreamer/
  • Modify the following line in SRC_URI with the correct gst-rtsp-sink URL by changing <Customer-Directory> with your own.
git://git@gitlab.com/RidgeRun/orders/<Customer-Directory>/gst-rtsp-sink.git;protocol=ssh;branch=${SRCBRANCH} \
  • Make sure you have added your ssh key to your GitLab account. For more information: SSH Information
  • Finally build recipe:
bitbake gst-rtsp-sink

SSH Information

The recipe will fetch the repository using your ssh key, thus it's necessary to add the key in Gitlab page.
For adding it, go to Settings->SSH Keys and add your key, if don't have one you can find there a link about how to generate it.

SSH Issue
If the GitLab key hasn't added to your list of known hosts on the PC, you will have fetch errors when trying to build Gst-RtspSink recipe.
One easy way to add the key is when cloning the repository for the first time from GitLab, it will ask if you want to add the key to your list of known hosts.

Example:

git clone git@gitlab.com:RidgeRun/orders/<Customer-Directory>/gst-rtsp-sink.git

Known Bugs

The build can fail by QA Issues.

ISSUE: gst-rtsp-sink: Files/directories were installed but not shipped

If this error show up, add the following line to gst-rtsp-sink_0.5.bb:

INSANE_SKIP_${PN} += "installed-vs-shipped"

Then, build the package with:

bitbake gst-rtsp-sink

Building as a Standalone Project

GstRtspSink may be built as a standalone Autotools project. First, make sure the dependencies are fulfilled:

sudo apt-get install \
libgstrtspserver-1.0-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgstreamer-plugins-bad1.0-dev

After that, proceed to build the package:

./autogen.sh
./configure --libdir=/usr/lib/$(uname -m)-linux-gnu/     # GStreamer will look for its plug-ins in this standard location
make
sudo make install

The location of the plug-in can vary according to the system. The following table summarizes some standard locations for different setups

System Libdir
Ubuntu /usr/lib/x86_64-linux-gnu/
Mac OSX (macports) /opt/local/lib
NVIDIA Jetson /usr/lib/aarch64-linux-gnu
Qualcomm RB5 /usr/lib/aarch64-linux-gnu/
Table 1. Standard libdir configuration for different systems

Building for Android

To include the plugin in an Android, it needs to be compiled as a static library. For this, it is recommended to use the Cerbero build system with the correct configuration for the target system.

After bootstrapping Cerbero with the chosen configuration, include the following recipe template within the recipes directory:

# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python


class Recipe(recipe.Recipe):

    name = 'gst-rr-rtsp-sink'
    version = 'gst-rr-rtsp-sink'
    commit = '76f30f4ff3c11fcafdec6714faf3b654ce1fe55c'
    remotes = {'origin': RTSP_SINK_GIT_REPO}
    config_sh = 'cd src && autoreconf -fiv && sh ./configure'
    configure_options = '--enable-static-plugins --enable-static --disable-shared  PLATFORM=MX6 CFLAGS="-O0 -ggdb3 -I$CERBERO_PREFIX/../../android-ndk-21/sysroot/usr/include/ -I$CERBERO_PREFIX/../../android-ndk-21/sysroot/usr/include/arm-linux-androideabi/  -I$CERBERO_PREFIX/include -DGST_PLUGIN_BUILD_STATIC -funwind-tables -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fPIC -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -DANDROID -DPIC -D__ARM_ARCH_7A__ -Wa,--noexecstack"'
    make = 'cd src && make'
    make_install = 'cd src && make install'

Modify it to include the path to the android NDK version used by Cerbero, the target architecture, and any other compiler flags necessary for the target; for example, the recipe above targets an IMX6 platform with ARM v7 architecture.

For detailed steps on how to cross-compile for Android using Cerbero, check out this guide.


Previous: Evaluating_GstRtspSink Index Next: Basic_usage