Building GstRTMPMetadata project

From RidgeRun Developer Wiki

Follow Us On Twitter LinkedIn Email Share this page






NVIDIA partner logo NXP partner logo




Building GStreamer with RTMP Metadata Support

The support is delivered as a set of patches organized by GStreamer version.

Meson & Ninja

The project uses the Meson build system together with Ninja as backend.

sudo apt install python3 python3-pip python3-setuptools python3-wheel ninja-build
sudo -H pip3 install meson

Building the project

export GST_DIR=/path/to/gstreamer
export RTMP_DIR=/path/to/gst-rtmpmetadata

For GStreamer 1.20 and newer

Clone the official GStreamer repository and checkout the stable branch:

git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git
cd gstreamer
git checkout x.xx (ej. 1.20)

Apply our custom patches:

git am -3 $RTMP_DIR/extras/*.patch

Configure, build and test using Meson from the GStreamer root:

# Go to your GStreamer clone
cd $GST_DIR

# Configure the build
meson setup builddir \
   --reconfigure \
   -Dtests=disabled \
   -Dexamples=disabled \
   -Dgtk_doc=disabled

# Build
ninja -C builddir

Test with Meson’s development environment (no install required):

meson devenv -C builddir
gst-inspect-1.0 flvmux
gst-inspect-1.0 flvdemux

For GStreamer 1.16.x

For GStreamer 1.16.x you will need to use a different branch and URL.

Use the following commands:

git clone https://github.com/GStreamer/gst-build
cd gst-build

# Create a worktree for 1.16.x
./gst-worktree.py add gst-build-1.16 origin/1.16
cd gst-build-1.16

Then apply the RidgeRun RTMP metadata support patches for 1.16.x.

cd subprojects/gst-plugins-base
git am -3 $RTMP_DIR/extras/001.patch

cd ../gst-plugins-good
git am -3 $RTMP_DIR/extras/002.patch

Use the gst-build layout. The commands are slightly different because the patches are applied inside the `gst-build-1.16` tree.

# Go to your gst-build clone
cd $GST_DIR/gst-build-1.16

# Configure the build
meson setup build \
   --reconfigure \
   -Dtests=disabled \
   -Dexamples=disabled \
   -Dgtk_doc=disabled

# Build
ninja -C build

Test with development environment:

python3 gst-uninstalled.py 
gst-inspect-1.0 flvmux
gst-inspect-1.0 flvdemux

Warning: If you prefer to install system-wide, use `ninja -C builddir install` (or `ninja -C build install` for 1.16), but this may replace your existing GStreamer installation.

Configuration Options

These are general GStreamer configuration options that may be useful during the build process:

Configure Option Description
-Dexamples=disabled Skip compiling example applications
-Dtests=disabled Skip test suite build
-Dgtk_doc=disabled Disable documentation generation
--prefix=/usr Define installation path

Table 1. Example Meson configuration options

Checking the Features

After building, you can confirm that the patched FLV elements expose the new properties and signals. For the FLV Mux:

gst-inspect-1.0 flvmux

Expected output should include:

Element Properties: 
  meta-binary         : Binary metadata (GBytes)
                        flags: readable, writable
                        Boxed pointer of type "GBytes"
  meta-string         : Custom string to include as metadata
                        flags: readable, writable
                        String. Default: null
  metadatacreator     : The value of metadatacreator in the meta packet.
                        flags: readable, writable
                        String. Default: "GStreamer 1.20.7.1 FLV muxer"

For the FLV Demux:

gst-inspect-1.0 flvdemux

Expected output should include:

Element Properties:
  attach-flvmeta      : Attach custom onMetaData (meta-*) as GstFlvMeta to first audio a
nd video buffers
                        flags: readable, writable
                        Boolean. Default: false
  flv-meta-signal     : Emit a signal carrying custom onMetaData (meta-*) payload as GBy
tes