Skip to navigation

Gst-nvvideotestsrc

View as Markdown

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.

The plugin can also be used to input raw video and generate GPU buffers at the output. The plugin provides properties to introduce jitter in buffer latencies which can be used to simulate network conditions locally.

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, UYVP, BGRA64_LE, RGB10A2_LE (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

PropertyMeaningType and RangeExample notes
animation-modeFor 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
blocksizeSize in bytes to read per buffer (-1 = default)Unsigned Integer. Range: 0 - 4294967295 Default: 4096blocksize=4096
gpu-idID of the GPU where the buffers are allocatedUnsigned Integer. Range: 0 - 2147483647 Default: 0gpu-id=0
num-buffersNumber of buffers to output before sending EOS (-1 = unlimited)Integer. Range: -1 - 2147483647 Default: -1num-buffers=300
patternType of test pattern to generateEnum “GstNvVideoTestSrcPattern” Default: 0, “smpte
(0): smpte - SMPTE color bars
(1): mandelbrot - Mandelbrot set
(2): gradient - Gradient
pattern=1
memtypeType of the memory used for the allocated buffersEnum “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-timestampApply current stream time to buffersBoolean. Default: falsedo-timestamp=true
is-liveWhether to act as a live source. Introduces latency based on FPS setting on src capsBoolean. Default: falseis-live=true
locationFile location for raw video file input. When file location is not specified,
pattern gets used.
String. Default: NULLlocation=test.rgba
file-loopLoop through the input file until num-buffers (if specified) or infinitelyBoolean. Default: falsefile-loop=true
max-jitterMaximum jitter (in milliseconds) that can be applied to each buffer. Only applicable when is-live=true. A random jitter ranging up to “max-jitter” gets applied to each buffer.Integer, ≥0 Default: 0max-jitter=100
fixed-jitterList of fixed jitter values (in milliseconds). The list will be looped through for the entire sequence. Only applicable when is-live=true. If “fixed-jitter” is specified “max-jitter”(if specified) is ignored.Semicolon delimited integer array. all values ≥0. Default:fixed-jitter=30;40;100;0;0
horizontal-speedHorizontal speed of the SMPTE pattern in pixels per frame. Positive values move to the left; negative to the rightInteger. Default: 0horizontal-speed=1

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.

A) Default SMPTE Pattern - 720p 60Hz

gst-launch-1.0 nvvideotestsrc ! queue ! nveglglessink -e

B) 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

C) Gradient Pattern - 720p 60Hz

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