GstRerunSink - Building and Installation Guide

From RidgeRun Developer Wiki



Previous: Features and Limitations Index Next: Examples




Getting the Code

GstRerunSink is an open-source project. You can download the full source code from the Git repository:

Info
Soon!


Dependencies

GstRerunSink is supported on Jetson, NXP, and PC systems and almost any Linux system with GStreamer-1.20. The following packages are needed in order to build and use GstCUDA:

  • GStreamer 1.20.0 version or greater:
    • gstreamer-1.0
    • gstreamer-plugins-base-1.0
    • gstreamer-base-1.0
    • gstreamer-check-1.0
    • gstreamer-video-1.0
    • gstreamer-controller-1.0
    • gstreamer-plugins-bad-1.0
  • CMake 3.16 or higher
  • C++14 compatible compiler
  • Rerun SDK (automatically downloaded during build)

Additionally, for NVMM support the following packages are required:

  • CUDA Toolkit
  • NVIDIA DeepStream SDK 6.3

GStreamer

The GStreamer packages are likely already installed in your Ubuntu OS distribution. In case you want to double-check and install the missing packages, run the following commands.

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-bad

CUDA L4T package

The Jetpack default installation will flash and install all the necessary CUDA packages. This section describes how to perform a manual installation, which is typically not needed.

Installation guide:

1. You will need to know which distribution version you are using:

lsb_release -a

2. Go to the CUDA 11.6.1 download archive and follow the selection menu.

Select the version depending on the lsb_release command executed above. We recommend using the deb (local) option for the installation.

3. Once you have selected your system setup, NVIDIA will show you the installation instructions for those requirements.


DeepStream SDK

The DeepStream SDK can be install using SDK Managerby selecting it in the Additional SDKs section before flashing. Alternatively, it can be installed using a Debian package, which can be downloaded from Nvidia's repository. After downloading the corresponding Debian package use the following command to install the SDK:

sudo apt-get install ./deepstream-7.1_7.1.0-1_arm64.deb

Building the project

The GstRerunsink package must be built natively. There are two alternatives to build the project, which are using the provided building script or building manually.

Using the build script

There are several options when using the build script, which are shown in the following commands:

# Basic build (CPU support only)
./build.sh

# Build with NVMM support
./build.sh --nvmm

# Clean build with installation
./build.sh --clean --install

# Debug build with verbose output
./build.sh --debug --verbose

Select the desired option and the execute the corresponding command.

Manual build

It is also possible to perform a manual build of the project if desired. The steps to perform a manual build are shown in this subsection.

Without NVMM support

To build the project with CPU support only execute the following commands:

mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Release ..

make -j$(nproc)

With NVMM support

In order to build it with NVMM support, use the following commands instead:

mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Release -DWITH_NVMM_SUPPORT=ON ..

make -j$(nproc)

Build options

Additionally, when building manually the following options are provided:

Build Options
Option Description Default
WITH_NVMM_SUPPORT Enable NVIDIA GPU memory support OFF
CMAKE_BUILD_TYPE Build configuration (Debug/Release) Release

Installing the plugin

The plugin is installed to the GStreamer's default plug-in location in the file system by running:

sudo make install

To verify that the plug-in was correctly installed, you should run:

gst-inspect-1.0 gstrerunsink

with expected output

gst-inspect-1.0 rerunsink
Factory Details:
  Rank                     none (0)
  Long-name                RerunSink
  Klass                    Sink/Video
  Description              Video sink that logs frames to Rerun for visualization
  Author                   Frander Diaz <frander.diaz@ridgerun.com>

Plugin Details:
  Name                     rerunsink
  Description              GStreamer sink plugin for Rerun visualization
  Filename                 ./libgstrerunsink.so
  Version                  1.0
  License                  LGPL
  Source module            rerunsink
  Binary package           GStreamer Rerun Sink
  Origin URL               https://github.com/rerun-io/rerun

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSink
                         +----GstVideoSink
                               +----GstRerunSink

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: { (string)NV12, (string)I420, (string)RGB, (string)GRAY8, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw(memory:NVMM)
                 format: { (string)NV12 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: video/x-h264
          stream-format: { (string)avc, (string)byte-stream }
      video/x-h265
          stream-format: { (string)hvc1, (string)hev1, (string)byte-stream }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'

Element Properties:
  async               : Go asynchronously to PAUSED
                        flags: readable, writable
                        Boolean. Default: true
  blocksize           : Size in bytes to pull per buffer (0 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  enable-last-sample  : Enable the last-sample property
                        flags: readable, writable
                        Boolean. Default: true
  grpc-address        : gRPC server address (if non-default, connects via gRPC instead of spawning viewer)
                        flags: readable, writable
                        String. Default: "127.0.0.1:9876"
  image-path          : Entity path for logging images (e.g. 'camera/front/frame')
                        flags: readable, writable
                        String. Default: null
  last-sample         : The last sample received in the sink
                        flags: readable
                        Boxed pointer of type "GstSample"
  max-bitrate         : The maximum bits per second to render (0 = disabled)
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  max-lateness        : Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited)
                        flags: readable, writable
                        Integer64. Range: -1 - 9223372036854775807 Default: 5000000 
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "rerunsink0"
  output-file         : Path to output .rrd file (if set, saves to disk instead of spawning viewer)
                        flags: readable, writable
                        String. Default: null
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  processing-deadline : Maximum processing deadline in nanoseconds
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 15000000 
  qos                 : Generate Quality-of-Service events upstream
                        flags: readable, writable
                        Boolean. Default: true
  recording-id        : Rerun recording/session identifier
                        flags: readable, writable
                        String. Default: null
  render-delay        : Additional render delay of the sink in nanoseconds
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  show-preroll-frame  : Whether to render video frames during preroll
                        flags: readable, writable
                        Boolean. Default: true
  spawn-viewer        : Spawn a Rerun viewer instance (ignored if output-file is set or grpc-address is non-default)
                        flags: readable, writable
                        Boolean. Default: true
  sync                : Sync on the clock
                        flags: readable, writable
                        Boolean. Default: true
  throttle-time       : The time to keep between rendered buffers (0 = disabled)
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  ts-offset           : Timestamp offset in nanoseconds
                        flags: readable, writable
                        Integer64. Range: -9223372036854775808 - 9223372036854775807 Default: 0

After installing GstRerunSink and all its dependencies, the Linux OS running on your platform must be rebooted before running a GStreamer pipeline that uses GstRerunSink.



Previous: Features and Limitations Index Next: Examples