Jump to content

GStreamer support - Digital Video Stabilizer Element

From RidgeRun Developer Wiki

Follow us on: YouTube Twitter LinkedIn Email Share this page

Share This Page

Preferred Partner Logo 3 Partner Program Banner




Introduction

To ease the usage of the RidgeRun Video Stabilization library, a GStreamer plug-in is included to perform Digital Image Stabilization (DIS) directly on a video stream. The rvsdigital element estimates frame-to-frame motion using optical flow, smooths the estimated transformations over a temporal window, and warps the video frames to reduce unwanted motion.

The element operates on RGBA video buffers and keeps internal stabilization state while the pipeline is running. Since DIS smoothing uses a temporal window, the element internally buffers frame and transformation data. The output frame is therefore produced from a delayed frame aligned with the smoothing window. The amount of delay depends mainly on the configured smoothing window.

This wiki covers the features, properties, supported formats, and basic usage of the rvsdigital element.

Enabling the Plug-in

To enable the plug-in, make sure to have compiled the GStreamer support in the library. It is possible to achieve this with -Denable-gstreamer=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 rvsdigital

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

Supported Formats

The supported formats on GStreamer are:

  • Input: RGBA
  • Output: RGBA

The sink and source pads accept video/x-raw RGBA buffers with unrestricted image dimensions and framerate ranges. The image dimensions are not constrained by the caps. However, it is highly recommended that the dimensions match a multiple of eight (8).

Features

The GStreamer plug-in included in the RidgeRun Video Stabilization library allows configuring digital image stabilization from the pipeline using element properties. Here is a list of features:

  • Optical Flow Motion Estimation: estimates frame-to-frame motion from the video stream using Pyramid Lucas-Kanade optical flow.
  • Temporal Smoothing: smooths the estimated transformations over a configurable number of frames.
  • Crop Margin Control: crops/scales the image to reduce black borders produced by the stabilization warp.
  • Half-Resolution Analysis: optionally runs the optical-flow analysis at half resolution to reduce processing cost while preserving the output resolution.
  • Backend Selection: selects the DIS processing backend from the element property.
  • Bypass Mode: disables stabilization and copies the input frame to the output frame when enable=false.

Properties

  • dis-backend: enumerator that selects the backend used by DIS. Options reported by the element are opencv, opencl, and cuda. Default: opencv.
    • Implementation note: in the current implementation, the element initializes the OpenCV and CUDA paths. Selecting opencl is listed by the GStreamer enum but is not handled by the element start path.
  • dis-crop-margin: crop margin used to avoid black regions after warping (float). Range: 0 to 0.99. Default: 0.07.
  • dis-half-resolution: enables half-resolution processing for the optical-flow analysis path (boolean). Default: true.
  • dis-smoothing-frames: number of frames taken into account for smoothing (integer). Range: 3 to 2147483647. Default: 5.
  • enable: enables image stabilization processing (boolean). If disabled, the input frame is copied to the output without stabilization. Default: true.
  • of-feature-max-corners: maximum number of corners to track for optical flow (integer). Range: 1 to 2147483647. Default: 1000.
  • of-feature-redetect-interval: interval, in frames, for refreshing tracked features (integer). Range: 1 to 2147483647. Default: 3.
  • of-flow-num-levels: number of Pyramid Lucas-Kanade levels used by optical flow (integer). Range: 1 to 2147483647. Default: 6.
  • qos: enables handling Quality-of-Service events. Default: true.
  • name: name of the GStreamer object. Default: rvsdigital0.

Missing Something?

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




Cookies help us deliver our services. By using our services, you agree to our use of cookies.