Gst-nvvideotestsrc

The Gst-nvvideotestsrc plugin uses CUDA to generate video test data in a variety of formats and patterns that is written directly to GPU output buffers using the video/x-raw(memory:NVMM) data type.

Note

The Gst-nvvideotestsrc plugin is currently only supported on X86.

Outputs

This section summarizes the outputs of the Gst-nvvideotestsrc plugin.

  • Output

    • Gst Buffer with a test pattern

    • Video Format: NV12, I420, RGBA (NVMM)

  • Control parameters

    • gpu-id

    • animation-mode

    • memtype

    • blocksize

    • pattern

Gst Properties

The following tables describes the Gst properties of the Gst-nvvideotestsrc plugin.

nvvideotestsrc plugin properties

Property

Meaning

Type and Range

Example notes

animation-mode

For animating patterns, the counter that controls the animation.

Enum “GstNvVideoTestSrcAnimationMode” Default: 0, “frames”

(0): frames - Frame count

(1): wall-time - Wall clock time

(2): running-time - Running time

animation-mode=0

blocksize

Size in bytes to read per buffer (-1 = default)

Unsigned Integer. Range: 0 - 4294967295 Default: 4096

blocksize=4096

gpu-id

ID of the GPU where the buffers are allocated

Unsigned Integer. Range: 0 - 2147483647 Default: 0

gpu-id=0

num-buffers

Number of buffers to output before sending EOS (-1 = unlimited)

Integer. Range: -1 - 2147483647 Default: -1

num-buffers=300

pattern

Type of test pattern to generate

Enum “GstNvVideoTestSrcPattern” Default: 0, “smpte”

(0): smpte - SMPTE color bars

(1): mandelbrot - Mandelbrot set

(2): gradient - Gradient

pattern=1

memtype

Type of the memory used for the allocated buffers

Enum “NvBufSurfaceMemType” Default: 2, “Device CUDA memory”

(1): Host/Pinned CUDA memory - host

(2): Device CUDA memory - device

(3): Unified CUDA memory - unified

memtype=2

do-timestamp

Apply current stream time to buffers

Boolean. Default: false

do-timestamp=true

How to test

nvvideotestsrc is currently supported for X86 only. support with “Jetson + dGPU” is not yet enabled.

Run following reference gst-launch-1.0 pipeline on DGPU setup.

  1. Default SMPTE Pattern - 720p 60Hz

gst-launch-1.0 nvvideotestsrc ! queue ! nveglglessink -e
  1. Mandelbrot Pattern - 1080p 60Hz

gst-launch-1.0 nvvideotestsrc pattern=mandelbrot ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=60/1' ! queue ! nveglglessink -e
  1. Gradient Pattern - 720p 60Hz

gst-launch-1.0 gst-launch-1.0 nvvideotestsrc pattern=2 ! queue ! nveglglessink -e