GStreamer In-Band Metadata for MPEG Transport Stream - Getting Started - Building the project

From RidgeRun Developer Connection
< GStreamer In-Band Metadata for MPEG Transport Stream‎ | Getting Started
Revision as of 23:46, 19 October 2020 by Gfallas (talk | contribs) (Compile and Install plugin)
Jump to: navigation, search


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





Overview

This page provides a guide to install GstMetadata.

This plugin requires some patches on the GStreamer's 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 Prerequisites section to install the patches.

Prerequisites

An easy procedure to install a custom environment is available at Evaluation 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.

Patches Installation

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

DEVDIR=~/Gst-versions
BRANCH="1.16"        #Example version used in the guide
GSTENV=$DEVDIR/$BRANCH
  • Move or clone GstMetadata

Enter the custom GStreamer directory

cd $GSTENV

Clone, copy or more GstMetadata to the custom GStreamer environment, the directory should look as follows

ls $GSTENV

Expected output:

gfallas@gfallas-G5-5587:~/Gst-versions/1.16$ ls $GSTENV
gst-libav  gst-metadata  gst-plugins-bad  gst-plugins-base  gst-plugins-good  gst-plugins-ugly  gstreamer  prefix
  • Patch for GStreamer

Change to custom GStreamer version

cd $GSTENV

Create placeholder for patch file

cd gstreamer
quilt new fix-sparse-flag-setting-up.patch
quilt add libs/gst/base/gstcollectpads.c
quilt pop -a

Copy and apply patch file

cp ../gst-metadata/extras/fix-sparse-flag-setting-up.patch patches/
quilt push -a
quilt refresh
  • Patch for GStreamer plugins bad

Change to custom GStreamer version

cd $GSTENV

Create placeholder for patch file

cd gst-plugins-bad
quilt new mpegtsmux-reference-clock-on-waiting-pad.patch
quilt add gst/mpegtsmux/mpegtsmux.c
quilt pop -a

Copy and apply patch file

cp ../gst-metadata/extras/mpegtsmux-reference-clock-on-waiting-pad.patch patches/
quilt push -a
quilt refresh
  • 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

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

Compile and Install plugin

Make sure that you are in the custom GStreamer environment.

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

In case of installing the plugin into a GStreamer's default path, 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

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


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