NVIDIA VPI GStreamer Plug-in/Examples/Videoscale: Difference between revisions

From RidgeRun Developer Wiki
mNo edit summary
mNo edit summary
 
Line 39: Line 39:


*Unified memory
*Unified memory
<source lang=bash>
<syntaxhighlight lang="bash">
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
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
</source>
</syntaxhighlight>


*NVMM memory
*NVMM memory
<source lang=bash>
<syntaxhighlight lang="bash">
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
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
</source>
</syntaxhighlight>


<noinclude>
<noinclude>
{{NVIDIA VPI GStreamer Plug-in/Foot|Examples/Videoconvert|Examples/Convolution }}
{{NVIDIA VPI GStreamer Plug-in/Foot|Examples/Videoconvert|Examples/Convolution }}
</noinclude>
</noinclude>

Latest revision as of 17:41, 8 May 2024



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