NVIDIA VPI GStreamer Plug-in - Examples - Videoconvert

From RidgeRun Developer Wiki


Previous: Examples/Overlay Index Next: Examples/Videoscale






Introduction

The vpivideoconvert element applies a format conversion between the sink and source caps.

Element properties

  • backend

Backend to use to execute VPI algorithms. Available options:

cpu: CPU backend
cuda: CUDA backend
pva: PVA backend (Xavier only)
vic: VIC backend

Flags: readable, writable
Default: "cuda"

  • conversion-policy

The policy used when converting between image types. Available Options:

cast: Casts input to the output type. Overflows and underflows are handled as per C specification, including situations of undefined behavior.
clamp: Clamps input to output's type range. Overflows and underflows are mapped to the output type's maximum and minimum representable value, respectively. When the output type is floating-point, the clamp behaves like the cast.

Flags: readable, writable
Default: "clamp"

  • scale

Factor on which to scale the conversion. Useful for type conversions.
Type: Float
Range: -3.4e+38 - 3.4e+38
Flags: readable, writable
Default: 1.0

  • offset

Offset to add to the conversion. Useful for type conversions. Available options:
Type: Float
Range: -3.4e+38 - 3.4e+38
Flags: readable, writable
Default: 0.0

NVIDIA VPI GStreamer Plug-in Videoconvert Example

The following example pipe will convert a video from BGR format to RGB. You may modify the properties values according to the information above.

  • Unified memory
gst-launch-1.0 videotestsrc ! video/x-raw,format=BGR ! vpiupload ! vpivideoconvert conversion-policy=cast ! vpidownload ! video/x-raw,format=RGB ! fakesink
  • NVMM memory
gst-launch-1.0 videotestsrc ! "video/x-raw,format=I420" ! nvvidconv bl-output=false ! "video/x-raw(memory:NVMM)" ! vpiupload ! vpivideoconvert conversion-policy=cast ! vpidownload ! video/x-raw,format=RGB ! fakesink


Previous: Examples/Overlay Index Next: Examples/Videoscale