Gst-nvdewarper
This plugin dewarps camera input. It accepts gpu-id and config-file as properties. Based on the selected configuration of surfaces, it can generate a maximum of four dewarped surfaces. It currently supports 18 dewarping projection types. Out of these, NVDS_META_SURFACE_FISH_PUSHBROOM and NVDS_META_SURFACE_FISH_VERTCYL are used in 360-D use case for dewarping 360° camera input.
The plugin performs its function in these steps:
- Reads the configuration file and creates a vector of surface configurations. It supports a maximum of four dewarp surface configurations.
- Receives the frame from the decoder. Based on the configuration, generates up to four dewarped surfaces.
- Scales these surfaces down to network/selected dewarper output resolution using
NPPAPIs. - Pushes a buffer containing the dewarped surfaces to the downstream component.

Inputs and Outputs
-
Inputs
- A buffer containing a frame in RGBA format
-
Control parameters
- gpu-id; selects the GPU ID (dGPU only)
- config-file, containing the pathname of the dewarper configuration file
-
Output
- Dewarped RGBA surfaces
NvDewarperSurfaceMetawith information associated with each surface (projection_type,surface_index, andsource_id), and the number of valid dewarped surfaces in the buffer (num_filled_surfaces)
Features
The following table summarizes the features of the plugin.
Gst-nvdewarper features
Configuration File Parameters
The configuration file located at configs/deepstream-app/config_dewarper.txt.
The configuration file specifies per-surface configuration parameters in [surface<n>] groups, where <n> is an integer from 0 to 3, representing dewarped surfaces 0 to 3.
Gst-nvdewarper configuration file [surface<n>] parameters
In case viewing angles (top & bottom)/dst-focal-length/dst-principal-point are not provided, the destination center of projection (Principal Point) and Focal Length are kept the same as the source.
To increase the flexibility, num-batch-buffers is also a GstProperty. The plugin properties are parsed in order, so if num-batch-buffers is passed both attached to the GstElement in the gstreamer pipeline (eg. with gst-launch-1.0 command), and in the configuration file, the latest configuration applied will be used (see example below).
Example:
- Config file (
config_dewarper.txt) withnum-batch-buffers=2. - Command Line argument with property
num-batch-buffers=1.
Pipelines:
gst-launch-1.0 … ! nvdewarper config-file=config_dewarper.txt num-batch-buffers=1 ! …gst-launch-1.0 … ! nvdewarper num-batch-buffers=1 config-file=config_dewarper.txt ! …
Pipeline 1 will result in 1 surface per buffer whereas pipeline 2 will result in 2 surfaces per buffer.
This plugin can be tested with the one of the following pipelines.
- For dGPU:
- For Jetson:
The Gst-nvdewarper plugin always outputs a GStreamer buffer which contains the number of dewarped surfaces defined by num-batch-buffers (currently maximum of four surfaces are supported). These dewarped surfaces are scaled to the output resolution (output-width × output-height) set in the configuration file.
Also, the num-surfaces-per-frame and batch-size of Gst-nvstreammux must be set accordingly. Batch-size must be a multiple of the number of dewarped surfaces, which should be set in num-surfaces-per-frame.
Gst Properties
The following table describes the Gst-nvdewarper plugin’s Gst properties.
Gst-nvdewarper gst properties