vvas_xvideodec

The Versal family of devices includes an IP called VDU which is designed for hardware accelerated video decoding. This IP is capable of decoding video formats such as H264, H265. Please refer to VDU PG414 for more information on the AMD/Xilinx VDU block.

vvas_xvideodec plugin controls the VDU IP for Video Decoding jobs. This plug-in is used only in PCIe/DC platform. For implementation details, refer to vvas_xvideodec source code

../../_images/video_decoder.png

Input and Output

This plug-in supports H264 and H265 encoded streams of various profile, level values as input. For complete list of supported profiles and levels, please refer to VDU PG414 The native output of this plugin is NV12 format. For any other desired output format, it should be software-converted and will affect performance.

Control Parameters and Plug-in Properties

The following table lists the GStreamer plug-in properties supported by the vvas_xvideodec plug-in.

Table 1: vvas_xvideodec Plug-in Properties

Property Name

Type

Range

Default

Description

additional-output-buffers

unsigned int

0 to 149

0

Use this property to specify the additional output buffers to be allocated by decoder in addition to the minimum buffers required by the VDU decoder.

avoid-output-copy

Boolean

True/False

False

Avoid output frames copy even when downstream does not support GstVideoMeta metadata.

avoid-dynamic-alloc

Boolean

True/False

True

Avoid dynamic allocation of output buffers

dev-idx

Integer

0 to 31

-1

Index of the device on which this instance to be created.

i-frame-only

Boolean

True/False

False

Whether to decode ‘I’ frames only or all frames from the given input stream.

instance-id

Integer

0 to 1

0

Specify one of the VDU hardware IP instance to be used.

force-decode-rate

Unsigned Integer

0 - 60000

0

Multiply the desired framerate by 1000 and set the parameter as unsigned integer. Ex:For framerate 29.97, set the value as 29970. Decoder HW resources will be allocated according to the rate chosen.

interpolate-timestamps

Boolean

True/False

False

Whether to interpolate timestamp or not.

kernel-name

String

N/A

kernel_vdu_decoder:

{kernel_vdu_decoder

_0}

Kernel name and instance separated by a colon.

low-latency

Boolean

True/False

False

Whether to enable low latency or not

num-entropy-buf

Unsigned Integer

2 - 10

2

Number of entropy buffers.

splitbuff-mode

Boolean

True/False

False

Whether to enable splitbuff mode or not

xclbin-location

String

N/A

null

The location of xclbin

Example Pipelines

The following pipeline takes MP4 file with H264 codec as an input and provides raw decoded output in NV12 format. Please refer above table for other parameters and values.

dev-idx represents the zero based index of the device on which this decoder to be launched. Please note that ‘dev-idx’ parameter range can vary from 0 to N-1 where N can be obtained with below command:

N=xbutil  examine | grep xilinx_v70 | wc -l
gst-launch-1.0 -v filesrc location=<input compressed H264 stream in MP4 container> \
! qtdemux ! h264parse \
! vvas_xvideodec kernel-name=kernel_vdu_decoder:{kernel_vdu_decoder_0} dev-idx=0 instance-id=0 avoid-output-copy=false xclbin-location=<xclbin file path> \
! fpsdisplaysink name=fpssink video-sink=fakesink text-overlay=false sync=false

kernel-name is mandatory and represents both the name of the decoder kernel as well as its instance. In above example, “kernel-name=kernel_vdu_decoder:{kernel_vdu_decoder_0}” represents decoder kernel name as “kernel_vdu_decoder” and instance “0”. Instance Id range can be known from the below command:

xbutil examine -d <PCI bdf>

Currently, 2 instances of video decoder IP (VDU) are supported and can be selected with the plugin parameter instance-id. Above example uses instance id = 0.