Gst-nvvideo4linux2

DeepStream extends the open source V4L2 codec plugins (here called Gst-v4l2) to support hardware-accelerated codecs.

Gst-nvvideo4linux2

Decoder

The OSS Gst-nvvideo4linux2 plugin leverages the hardware decoding engines on Jetson and DGPU platforms by interfacing with libv4l2 plugins on those platforms. It supports H.264, H.265, JPEG and MJPEG formats. The plugin accepts an encoded bitstream and uses the NVDEC hardware engine to decode the bitstream. The decoded output is in NV12 format.

Note

When you use the v4l2 decoder for decoding JPEG images, you must use the open source jpegparse plugin before the decoder to parse encoded JPEG images.

Inputs and Outputs

  • Inputs

    • An encoded bitstream. Supported formats are H.264, H.265, JPEG and MJPEG

  • Control Parameters

    • gpu-id

    • num-extra-surfaces

    • skip-frames

    • cudadec-memtype

    • drop-frame-interval

    • low-latency-mode

  • Output

    • Gst Buffer with decoded output in NV12 format

Features

The following table summarizes the features of the Gst-nvvideo4linux2 decoder plugin.

Gst-nvvideo4linux2 plugin decoder features

Feature

Description

Release

Supports H.264 decode

DS 4.0

Supports H.265 decode

DS 4.0

Supports JPEG/MJPEG decode

_

DS 4.0

User-configurable CUDA memory type (Pinned/Device/Unified) for output buffers

DS 4.0

Gst Properties

The following table summarizes the Gst properties of the Gst-nvvideo4linux2 decoder plugin.

Gst-nvvideo4linux2 plugin decoder gst properties

Property

Meaning

Type and Range

Example/Notes

Platforms

gpu-id

Device ID of GPU to use for decoding.

Integer, 0 to 4,294,967,295

gpu-id=0

dGPU

num-extra-surfaces

Number of surfaces in addition to min decode surfaces given by the V4L2 driver.

Integer, 1 to 24

num-extra-surfaces=24 Default: 0

dGPU Jetson

skip-frames

Type of frames to skip during decoding. Represented internally by enum SkipFrame.

0 (decode_all): decode all frames

1 (decode_non_ref): skips non-ref frames (Applicable only on Jetson platform)

2 (decode_key): decode key frames

Integer, 0, 1, or 2

skip-frames=0 Default: 0

dGPU Jetson

drop-frame-interval

Interval to drop the frames, e.g. a value of 5 means the decoder outputs every fifth frame, and others are dropped.

Integer, 1 to 30

Default: 0

dGPU Jetson

cudadec-memtype

Memory type for CUDA decoder buffers. Represented internally by enum CudaDecMemType.

0 (memtype_device): Device

1 (memtype_pinned): Host Pinned

2 (memtype_unified): Unified

Integer, 0, 1, or 2

cuda-memory-type=1 Default: 2

dGPU

low-latency-mode

Set low latency mode for bitstreams having I and IPPP frames with no B frames

Boolean

Default: false

dGPU

Encoder

The OSS Gst-nvvideo4linux2 plugin leverages the hardware accelerated encoding engine available on Jetson and dGPU platforms by interfacing with libv4l2 plugins on those platforms. The plugin accepts RAW data in I420 format. It uses the NVENC hardware engine to encode RAW input. Encoded output is in elementary bitstream supported format.

Inputs and Outputs

  • Inputs RAW input in I420 format

  • Control parameters

    • gpu-id (dGPU only)

    • profile

    • bitrate

    • control-rate

    • iframeinterval

  • Output

    • Gst Buffer with encoded output in H264 and H265 format.

Features

The following table summarizes the features of the Gst-nvvideo4linux2 encoder plugin.

Gst-nvvideo4linux2 plugin encoder features

Feature

Description

Release

Supports H.264 encode

DS 4.0

Supports H.265 encode

DS 4.0

Gst Properties

The following table summarizes the Gst properties of the Gst-nvvideo4linux2 encoder plugin.

Gst-nvvideo4linux2 plugin encoder gst properties

Property

Meaning

Type and Range

Example/Notes

Platforms

gpu-id

Device ID of GPU to used.

Integer, 0 to 4,294,967,295

gpu-id=0

dGPU

bitrate

Sets bitrate for encoding, in bits/seconds.

Integer, 0 to 4,294,967,295

Default:4000000

dGPU Jetson

iframeinterval

Encoding intra-frame occurrence frequency.

Integer, 0 to 4,294,967,295

Default: 30

dGPU Jetson

Profile

H.264/H.265 encoder profile; represented internally by enum GstV4l2VideoEncProfileType. For H.264:

0 (GST_V4L2_H264_VIDENC_BASELINE_PROFILE): Baseline

2 (GST_V4L2_H264_VIDENC_MAIN_PROFILE): Main

4 (GST_V4L2_H264_VIDENC_HIGH_PROFILE): High

For H.265:

0 (GST_V4L2_H265_VIDENC_MAIN_PROFILE): Main

1 (GST_V4L2_H265_VIDENC_MAIN10_PROFILE): Main10

Values of enum GstV4l2VideoEncProfileType

Default Baseline Default: 0

dGPU Jetson