Difference between revisions of "GStreamer In-Band Metadata for MPEG Transport Stream/Getting Started/Building natively"

From RidgeRun Developer Connection
Jump to: navigation, search
(Created page with "<noinclude> {{GStreamer In-Band Metadata for MPEG Transport Stream/Head|previous=Getting Started|next=Getting Started/Getting the code|keywords=}} </noinclude> == Overview ==...")
 
Line 5: Line 5:
 
== Overview ==
 
== Overview ==
 
In order to compile the meta plugin and install it directly, we need to patch some GStreamer libraries, so we need to:
 
In order to compile the meta plugin and install it directly, we need to patch some GStreamer libraries, so we need to:
 +
# Get gst-metadata source code
 
# Install needed dependencies  
 
# Install needed dependencies  
 
# Download gstreamer, gst-plugins-base and gst-plugins-bad source code  
 
# Download gstreamer, gst-plugins-base and gst-plugins-bad source code  
Line 20: Line 21:
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
export BRANCH=$(gst-inspect-1.0 --version | awk 'NR==2 {print $2}')
+
export BRANCH=$(gst-inspect-1.0 --version | awk 'NR==2 {print $2}')                               # This gets the version of GStreamer installed in the system
 +
export BRANCH_PATCHES=$(echo $BRANCH | cut -d'.' -f 1-2)                                          # This gets only the Major and Minor from the GStreamer version, we will need it later
 +
export LIBRARY_VERSION=$(echo $BRANCH | awk -F "." '{f=$2; l=$3} END{if(l < 10)l=0l; print f l}')  # This sets the Minor and Patch from the version in GStreamer as 1405 for example for version v1.14.5
 +
</syntaxhighlight>
 +
 
 +
Then we set the GStreamer installation path from your system, please check the table below to set it:
 +
 
 +
<html>
 +
  <table class='wikitable'>
 +
    <tr>
 +
      <th>Platform</th>
 +
      <th>Path</th>
 +
    </tr>
 +
    <tr>
 +
      <td>Ubuntu 64-bits</td>
 +
      <td>/usr/lib/x86_64-linux-gnu</td>
 +
    </tr>
 +
    <tr>
 +
      <td>RidgeRun's Embedded FS</td>
 +
      <td>-/usr</td>
 +
    </tr>
 +
    <tr>
 +
      <td>Jetson TX1 TX2 Xavier Nano</td>
 +
      <td>/usr/lib/aarch64-linux-gnu</td>
 +
    </tr>
 +
    <caption>Table 1. GStreamer's installation path </caption>
 +
  </table>
 +
</html>
 +
 
 +
In the case of the Jetson boards, you can set:
 +
<syntaxhighlight lang=bash>
 +
cd ~
 +
export BUILD_DIR=`pwd`/gst-build # We will build all the packages inside of this folder
 +
mkdir -p $BUILD_DIR
 +
mkdir -p $BUILD_DIR/prefix
 +
</syntaxhighlight>
 +
 
 +
Then we can set our environment, you can change to any folder where you will like to start building the packages, for example, you can switch to home, this guide builds them inside the gst-build folder:
 +
 
 +
<syntaxhighlight lang=bash>
 +
export INSTALL_PATH=/usr/lib/aarch64-linux-gnu
 +
</syntaxhighlight>
 +
 
 +
=== Download gst-metadata ===
 +
 
 +
You can get the gst-metatada source code in place, for this you should clone the repo:
 +
<syntaxhighlight lang=bash>
 +
cd $BUILD_DIR
 +
YOUR_NAME=your_name # Change this with your name in the repo
 +
REPO_URL=https://gitlab.com/RidgeRun/orders/$YOUR_NAME/gst-metadata
 +
git clone $REPO_URL
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 26: Line 77:
 
This is the list of dependencies required to compile GStreamer
 
This is the list of dependencies required to compile GStreamer
  
<pre>
+
<syntaxhighlight lang=bash>
 
sudo apt-get install \
 
sudo apt-get install \
 
pkg-config bison flex git \
 
pkg-config bison flex git \
Line 33: Line 84:
 
gettext yasm build-essential \
 
gettext yasm build-essential \
 
autotools-dev dpkg-dev automake
 
autotools-dev dpkg-dev automake
</pre>
+
</syntaxhighlight>
  
 
You may also need the development version of different libraries:
 
You may also need the development version of different libraries:
  
<pre>
+
<syntaxhighlight lang=bash>
 
sudo apt-get install \
 
sudo apt-get install \
 
liborc-dev autopoint gtk-doc-tools libgstreamer1.0-dev \
 
liborc-dev autopoint gtk-doc-tools libgstreamer1.0-dev \
Line 44: Line 95:
 
faad libfaad-dev libfaac-dev libgl1-mesa-dev libgles2-mesa-dev \
 
faad libfaad-dev libfaac-dev libgl1-mesa-dev libgles2-mesa-dev \
 
libx264-dev libmad0-dev
 
libx264-dev libmad0-dev
</pre>
 
 
=== Download gstreamer ===
 
The installation is done through a script, the version must be configured in the script's variable.
 
For example, let's use GStreamer 1.16.
 
 
1) Create a directory to store the alternative GStreamer package versions, '''DEVDIR''' will point to the target folder. and '''BRANCH''' to the target branch.
 
<syntaxhighlight lang=bash>
 
export DEVDIR=~/Gst-versions
 
export BRANCH="1.16"
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Create folder
+
=== Download gstreamer source code ===
<syntaxhighlight lang=bash>
 
mkdir $DEVDIR
 
cd $DEVDIR
 
</syntaxhighlight>
 
  
2) Download the script and grant it execution permissions
+
To start the building process, we need the source code of gstreamer, gst-plugins-base and gst-plugins-bad, for this we can run the following lines in bash:
<syntaxhighlight lang=bash>
 
wget https://raw.githubusercontent.com/GStreamer/gstreamer/${BRANCH}/scripts/create-uninstalled-setup.sh
 
chmod ug+rx create-uninstalled-setup.sh
 
</syntaxhighlight>
 
  
3) Modify the '''BRANCH''' variable in the ''create-uninstalled-setup.sh'' script to mach the GStreamer version that you need
 
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
BRANCH="1.16"
 
</syntaxhighlight>
 
  
4a) Modify the '''UNINSTALLED_ROOT''' variable in the ''create-uninstalled-setup.sh'' script to match the path created in 1), it should point to the same folder as '''DEVDIR'''
+
cd $BUILD_DIR
<syntaxhighlight lang=bash>
+
MODULES="gstreamer gst-plugins-base gst-plugins-bad"
UNINSTALLED_ROOT=~/Gst-versions
+
for m in $MODULES
 +
do
 +
    if [ ! -f "$m-$BRANCH.tar.xz" ]; then
 +
        wget http://gstreamer.freedesktop.org/src/$m/$m-$BRANCH.tar.xz
 +
        tar -xf $m-$BRANCH.tar.xz
 +
        mv $m-$BRANCH $m
 +
    else
 +
        echo "$m-$BRANCH source found!"
 +
    fi
 +
done
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
This will download each package and decompress it, then changes each name to remove the -$BRANCH from each of their names.
  
4b) '''NOTE''' In case you are using a tag set in the '''BRANCH''' variable, change the following lines in the ''create-uninstalled-setup.sh'' script(around lines 119-121):
+
=== Patch gstreamer and gst-plugins bad ===
  
<syntaxhighlight lang=bash>
+
The next step before compilation of gstreamer, is patching it, for this we should copy the patches and apply them in their respective package as follows:
--- a/create-uninstalled-setup.sh
 
+++ b/create-uninstalled-setup.sh
 
@@ -117,7 +117,7 @@ do
 
 
  cd $m
 
  if test "$BRANCH" != "master"; then
 
-    git checkout -b $BRANCH origin/$BRANCH
 
+    git checkout -b $BRANCH tags/$BRANCH
 
  fi
 
  git submodule init && git submodule update
 
  cd ..
 
--
 
</syntaxhighlight>
 
  
5) Execute the script.
 
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
./create-uninstalled-setup.sh
+
echo "Patching GStreamer core"
</syntaxhighlight>
+
# Copy GStreamer patch to gstreamer folder
 +
cd $BUILD_DIR
 +
cp gst-metadata/extras/gstreamer-$BRANCH_PATCHES.x/fix-sparse-flag-setting-up.patch gstreamer/
 +
# Apply GStreamer patch
 +
cd gstreamer
 +
git apply fix-sparse-flag-setting-up.patch
  
6) When the new environment is ready, modify the variable ''MYGST'' in the '''gst-1.16''' script to match the path created in 1), it should point to the same folder as '''DEVDIR'''
+
echo "Patching GStreamer Plugins Bad core"
<syntaxhighlight lang=bash>
+
# Copy GStreamer plugins bad patches to gstreamer-plugins-bad folder
MYGST=~/Gst-versions
+
cd $BUILD_DIR
 +
cp gst-metadata/extras/gstreamer-$BRANCH_PATCHES.x/mpegtsmux-reference-clock-on-waiting-pad.patch gst-plugins-bad/
 +
cp gst-metadata/extras/gstreamer-$BRANCH_PATCHES.x/mpegtsmux-meta-specific-pad-templates.patch gst-plugins-bad/
 +
cp gst-metadata/extras/gstreamer-$BRANCH_PATCHES.x/tsmux-demux-update-klv-support.patch gst-plugins-bad/
 +
# Apply GStreamer plugins bad patches
 +
cd gst-plugins-bad
 +
git apply mpegtsmux-reference-clock-on-waiting-pad.patch
 +
git apply mpegtsmux-meta-specific-pad-templates.patch
 +
git apply tsmux-demux-update-klv-support.patch
 
</syntaxhighlight>
 
</syntaxhighlight>
  
7) Switch to the new environment and launch it
+
=== Compiling GStreamer ===
<syntaxhighlight lang=bash>
 
cd $DEVDIR
 
./gst-$BRANCH        #./gst-1.16 in this guide
 
</syntaxhighlight>
 
  
If you get an error that says that the folder doesn't exist, force run with <syntaxhighlight lang=bash> GST_UNINSTALLED_ROOT=~/Gst-versions/$BRANCH ./gst-$BRANCH</syntaxhighlight>
+
To compile GStreamer, is enough to get inside each of the packages' folder and compile inside, just as below:
 
 
8) Build the pending GStreamer plugins, copy and run the next script
 
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
for module in `echo gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav`; do
+
cd $BUILD_DIR
     cd $module
+
MODULES="gstreamer gst-plugins-base gst-plugins-bad"
 +
for m in $MODULES
 +
do
 +
     cd $m
 
     ./autogen.sh --disable-gtk-doc --disable-tests --disable-nls && make -j8
 
     ./autogen.sh --disable-gtk-doc --disable-tests --disable-nls && make -j8
     cd -
+
    export PKG_CONFIG_PATH=`pwd`/pkgconfig:$PKG_CONFIG_PATH
 +
     cd ..
 
done
 
done
 
</syntaxhighlight>
 
</syntaxhighlight>
  
9) Verify the alternative GStreamer 1.16 environment
+
=== Overwrite GStreamer system packages ===
Exit the environment
 
<syntaxhighlight lang=bash>
 
exit
 
</syntaxhighlight>
 
 
 
Enter again to reload plugins
 
<syntaxhighlight lang=bash>
 
./gst-$BRANCH
 
</syntaxhighlight>
 
  
Run ''gst-launch-1.0'' in the custom GStreamer environment
+
From the compilation stage, we need to copy some libraries into the system libraries, so for this is '''highly recommended''' to '''backup''' the original ones first just in case anything goes wrong:
<syntaxhighlight lang=bash>
 
gst-launch-1.0 --version
 
</syntaxhighlight>
 
  
Expected output:
 
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
gst-launch-1.0 version 1.16.2
+
sudo cp $INSTALL_PATH/libgstbase-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstbase-1.0.so.0.$LIBRARY_VERSION.0.bk
GStreamer 1.16.2
+
sudo cp $INSTALL_PATH/libgstcodecparsers-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstcodecparsers-1.0.so.0.$LIBRARY_VERSION.0.bk
Unknown package origin
+
sudo cp $INSTALL_PATH/libgstmpegts-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstmpegts-1.0.so.0.$LIBRARY_VERSION.0.bk
 +
sudo cp $INSTALL_PATH/gstreamer-1.0/libgstmpegpsdemux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegpsdemux.so.bk
 +
sudo cp $INSTALL_PATH/gstreamer-1.0/libgstmpegtsmux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegtsmux.so.bk
 +
sudo cp $INSTALL_PATH/gstreamer-1.0/libgstmpegtsdemux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegtsdemux.so.bk
 
</syntaxhighlight>
 
</syntaxhighlight>
  
10) Exit the environment
+
Then we can update them by installing the ones we just compiled:
exit
 
  
=== Using the Environment ===
 
Each version is installed as a set of scripts and directories. To switch to a specific environment run the following commands:
 
 
1) Go to the installation of the GStreamer environment
 
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
cd ~/GStreamer-versions
+
sudo cp $BUILD_DIR/gstreamer/libs/gst/base/.libs/libgstbase-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstbase-1.0.so.0.$LIBRARY_VERSION.0
 +
sudo cp $BUILD_DIR/gst-plugins-bad/gst-libs/gst/codecparsers/.libs/libgstcodecparsers-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstcodecparsers-1.0.so.0.$LIBRARY_VERSION.0
 +
sudo cp $BUILD_DIR/gst-plugins-bad/gst-libs/gst/mpegts/.libs/libgstmpegts-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstmpegts-1.0.so.0.$LIBRARY_VERSION.0
 +
sudo cp $BUILD_DIR/gst-plugins-bad/gst/mpegdemux/.libs/libgstmpegpsdemux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegpsdemux.so
 +
sudo cp $BUILD_DIR/gst-plugins-bad/gst/mpegtsmux/.libs/libgstmpegtsmux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegtsmux.so
 +
sudo cp $BUILD_DIR/gst-plugins-bad/gst/mpegtsdemux/.libs/libgstmpegtsdemux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegtsdemux.so
 
</syntaxhighlight>
 
</syntaxhighlight>
 
2) Select your version, as an example using ''1.16'', and run it
 
./gst-1.16
 
 
3) Use GStreamer and its plugins
 
gst-launch-1.0 --gst-version
 
 
In this environment, the paths point to the appropriate plugins for the running version.
 
 
4) When finished, exit the session
 
exit
 
  
 
== Installing the evaluation binary ==
 
== Installing the evaluation binary ==

Revision as of 18:35, 19 April 2021


Previous: Getting Started Index Next: Getting Started/Getting the code





Overview

In order to compile the meta plugin and install it directly, we need to patch some GStreamer libraries, so we need to:

  1. Get gst-metadata source code
  2. Install needed dependencies
  3. Download gstreamer, gst-plugins-base and gst-plugins-bad source code
  4. Patch gstreamer and gst-plugins bad
  5. Compile these three packages in order
  6. Overwrite system packages (Not required: Backup the files in case something goes wrong)
  7. Compile gst-metadata
  8. Install gst-metadata

NOTE: This assumes you already have GStreamer installed, if this is not the case, please proceede to install it in your system first.

Installation guide

Before proceeding with each step, we are gonna need some general variables and steps to set up the building environment:

export BRANCH=$(gst-inspect-1.0 --version | awk 'NR==2 {print $2}')                                # This gets the version of GStreamer installed in the system
export BRANCH_PATCHES=$(echo $BRANCH | cut -d'.' -f 1-2)                                           # This gets only the Major and Minor from the GStreamer version, we will need it later
export LIBRARY_VERSION=$(echo $BRANCH | awk -F "." '{f=$2; l=$3} END{if(l < 10)l=0l; print f l}')  # This sets the Minor and Patch from the version in GStreamer as 1405 for example for version v1.14.5

Then we set the GStreamer installation path from your system, please check the table below to set it:

Platform Path
Ubuntu 64-bits /usr/lib/x86_64-linux-gnu
RidgeRun's Embedded FS -/usr
Jetson TX1 TX2 Xavier Nano /usr/lib/aarch64-linux-gnu
Table 1. GStreamer's installation path

In the case of the Jetson boards, you can set:

cd ~
export BUILD_DIR=`pwd`/gst-build # We will build all the packages inside of this folder
mkdir -p $BUILD_DIR
mkdir -p $BUILD_DIR/prefix

Then we can set our environment, you can change to any folder where you will like to start building the packages, for example, you can switch to home, this guide builds them inside the gst-build folder:

export INSTALL_PATH=/usr/lib/aarch64-linux-gnu

Download gst-metadata

You can get the gst-metatada source code in place, for this you should clone the repo:

cd $BUILD_DIR
YOUR_NAME=your_name # Change this with your name in the repo
REPO_URL=https://gitlab.com/RidgeRun/orders/$YOUR_NAME/gst-metadata
git clone $REPO_URL

Install needed dependencies

This is the list of dependencies required to compile GStreamer

sudo apt-get install \
pkg-config bison flex git \
libglib2.0-dev liborc-0.4-dev \
libtool autopoint autoconf \
gettext yasm build-essential \
autotools-dev dpkg-dev automake

You may also need the development version of different libraries:

sudo apt-get install \
liborc-dev autopoint gtk-doc-tools libgstreamer1.0-dev \
libxv-dev libasound2-dev libtheora-dev libogg-dev libvorbis-dev \
libbz2-dev libv4l-dev libvpx-dev libjack-jackd2-dev libsoup2.4-dev libpulse-dev \
faad libfaad-dev libfaac-dev libgl1-mesa-dev libgles2-mesa-dev \
libx264-dev libmad0-dev

Download gstreamer source code

To start the building process, we need the source code of gstreamer, gst-plugins-base and gst-plugins-bad, for this we can run the following lines in bash:

cd $BUILD_DIR
MODULES="gstreamer gst-plugins-base gst-plugins-bad"
for m in $MODULES
do
    if [ ! -f "$m-$BRANCH.tar.xz" ]; then
        wget http://gstreamer.freedesktop.org/src/$m/$m-$BRANCH.tar.xz
        tar -xf $m-$BRANCH.tar.xz
        mv $m-$BRANCH $m
    else 
        echo "$m-$BRANCH source found!"
    fi
done

This will download each package and decompress it, then changes each name to remove the -$BRANCH from each of their names.

Patch gstreamer and gst-plugins bad

The next step before compilation of gstreamer, is patching it, for this we should copy the patches and apply them in their respective package as follows:

echo "Patching GStreamer core"
# Copy GStreamer patch to gstreamer folder
cd $BUILD_DIR
cp gst-metadata/extras/gstreamer-$BRANCH_PATCHES.x/fix-sparse-flag-setting-up.patch gstreamer/
# Apply GStreamer patch
cd gstreamer
git apply fix-sparse-flag-setting-up.patch

echo "Patching GStreamer Plugins Bad core"
# Copy GStreamer plugins bad patches to gstreamer-plugins-bad folder
cd $BUILD_DIR
cp gst-metadata/extras/gstreamer-$BRANCH_PATCHES.x/mpegtsmux-reference-clock-on-waiting-pad.patch gst-plugins-bad/
cp gst-metadata/extras/gstreamer-$BRANCH_PATCHES.x/mpegtsmux-meta-specific-pad-templates.patch gst-plugins-bad/
cp gst-metadata/extras/gstreamer-$BRANCH_PATCHES.x/tsmux-demux-update-klv-support.patch gst-plugins-bad/
# Apply GStreamer plugins bad patches
cd gst-plugins-bad
git apply mpegtsmux-reference-clock-on-waiting-pad.patch
git apply mpegtsmux-meta-specific-pad-templates.patch
git apply tsmux-demux-update-klv-support.patch

Compiling GStreamer

To compile GStreamer, is enough to get inside each of the packages' folder and compile inside, just as below:

cd $BUILD_DIR
MODULES="gstreamer gst-plugins-base gst-plugins-bad"
for m in $MODULES
do
    cd $m
    ./autogen.sh --disable-gtk-doc --disable-tests --disable-nls && make -j8
    export PKG_CONFIG_PATH=`pwd`/pkgconfig:$PKG_CONFIG_PATH
    cd ..
done

Overwrite GStreamer system packages

From the compilation stage, we need to copy some libraries into the system libraries, so for this is highly recommended to backup the original ones first just in case anything goes wrong:

sudo cp $INSTALL_PATH/libgstbase-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstbase-1.0.so.0.$LIBRARY_VERSION.0.bk
sudo cp $INSTALL_PATH/libgstcodecparsers-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstcodecparsers-1.0.so.0.$LIBRARY_VERSION.0.bk
sudo cp $INSTALL_PATH/libgstmpegts-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstmpegts-1.0.so.0.$LIBRARY_VERSION.0.bk
sudo cp $INSTALL_PATH/gstreamer-1.0/libgstmpegpsdemux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegpsdemux.so.bk
sudo cp $INSTALL_PATH/gstreamer-1.0/libgstmpegtsmux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegtsmux.so.bk
sudo cp $INSTALL_PATH/gstreamer-1.0/libgstmpegtsdemux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegtsdemux.so.bk

Then we can update them by installing the ones we just compiled:

sudo cp $BUILD_DIR/gstreamer/libs/gst/base/.libs/libgstbase-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstbase-1.0.so.0.$LIBRARY_VERSION.0
sudo cp $BUILD_DIR/gst-plugins-bad/gst-libs/gst/codecparsers/.libs/libgstcodecparsers-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstcodecparsers-1.0.so.0.$LIBRARY_VERSION.0
sudo cp $BUILD_DIR/gst-plugins-bad/gst-libs/gst/mpegts/.libs/libgstmpegts-1.0.so.0.$LIBRARY_VERSION.0 $INSTALL_PATH/libgstmpegts-1.0.so.0.$LIBRARY_VERSION.0
sudo cp $BUILD_DIR/gst-plugins-bad/gst/mpegdemux/.libs/libgstmpegpsdemux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegpsdemux.so
sudo cp $BUILD_DIR/gst-plugins-bad/gst/mpegtsmux/.libs/libgstmpegtsmux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegtsmux.so
sudo cp $BUILD_DIR/gst-plugins-bad/gst/mpegtsdemux/.libs/libgstmpegtsdemux.so $INSTALL_PATH/gstreamer-1.0/libgstmpegtsdemux.so

Installing the evaluation binary

The layout of the evaluation binary is as follows:

gst-metadata-1.4.1-gst-1.16.2-x86-eval
└── usr
    └── lib
        └── x86_64-linux-gnu
            ├── gstreamer-1.0
            │   ├── libgstmeta.so
            │   ├── libgstmpegpsdemux.so
            │   ├── libgstmpegtsdemux.so
            │   └── libgstmpegtsmux.so
            ├── libgstbase-1.0.so.0.1405.0
            ├── libgstcodecparsers-1.0.so.0.1405.0
            └── libgstmpegts-1.0.so.0.1405.0

In order to install and use the element, copy or replace the files as part of your system. The installation process depends on your GStreamer environment:

  • Installing in the system
  • Installing on custom GStreamer Environment (Recommended)

Follow the instructions according to your requirements

Installing in the System

The GStreamer's installation path depends on the target platform:

Platform Path
Ubuntu 64-bits /usr/lib/x86_64-linux-gnu
RidgeRun's Embedded FS -/usr
Jetson TX1 TX2 Xavier /usr/lib/aarch64-linux-gnu
Table 1. GStreamer's default path

Before installing the binaries in the system, it is highly recommended to backup the default files: As example, for an x86_64 installation the GStreamer's path is /usr/lib/x86_64-linux-gnu/

GST_PATH=/usr/lib/x86_64-linux-gnu

sudo cp $GST_PATH/libgstbase-1.0.so $GST_PATH/libgstbase-1.0.so.bk
sudo cp $GST_PATH/libgstbase-1.0.so.0 $GST_PATH/libgstbase-1.0.so.0.bk
sudo cp $GST_PATH/libgstbase-1.0.so.0.1602.0 $GST_PATH/libgstbase-1.0.so.0.1602.0.bk

sudo cp $GST_PATH/gstreamer-1.0/libgstmpegpsdemux.so $GST_PATH/gstreamer-1.0/libgstmpegpsdemux.so.bk
sudo cp $GST_PATH/gstreamer-1.0/libgstmpegtsmux.so $GST_PATH/gstreamer-1.0/libgstmpegtsmux.so.bk

The evaluation binary will be provided according to the target platform needed. Install the binaries, from the root of the provided file run the next command:

 sudo cp -r usr/ /

Now the binaries are installed, proceed to Verify Installation to check the new plugins.

Installing on Custom GStreamer Environment

As an example, let's use a GStreamer 1.16 environment created in the section Creating Custom GStreamer environment:

Create plugin's folder on the environment

DEVDIR=~/GStreamer-versions
BRANCH=1.16 #version used in this guide. adjust to version required
mkdir -p $DEVDIR/$BRANCH/prefix/lib/gstreamer-1.0/

Install the libgstmeta.so binary from the provided evaluation in the plugin's path. EVAL_PATH should point to the root of the provided evaluation file

EVAL_PATH=/home/gfallas/gst-medatada-1.4.1-gst-1.16.2-x86-eval #example path
cp $EVAL_PATH/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmeta.so $DEVDIR/$BRANCH/prefix/lib/gstreamer-1.0/libgstmeta.so

The tree from DEVDIR should look similar to the next example:

gfallas@gfallas-G5-5587:~/Gst-versions$ tree $DEVDIR/$BRANCH/prefix
/home/gfallas/Gst-versions/1.16/prefix
└── lib
    └── gstreamer-1.0
        └── libgstmeta.so

2 directories, 1 file

Install the rest of the core libraries in the following paths inside the GStreamer environment, this step is required:

cp $EVAL_PATH/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmpegpsdemux.so $DEVDIR/$BRANCH/gst-plugins-bad/gst/mpegdemux/.libs/libgstmpegpsdemux.so
cp $EVAL_PATH/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmpegtsmux.so $DEVDIR/$BRANCH/gst-plugins-bad/gst/mpegtsmux/.libs/libgstmpegtsmux.so
cp $EVAL_PATH/usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0.1602.0 $DEVDIR/$BRANCH/gstreamer/libs/gst/base/.libs/libgstbase-1.0.so.0.1602.0

cp $EVAL_PATH/usr/lib/x86_64-linux-gnu/libgstmpegts-1.0.so.0.1602.0 $DEVDIR/$BRANCH/gst-plugins-bad/gst-libs/gst/mpegts/.libs/libgstmpegts-1.0.so.0.1602.0
cp $EVAL_PATH/usr/lib/x86_64-linux-gnu/libgstcodecparsers-1.0.so.0.1602.0 $DEVDIR/$BRANCH/gst-plugins-bad/gst-libs/gst/codecparsers/.libs/libgstcodecparsers-1.0.so.0.1602.0
cp $EVAL_PATH/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmpegtsdemux.so $DEVDIR/$BRANCH/gst-plugins-bad/gst/mpegtsdemux/.libs/libgstmpegtsdemux.so

Now the binaries are installed on the custom GStreamer environment.

Verify Installation

At this point, it should be possible to inspect the meta element:

Remember to launch the environment, in this guide GStreamer version 1.16 was used:

cd $DEVDIR
./gst-1.16

Expected output:

gfallas@gfallas-G5-5587:~/Gst-versions/1.16$ gst-inspect-1.0 meta
Plugin Details:
  Name                     meta
  Description              Elements used to send and receive metadata
  Filename                 /home/gfallas/Gst-versions/1.16/prefix/lib/gstreamer-1.0/libgstmeta.so
  Version                  1.4.1
  License                  Proprietary
  Source module            gst-plugin-meta
  Binary package           RidgeRun elements
  Origin URL               http://www.ridgerun.com

  metasrc: Metadata Source
  metasink: Metadata Sink

  2 features:
  +-- 2 elements

The plugin is ready to be used, Check the examples section to use the meta plugin.

Appendix

Here are the scripts used to configure the GStreamer environment, version 1.16 was used in this guide.

Script to create the enviroment

Variables used: BRANCH and UNINSTALLED_ROOT.


Previous: Getting Started Index Next: Getting Started/Getting the code