Difference between revisions of "GStreamer In-Band Metadata for MPEG Transport Stream/Getting Started/Building the project"
(→Linux) |
|||
Line 4: | Line 4: | ||
__TOC__ | __TOC__ | ||
− | This page provides a guide to install | + | |
+ | ==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 [https://developer.ridgerun.com/wiki/index.php?title=GStreamer_In-Band_Metadata_for_MPEG_Transport_Stream/Getting_Started/Evaluating_the_project Evaluation the project] under the section [https://developer.ridgerun.com/wiki/index.php?title=GStreamer_In-Band_Metadata_for_MPEG_Transport_Stream/Getting_Started/Evaluating_the_project#Building_the_alternative_GStreamer_environment 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. | ||
+ | |||
+ | <syntaxhighlight lang=bash> | ||
+ | DEVDIR=~/Gst-versions | ||
+ | BRANCH="1.16" #Example version used in the guide | ||
+ | GSTENV=$DEVDIR/$BRANCH | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * Move or clone GstMetadata | ||
+ | |||
+ | Enter the custom GStreamer directory | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cd $GSTENV | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Clone, copy or more GstMetadata to the custom GStreamer environment, the directory should look as follows | ||
+ | <syntaxhighlight lang=bash> | ||
+ | ls $GSTENV | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Expected output: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | 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 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * Patch for GStreamer | ||
+ | |||
+ | Change to custom GStreamer version | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cd $GSTENV | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Create placeholder for patch file | ||
+ | |||
+ | <syntaxhighlight lang=bash> | ||
+ | cd gstreamer | ||
+ | quilt new fix-sparse-flag-setting-up.patch | ||
+ | quilt add libs/gst/base/gstcollectpads.c | ||
+ | quilt pop -a | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Copy and apply patch file | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cp ../gst-metadata/extras/fix-sparse-flag-setting-up.patch patches/ | ||
+ | quilt push -a | ||
+ | quilt refresh | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * Patch for GStreamer plugins bad | ||
+ | |||
+ | Change to custom GStreamer version | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cd $GSTENV | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Create placeholder for patch file | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cd gst-plugins-bad | ||
+ | quilt new mpegtsmux-reference-clock-on-waiting-pad.patch | ||
+ | quilt add gst/mpegtsmux/mpegtsmux.c | ||
+ | quilt pop -a | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Copy and apply patch file | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cp ../gst-metadata/extras/mpegtsmux-reference-clock-on-waiting-pad.patch patches/ | ||
+ | quilt push -a | ||
+ | quilt refresh | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | * Recompile plugins | ||
+ | Return to DEVDIR and enter the custom Gstreamer environment | ||
+ | <syntaxhighlight lang=bash> | ||
+ | cd $DEVDIR | ||
+ | ./gst-$BRANCH | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Recompile plugins | ||
+ | <syntaxhighlight lang=bash> | ||
+ | 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 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | At this point, the patches are applied in the custom environment | ||
==Dependencies== | ==Dependencies== | ||
Line 33: | Line 138: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ==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. | ||
− | <syntaxhighlight lang='bash'> | + | <syntaxhighlight lang='bash'> |
− | + | cd gst-metadata/src | |
+ | ./autogen | ||
+ | ./configure --prefix $(realpath prefix/) | ||
+ | make all | ||
+ | make install | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 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: | The configuration stage depend on the target system, use table below as reference: | ||
<html> | <html> |
Revision as of 19:33, 19 October 2020
GStreamer In-Band Metadata for MPEG Transport Stream | |
---|---|
MPEG TS Metadata Basics | |
|
|
Getting Started | |
|
|
User Guide | |
|
|
Examples | |
|
|
FAQ | |
Contact Us |
Contents
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
./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/ |
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