GStreamer support - Analyzer Element

From RidgeRun Developer Wiki

Follow Us On Twitter LinkedIn Email Share this page








Introduction

Aiming to quantify the quality of the stabilization after applying RVS, we provide a GStreamer element to extract metrics such as the SSIM and Optical Flow Jitter in pixels, providing insights during a tuning process of how much the video stabilization quality improves.

This element is implemented in the CPU, and it is not intended for performance. If you require it to be integrated for QoS purposes, you can contact us to extend the feature.

This wiki will cover the features, properties, and supported formats.

Enabling the Plug-in

To enable the plug-in, make sure to have compiled the GStreamer and OpenCV support in the library. It is possible to achieve this with -Denable-gstreamer=enabled -Denable-opencv=enabled. By default, it should have been enabled (see Building the Project).

After the installation, please check the element by using:

gst-inspect-1.0 rvsanalyze

It should show the inspect with details about the formats, properties, signals, and others.

Supported Formats

The supported formats on GStreamer are:

  • Input: NV12, I420
  • Output: NV12, I420

The image dimensions are not constrained, but it is recommended to be four times smaller than the stabilised. For instance, for 1920x1080, the input of the rvanalyze should be 480x270.

Features

The rvsanalyze included in the RidgeRun Video Stabilization library allows the quantification of the SSIM and Jitter with respect to its input size.

It uses the Luminance channel to compute the SSIM and Optical Flow Farneback algorithm for the Jitter, all in single-precision floating point.

Properties

  • enable-metric-signals: enable signaling the metrics. Otherwise, the results should be obtained through the debug messages.

Signals

The signal metrics:

  "signal-metrics" :  void user_function (GstElement * object,
                                          guint64 presentation_time_us,
                                          guint64 camera_timestamp_us,
                                          gfloat ssim,
                                          gfloat jitter,
                                          gpointer user_data);

There is an example available in examples/gstreamer/sample_optical_flow_metrics_app.cpp

Simple example

To get an example, you can use the following pipeline:

export GST_DEBUG=rvsanalyze:LOG 
gst-launch-1.0 videotestsrc pattern=smpte is-live=1 ! \
               video/x-raw,width=1920,height=1080,format=RGBA ! \
               videoconvert ! queue ! videoscale ! \
               video/x-raw,width=480,height=270,format=NV12 ! \
               rvsanalyze ! fakesink

Missing Something?

Do you need another format, memory type, sensor, or platform? Let's talk and add them together: Please Contact RidgeRun..