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

From RidgeRun Developer Connection
Jump to: navigation, search
m (Verify)
 
(26 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
{{GStreamer In-Band Metadata for MPEG Transport Stream/Head|previous=Getting Started/Getting the code|next=User Guide|keywords=}}
+
{{GStreamer In-Band Metadata for MPEG Transport Stream/Head|previous=Getting Started/Building natively|next=User Guide|keywords=}}
 
</noinclude>
 
</noinclude>
  
Line 6: Line 6:
  
 
==Overview==
 
==Overview==
This page provides a guide to install GstMetadata.
+
This page provides a guide to installing GstMetadata.
  
This plugin requires some patches on the GStreamer's standard plugins to properly handle the metadata.
+
This plugin requires some patches on the GStreamer standard plugins to properly handle the metadata.
 
There are 2 possible scenarios for the installation:
 
There are 2 possible scenarios for the installation:
 
* On GStreamer version installed in your system
 
* On GStreamer version installed in your system
Line 47: Line 47:
 
When the custom environment is ready, follow the instructions below to apply the patches. In case you want to use the plugin in the GStreamer version installed in your system, create an alternative environment with the same GStreamer version.
 
When the custom environment is ready, follow the instructions below to apply the patches. In case you want to use the plugin in the GStreamer version installed in your system, create an alternative environment with the same GStreamer version.
  
===Patches Installation===
+
==Install purchased gst-metadata source code ==
The first step is setting the required environment variables to place the patches in the correct folder.
+
The first step is setting the required environment variables to place the code in the correct folder.
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
DEVDIR=~/Gst-versions
 
DEVDIR=~/Gst-versions
BRANCH="1.16"        #Example version used in the guide
+
BRANCH="1.16.0"        #Example version used in the guide
 
GSTENV=$DEVDIR/$BRANCH
 
GSTENV=$DEVDIR/$BRANCH
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* Move or clone GstMetadata
+
Then you can get the gst-metatada source code in place, for this you should clone the repo:
 +
<syntaxhighlight lang=bash>
 +
CLIENT_NAME=client # Change this with your client name in the repo
 +
REPO_URL=https://gitlab.com/RidgeRun/orders/$CLIENT_NAME/gst-metadata
 +
cd $GSTENV
 +
git clone $REPO_URL
 +
</syntaxhighlight>
 +
 
 +
===Patches Installation===
  
 
Enter the custom GStreamer directory
 
Enter the custom GStreamer directory
Line 63: Line 71:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Clone, copy or move GstMetadata to the custom GStreamer environment, the directory should look as follows
+
The directory should look as follows
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
ls $GSTENV
 
ls $GSTENV
Line 70: Line 78:
 
Expected output:
 
Expected output:
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
gfallas@gfallas-G5-5587:~/Gst-versions/1.16$ ls $GSTENV
+
~/Gst-versions/1.16$ ls $GSTENV
 
gst-libav  gst-metadata  gst-plugins-bad  gst-plugins-base  gst-plugins-good  gst-plugins-ugly  gstreamer  prefix
 
gst-libav  gst-metadata  gst-plugins-bad  gst-plugins-base  gst-plugins-good  gst-plugins-ugly  gstreamer  prefix
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* Patch for GStreamer
+
If gst-metadata is not present here, copy the folder from where you cloned it:
 +
<syntaxhighlight lang=bash>
 +
cd $GSTENV
 +
GSTMETADATA_LOCATION=~/gst-metadata/
 +
cp $GSTMETADATA_LOCATION gst-metadata -r
 +
</syntaxhighlight>
 +
 
 +
==== Patch for GStreamer ====
  
 
Change to custom GStreamer version
 
Change to custom GStreamer version
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
cd $GSTENV
 
cd $GSTENV
 +
</syntaxhighlight>
 +
 +
{{Ambox
 +
|type=notice
 +
|small=left
 +
|issue=If you are using a tag in the form 1.y.x for the '''BRANCH''' variable, use '''BRANCH=1.y''' for copying the patches from the gst-metadata/extras/ folder.
 +
|style=width:unset;
 +
}}
 +
 +
<syntaxhighlight lang=bash>
 +
BRANCH_PATCH=1.16
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
Copy and apply patch file
 
Copy and apply patch file
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
cp gst-metadata/extras/fix-sparse-flag-setting-up.patch gstreamer/
+
cp gst-metadata/extras/gstreamer-$BRANCH_PATCH.x/fix-sparse-flag-setting-up.patch gstreamer/
 
cd gstreamer
 
cd gstreamer
 
git apply fix-sparse-flag-setting-up.patch
 
git apply fix-sparse-flag-setting-up.patch
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* Patch for GStreamer plugins bad
+
==== Patch for GStreamer plugins bad ====
  
 
Change to custom GStreamer version
 
Change to custom GStreamer version
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
cd $GSTENV
 
cd $GSTENV
 +
</syntaxhighlight>
 +
 +
{{Ambox
 +
|type=notice
 +
|small=left
 +
|issue=If you are using a tag in the form 1.y.x for the '''BRANCH''' variable, use '''BRANCH'''=1.y for copying the patches from the gst-metadata/extras/ folder.
 +
|style=width:unset;
 +
}}
 +
 +
<syntaxhighlight lang=bash>
 +
BRANCH_PATCH=1.16
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
Copy and apply patches
 
Copy and apply patches
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
cp gst-metadata/extras/mpegtsmux-reference-clock-on-waiting-pad.patch gst-plugins-bad/
+
cp gst-metadata/extras/gstreamer-$BRANCH_PATCH.x/mpegtsmux-reference-clock-on-waiting-pad.patch gst-plugins-bad/
cp gst-metadata/extras/mpegtsmux-meta-specific-pad-templates.patch gst-plugins-bad/
+
cp gst-metadata/extras/gstreamer-$BRANCH_PATCH.x/mpegtsmux-meta-specific-pad-templates.patch gst-plugins-bad/
 +
cp gst-metadata/extras/gstreamer-$BRANCH_PATCH.x/tsmux-demux-update-klv-support.patch gst-plugins-bad/
 
cd gst-plugins-bad
 
cd gst-plugins-bad
 
git apply mpegtsmux-reference-clock-on-waiting-pad.patch
 
git apply mpegtsmux-reference-clock-on-waiting-pad.patch
 
git apply mpegtsmux-meta-specific-pad-templates.patch
 
git apply mpegtsmux-meta-specific-pad-templates.patch
 +
git apply tsmux-demux-update-klv-support.patch
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* Recompile plugins
+
==== Recompile plugins ====
 
Return to DEVDIR and enter the custom Gstreamer environment
 
Return to DEVDIR and enter the custom Gstreamer environment
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
Line 122: Line 161:
 
At this point, the patches are applied in the custom environment
 
At this point, the patches are applied in the custom environment
  
==Compile and Install plugin==
+
===Compile and Install plugin===
===In Custom GStreamer Environment===
+
 
 +
====In Custom GStreamer Environment====
 
Make sure that you are in the custom GStreamer environment.
 
Make sure that you are in the custom GStreamer environment.
  
Line 149: Line 189:
 
Now, GstMetadata is installed in the custom GStreamer environment.
 
Now, GstMetadata is installed in the custom GStreamer environment.
  
===In GStreamer's Default Path===
+
====In GStreamer's Default Path====
This section is in case of installing the plugin into a GStreamer's default path on the system, use the arguments below according to the target platform
+
This section is in case of installing the plugin into a '''GStreamer's default path on the system''', use the arguments below according to the target platform
  
 
The configuration stage depend on the target system, use table below as reference:
 
The configuration stage depend on the target system, use table below as reference:
Line 187: Line 227:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Now, you will need the modified binaries '''libgstbase-1.0.so''', '''libgstmpegtsmux.so''' and '''libgstmpegpsdemux.so''' from the custom GStreamer environment, this only applies when the GStreamer version and the custom version are the same.
+
Now, you will need the modified binaries from the custom GStreamer environment, this only applies when the GStreamer version and the custom version are the same.
  
 
The installation path depends on the target platform:
 
The installation path depends on the target platform:
Line 219: Line 259:
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
PATH=/usr/lib/x86_64-linux-gnu
+
MY_PATH=/usr/lib/x86_64-linux-gnu
 +
VERSION=1602
  
sudo cp $PATH/libgstbase-1.0.so $PATH/libgstbase-1.0.so.bk
+
sudo cp $MY_PATH/libgstbase-1.0.so.0.$VERSION.0 $MY_PATH/libgstbase-1.0.so.0.$VERSION.0.bk
sudo cp $PATH/libgstbase-1.0.so.0 $PATH/libgstbase-1.0.so.0.bk
+
sudo cp $MY_PATH/libgstcodecparsers-1.0.so.0.$VERSION.0 $MY_PATH/libgstcodecparsers-1.0.so.0.$VERSION.0.bk
sudo cp $PATH/libgstbase-1.0.so.0.1602.0 $PATH/libgstbase-1.0.so.0.1602.0.bk
+
sudo cp $MY_PATH/libgstmpegts-1.0.so.0.$VERSION.0 $MY_PATH/libgstmpegts-1.0.so.0.$VERSION.0.bk
 +
sudo cp $MY_PATH/gstreamer-1.0/libgstmpegpsdemux.so $MY_PATH/gstreamer-1.0/libgstmpegpsdemux.so.bk
 +
sudo cp $MY_PATH/gstreamer-1.0/libgstmpegtsmux.so $MY_PATH/gstreamer-1.0/libgstmpegtsmux.so.bk
 +
sudo cp $MY_PATH/gstreamer-1.0/libgstmpegtsdemux.so $MY_PATH/gstreamer-1.0/libgstmpegtsdemux.so.bk
  
sudo cp $PATH/gstreamer-1.0/libgstmpegpsdemux.so $PATH/gstreamer-1.0/libgstmpegpsdemux.so.bk
 
sudo cp $PATH/gstreamer-1.0/libgstmpegtsmux.so $PATH/gstreamer-1.0/libgstmpegtsmux.so.bk
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Then, copy the required libraries from the custom GStreamer environment.
+
Then, copy the required libraries from the custom GStreamer environment. Remember to check the path according to the platform and the gstmetadata library location inside the prefix folder according to the tables above to copy it properly.  
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 +
 +
MY_PATH=/usr/lib/x86_64-linux-gnu
 +
VERSION=1602
 +
 
cd $GSTENV
 
cd $GSTENV
sudo cp $GSTENV/gstreamer/libs/gst/base/.libs/libgstbase-1.0.so* $PATH/libgstbase-1.0.so
+
sudo cp $GSTENV/prefix/lib/gstreamer-1.0/libgstmeta.so $MY_PATH/gstreamer-1.0/libgstmeta.so
  
sudo cp $PATH/gst-plugins-bad/gst/mpegdemux/.libs/libgstmpegpsdemux.so $PATH/gstreamer-1.0/libgstmpegpsdemux.so
+
sudo cp $GSTENV/gstreamer/libs/gst/base/.libs/libgstbase-1.0.so.0.$VERSION.0 $MY_PATH/libgstbase-1.0.so.0.$VERSION.0
sudo cp $PATH/gst-plugins-bad/gst/mpegtsmux/.libs/libgstmpegtsmux.so $PATH/gstreamer-1.0/libgstmpegtsmux.so
+
sudo cp $GSTENV/gst-plugins-bad/gst-libs/gst/codecparsers/.libs/libgstcodecparsers-1.0.so.0.$VERSION.0 $MY_PATH/libgstcodecparsers-1.0.so.0.$VERSION.0
 +
sudo cp $GSTENV/gst-plugins-bad/gst-libs/gst/mpegts/.libs/libgstmpegts-1.0.so.0.$VERSION.0 $MY_PATH/libgstmpegts-1.0.so.0.$VERSION.0
 +
 
 +
sudo cp $GSTENV/gst-plugins-bad/gst/mpegdemux/.libs/libgstmpegpsdemux.so $MY_PATH/gstreamer-1.0/libgstmpegpsdemux.so
 +
sudo cp $GSTENV/gst-plugins-bad/gst/mpegtsmux/.libs/libgstmpegtsmux.so $MY_PATH/gstreamer-1.0/libgstmpegtsmux.so
 +
sudo cp $GSTENV/gst-plugins-bad/gst/mpegtsdemux/.libs/libgstmpegtsdemux.so $MY_PATH/gstreamer-1.0/libgstmpegtsdemux.so
  
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Now the binaries andGtsMetadata are installed in the system.
+
Now the binaries and GtsMetadata are installed in the system.
  
 
==Verify==
 
==Verify==
Line 267: Line 318:
 
+-- 3 elements
 
+-- 3 elements
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
=== Enabling faster metadata ===
 +
 +
Enabling faster metadata will change the <code>metasrc</code> period capacity from seconds to milliseconds.
 +
 +
To write faster metadata with <code>metasrc</code> element from the metadata plugin, gst-plugin-bad needs an extra patch over the ones already needed to make gst-metadata work.
 +
 +
=== Patch process ===
 +
 +
==== Checking environment variables ====
 +
 +
* First, make sure you have already followed the steps from the original instructions to make gst-metadata work. You should have the environment variables set-up:
 +
 +
<syntaxhighlight lang=bash>
 +
export DEVDIR=~/Gst-versions
 +
export BRANCH="1.14.5" #Example version used in the guide
 +
export GSTENV=$DEVDIR/$BRANCH
 +
export BRANCH_PATCH=1.14 #Example version used in the guide for the patch directory
 +
</syntaxhighlight>
 +
 +
* And in <code>$GSTENV</code>, the following files should exist:
 +
 +
<syntaxhighlight lang=bash>
 +
ls $GSTENV
 +
gst-libav  gst-metadata  gst-plugins-bad  gst-plugins-base  gst-plugins-good  gst-plugins-ugly  gstreamer  prefix
 +
</syntaxhighlight>
 +
 +
==== Applying patch for gst-plugin-bad ====
 +
 +
* Now, copy the <code>faster-metadata-support.patch</code> from the patches folder into the source directory of gst-plugin-bad:
 +
 +
<syntaxhighlight lang=bash>
 +
cd $GSTENV
 +
cp extras/gstreamer-$BRANCH_PATCH.x/faster-metadata-support.patch gst-plugins-bad/
 +
cd gst-plugins-bad
 +
git apply faster-metadata-support.patch
 +
</syntaxhighlight>
 +
 +
* And compile it again:
 +
 +
<syntaxhighlight lang=bash>
 +
./autogen.sh --disable-gtk-doc --disable-tests --disable-nls && make -j8
 +
</syntaxhighlight>
 +
 +
==== Applying patch for gst-metadata ====
 +
 +
* Apply the patch needed by gst-metadata to enable sending information in milliseconds:
 +
 +
<syntaxhighlight lang=bash>
 +
cd $GSTENV/gst-metadata
 +
git apply extras/gstreamer-$BRANCH_PATCH.x/metasrc-period-from-s-to-ms.patch
 +
</syntaxhighlight>
 +
 +
* Compile the plugin again using the steps from '[[GStreamer_In-Band_Metadata_for_MPEG_Transport_Stream/Getting_Started/Building_the_project#Compile_and_Install_plugin|Compile and Install plugin]]'.
  
 
<noinclude>
 
<noinclude>
{{GStreamer In-Band Metadata for MPEG Transport Stream/Foot|Getting Started/Getting the code|User Guide}}
+
{{GStreamer In-Band Metadata for MPEG Transport Stream/Foot|Getting Started/Building natively|User Guide}}
 
</noinclude>
 
</noinclude>

Latest revision as of 13:46, 6 March 2022


Previous: Getting Started/Building natively Index Next: User Guide





Overview

This page provides a guide to installing GstMetadata.

This plugin requires some patches on the GStreamer standard plugins to properly handle the metadata. There are 2 possible scenarios for the installation:

  • On GStreamer version installed in your system
  • On custom GStreamer environment

For both cases, a custom GStreamer environment is needed to install the patches. Follow the instructions on the Dependencies and Prerequisites sections to install the patches on the custom environment.

Dependencies

GstMetaData has the following dependencies:

  • gtk-doc-tools
  • libgstreamer1.0-dev
  • libgstreamer-plugins-base1.0-dev

Make sure you have the following GStreamer elements:

  • videotestsrc
  • xvimagesink
  • videoconvert
  • tsparse
  • tsdemux
  • mpegtsmux
  • h264parse
  • x264enc
  • avdec_h264

In Ubuntu 16.04 and 18.04 based systems, you may install the dependencies with the following command:

sudo apt-get install -y gtk-doc-tools libgtk2.0-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libmp3lame-dev

Prerequisites

An easy procedure to install a custom environment is available at Evaluating the project under the section Building the alternative GStreamer environment.

When the custom environment is ready, follow the instructions below to apply the patches. In case you want to use the plugin in the GStreamer version installed in your system, create an alternative environment with the same GStreamer version.

Install purchased gst-metadata source code

The first step is setting the required environment variables to place the code in the correct folder.

DEVDIR=~/Gst-versions
BRANCH="1.16.0"        #Example version used in the guide
GSTENV=$DEVDIR/$BRANCH

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

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

Patches Installation

Enter the custom GStreamer directory

cd $GSTENV

The directory should look as follows

ls $GSTENV

Expected output:

~/Gst-versions/1.16$ ls $GSTENV
gst-libav  gst-metadata  gst-plugins-bad  gst-plugins-base  gst-plugins-good  gst-plugins-ugly  gstreamer  prefix

If gst-metadata is not present here, copy the folder from where you cloned it:

cd $GSTENV
GSTMETADATA_LOCATION=~/gst-metadata/
cp $GSTMETADATA_LOCATION gst-metadata -r

Patch for GStreamer

Change to custom GStreamer version

cd $GSTENV
BRANCH_PATCH=1.16

Copy and apply patch file

cp gst-metadata/extras/gstreamer-$BRANCH_PATCH.x/fix-sparse-flag-setting-up.patch gstreamer/
cd gstreamer
git apply fix-sparse-flag-setting-up.patch

Patch for GStreamer plugins bad

Change to custom GStreamer version

cd $GSTENV
BRANCH_PATCH=1.16

Copy and apply patches

cp gst-metadata/extras/gstreamer-$BRANCH_PATCH.x/mpegtsmux-reference-clock-on-waiting-pad.patch gst-plugins-bad/
cp gst-metadata/extras/gstreamer-$BRANCH_PATCH.x/mpegtsmux-meta-specific-pad-templates.patch gst-plugins-bad/
cp gst-metadata/extras/gstreamer-$BRANCH_PATCH.x/tsmux-demux-update-klv-support.patch gst-plugins-bad/
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

Recompile plugins

Return to DEVDIR and enter the custom Gstreamer environment

cd $DEVDIR
./gst-$BRANCH

Recompile plugins

for module in `echo gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav`; do
    cd $module
    ./autogen.sh --disable-gtk-doc --disable-tests --disable-nls && make -j8
    cd -
done

At this point, the patches are applied in the custom environment

Compile and Install plugin

In Custom GStreamer Environment

Make sure that you are in the custom GStreamer environment.

Create the installation folder for GstMetadata

mkdir -p prefix/lib/gstreamer-1.0

Run the following commands to compile and install the plugin in the custom GStreamer environment.

cd gst-metadata/src
./autogen.sh
./configure --prefix $(realpath ../../prefix/)
make all
make install

Let's include the prefix path into the GST_PLUGIN_PATH environmental variable to load the meta plugin.

In case that after loading the custom GStreamer environment the meta plugin is not present, load the prefix path into the GST_PLUGIN_PATH environmental variable, in this guide $(realpath ../../prefix/) represents /home/gfallas/Gst-versions/1.8/prefix

export GST_PLUGIN_PATH=$(realpath ../../prefix/):$GST_PLUGIN_PATH

Now, GstMetadata is installed in the custom GStreamer environment.

In GStreamer's Default Path

This section is in case of installing the plugin into a GStreamer's default path on the system, use the arguments below according to the target platform

The configuration stage depend on the target system, use table below as reference:

System Configure Option
Ubuntu 64 bits --prefix /usr/ --libdir /usr/lib/x86_64-linux-gnu/
RidgeRun's Embedded FS --prefix /usr/
Jetson TX1 TX2 Xavier --prefix /usr/ --libdir /usr/lib/aarch64-linux-gnu/
Table 1. Platform configuration options

Run the next commands to configure and compile the plugin

cd gst-plugin-meta-1.0/src
./autogen
./configure $OPTIONS # CHOOSE THE APPROPRIATE CONFIGURATION FROM THE TABLE ABOVE
make all
sudo make install

Now, you will need the modified binaries from the custom GStreamer environment, this only applies when the GStreamer version and the custom version are the same.

The 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/

MY_PATH=/usr/lib/x86_64-linux-gnu
VERSION=1602

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

Then, copy the required libraries from the custom GStreamer environment. Remember to check the path according to the platform and the gstmetadata library location inside the prefix folder according to the tables above to copy it properly.

MY_PATH=/usr/lib/x86_64-linux-gnu
VERSION=1602

cd $GSTENV
sudo cp $GSTENV/prefix/lib/gstreamer-1.0/libgstmeta.so $MY_PATH/gstreamer-1.0/libgstmeta.so

sudo cp $GSTENV/gstreamer/libs/gst/base/.libs/libgstbase-1.0.so.0.$VERSION.0 $MY_PATH/libgstbase-1.0.so.0.$VERSION.0
sudo cp $GSTENV/gst-plugins-bad/gst-libs/gst/codecparsers/.libs/libgstcodecparsers-1.0.so.0.$VERSION.0 $MY_PATH/libgstcodecparsers-1.0.so.0.$VERSION.0
sudo cp $GSTENV/gst-plugins-bad/gst-libs/gst/mpegts/.libs/libgstmpegts-1.0.so.0.$VERSION.0 $MY_PATH/libgstmpegts-1.0.so.0.$VERSION.0

sudo cp $GSTENV/gst-plugins-bad/gst/mpegdemux/.libs/libgstmpegpsdemux.so $MY_PATH/gstreamer-1.0/libgstmpegpsdemux.so
sudo cp $GSTENV/gst-plugins-bad/gst/mpegtsmux/.libs/libgstmpegtsmux.so $MY_PATH/gstreamer-1.0/libgstmpegtsmux.so
sudo cp $GSTENV/gst-plugins-bad/gst/mpegtsdemux/.libs/libgstmpegtsdemux.so $MY_PATH/gstreamer-1.0/libgstmpegtsdemux.so

Now the binaries and GtsMetadata are installed in the system.

Verify

The plugin installation can be verified by running:

gst-inspect-1.0 meta

Expected output:

Plugin Details:
Name meta
Description Elements used to send and receive metadata
Filename /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmeta.so
Version 1.6.0
License Proprietary
Source module gst-plugin-meta
Binary package RidgeRun elements
Origin URL http://www.ridgerun.com

metasrc: Metadata Source
metasink: Metadata Sink
misbparser: MISB Parser

3 features:
+-- 3 elements

Enabling faster metadata

Enabling faster metadata will change the metasrc period capacity from seconds to milliseconds.

To write faster metadata with metasrc element from the metadata plugin, gst-plugin-bad needs an extra patch over the ones already needed to make gst-metadata work.

Patch process

Checking environment variables

  • First, make sure you have already followed the steps from the original instructions to make gst-metadata work. You should have the environment variables set-up:
export DEVDIR=~/Gst-versions
export BRANCH="1.14.5" #Example version used in the guide
export GSTENV=$DEVDIR/$BRANCH
export BRANCH_PATCH=1.14 #Example version used in the guide for the patch directory
  • And in $GSTENV, the following files should exist:
ls $GSTENV
gst-libav  gst-metadata  gst-plugins-bad  gst-plugins-base  gst-plugins-good  gst-plugins-ugly  gstreamer  prefix

Applying patch for gst-plugin-bad

  • Now, copy the faster-metadata-support.patch from the patches folder into the source directory of gst-plugin-bad:
cd $GSTENV
cp extras/gstreamer-$BRANCH_PATCH.x/faster-metadata-support.patch gst-plugins-bad/
cd gst-plugins-bad
git apply faster-metadata-support.patch
  • And compile it again:
./autogen.sh --disable-gtk-doc --disable-tests --disable-nls && make -j8

Applying patch for gst-metadata

  • Apply the patch needed by gst-metadata to enable sending information in milliseconds:
cd $GSTENV/gst-metadata
git apply extras/gstreamer-$BRANCH_PATCH.x/metasrc-period-from-s-to-ms.patch


Previous: Getting Started/Building natively Index Next: User Guide