NVIDIA VPI GStreamer Plug-in - Examples - Videoscale

From RidgeRun Developer Wiki


Previous: Examples/Videoconvert Index Next: Examples/Convolution






Introduction

The vpivideoscale element applies the Rescale algorithm in order to rescale video from one resolution to another using VPI.

Videoscale 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"

  • interpolator

Interpolation method to be used. Available options:

nearest: Nearest neighbor interpolation
linear: Fast linear interpolation
catmull: Fast Catmull-Ron cubic interpolation

Flags: readable, writable
Default: linear

  • boundary

How pixel values outside of the image domain should be treated. Available options:

zero: All pixels outside the image are considered 0
clamp: Border pixels are repeated indefinitely
reflect: Pixels are reflected like this edcba|abcde|edcba
mirror: Pixels are mirrored like this dedcb|abcde|dcbab

Flags: readable, writable
Default: "zero"

NVIDIA VPI GStreamer Plug-in Videoscale Example

The following example pipe will help you rescale the input video stream from 1080P to 720P. You may modify the properties values according to the information above.

  • Unified memory
gst-launch-1.0 videotestsrc is-live=true ! video/x-raw,width=1920,height=1080 ! vpiupload ! vpivideoscale ! "video/x-raw(memory:VPIImage),width=1280,height=720" ! vpidownload ! fakesink
  • NVMM memory
gst-launch-1.0 videotestsrc is-live=true ! nvvidconv bl-output=false ! video/x-raw(memory:NVMM),width=1920,height=1080 ! vpiupload ! vpivideoscale ! "video/x-raw(memory:VPIImage),width=1280,height=720" ! vpidownload ! fakesink


Previous: Examples/Videoconvert Index Next: Examples/Convolution