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

From RidgeRun Developer Wiki
mNo edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{NVIDIA VPI GStreamer Plug-in/Head|previous=Examples/Videoconvert|next=Examples/Convolution|keywords=}}
{{NVIDIA VPI GStreamer Plug-in/Head|previous=Examples/Videoconvert|next=Examples/Convolution|metakeywords=vpivideoscale, Videoscale}}
</noinclude>
</noinclude>


Line 6: Line 6:
The '''vpivideoscale''' element applies the [https://docs.nvidia.com/vpi/algo_rescale.html| Rescale algorithm] in order to rescale video from one resolution to another using VPI.
The '''vpivideoscale''' element applies the [https://docs.nvidia.com/vpi/algo_rescale.html| Rescale algorithm] in order to rescale video from one resolution to another using VPI.


== Element properties ==
== Videoscale Element properties ==


* '''backend'''<br/>
* '''backend'''<br/>
Line 34: Line 34:
Default: "zero"<br/>
Default: "zero"<br/>


== Example ==
== 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.  
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.  


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