The pages provides detailed instructions for running the VCU Region of Intrest (ROI) Demo on the ZCU104 and ZCU106 boards running Certified Ubuntu 20.04 LTS for Xilinx Devices.
...
It is important to set up the video pipeline with a resolution and refresh rate that matches something your monitor is able to support. In order to find out which resolutions your monitor can support, use the modetest
command with the syntax below. It is important to use the device a00c0000.v_mix
as this corresponds to the video mixer IP.
Code Block |
---|
$ sudo modetest -cD a00c0000.v_mix | head -n 32 |
|
...
From the command line, issue the following commands to set the HDMI Monitor to 1080p30 in the AR24 color space. The AR24 color space is a good default to assume. Other common alternatives are BG24 and NV12.
Code Block |
---|
$ sudo modetest -D a00c0000.v_mix -s 40:1920x1080-30@AR24 |
|
...
Next, set the display to initialize the display and wait for further input:
Code Block |
---|
$ sudo modetest -D a00c0000.v_mix -s 40:1920x1080-30@AR24 -w 36:"alpha":0 & |
|
...
This step is not necessary if using the mediasrcbin
plugin below, it is only added for reference.
Code Block |
---|
$ media-ctl -d /dev/media0 -V "\"a0040000.v_proc_ss\":0 [fmt:RBG888_1X24/1920x1080 field:none]"
$ media-ctl -d /dev/media0 -V "\"a0040000.v_proc_ss\":1 [fmt:VYYUYY8_1X24/1920x1080 field:none]" |
|
...
mediasrcbin
- The following gstreamer
command line uses the mediasrcbin
plugin. This mediasrcbin
plugin is Xilinx-specific plugin which is an element on top of v4l2src
. It parses and configures the media graph of a media device automatically.
Code Block |
---|
$ sudo gst-launch-1.0 mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! xlnxroivideo1detect capture-io-mode=4 output-io-mode=5 relative-qp=-21 ! omxh265enc gop-mode=basic gop-length=60 b-frames=0 target-bitrate=1500 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true cpb-size=1000 initial-delay=500 qp-mode=roi ! video/x-h265, profile=main, alignment=au ! queue ! omxh265dec internal-entropy-buffers=5 low-latency=0 split-input=true ! queue max-size-bytes=0 ! fpsdisplaysink name=fpssink text-overlay=false 'video-sink=kmssink bus-id=a00c0000.v_mix hold-extra-sample=1 show-preroll=false sync=true' sync=true -v |
|
v4l2src
- The following gstreamer
command line uses the v4l2src
plugin. It requires manual commands to setup the VPSS as shown above.
Code Block |
---|
$ sudo gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! xlnxroivideo1detect capture-io-mode=4 output-io-mode=5 relative-qp=-21 ! omxh265enc gop-mode=basic gop-length=60 b-frames=0 target-bitrate=1500 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true cpb-size=1000 initial-delay=500 qp-mode=roi ! video/x-h265, profile=main, alignment=au ! queue ! omxh265dec internal-entropy-buffers=5 low-latency=0 split-input=true ! queue max-size-bytes=0 ! fpsdisplaysink name=fpssink text-overlay=false 'video-sink=kmssink bus-id=a00c0000.v_mix hold-extra-sample=1 show-preroll=false sync=true' sync=true -v |
|
...
Using the xlnx-vcu-roi-trd
Snap
Coming Soon!
Demo Operation
Once the gstreamer
command or snap starts successfully the output of the HDMI input source is shown on the HDMI monitor. Any faces detected in the input stream will be marked by a red bounding box. If you look closely, you will see that the area inside the bounding box is clearer and includes less compression artifacts than the rest of the image.
...