Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Zynq UltraScale+ MPSoC VCU TRD 2019.2 - HDMI Video Capture

...

1 Overview

The primary goal of this Design is to demonstrate the capabilities of VCU hard block present in Zynq UltraScale+ EV devices. The TRD will serve as a platform to tune the performance parameters of VCU and arrive at optimal configurations for encoder and decoder blocks. 

This design supports the following video interfaces:

Sources:

  • HDMI-Rx capture pipeline implemented in the PL.

Sink:

  • Stream-out from network or internet.
  • File sink (SD card, USB storage, SATA hard disk).

VCU Codec:

  • Video Encode/Decode capability using VCU hard block in PL 
    • AVC/HEVC encoding.
    • Encoder/decoder parameter configuration.

Streaming Interfaces:

  • 1G Ethernet PS GEM 

Video Format:

  • NV12

Supported Resolution:

The table below provides the supported resolution from GUI and command-line app in this design.


Resolution
GUICommand Line
Single StreamSingle Stream
4kp60X
4kp30X
1080p60X


√ - Supported
NA – Not applicable
x – Not supported


The below table gives information about the features supported in this design. 


Pipeline

Input source

Output Type

Resolution

VCU codec

Single Stream: Record/Stream-Out pipeline

HDMI-Rx

File Sink/ Stream-Out

4K/1080p

HEVC/AVC


The below figure shows the HDMI Video Capture design hardware block diagram.


The below figure shows the HDMI Video Capture design software block diagram.


1.1 Board Setup

Refer below link for Board Setup


...

NOTE: Here "dv.query:no-link" under "v_hdmi_rx_ss" node shows HDMI-Rx source is not connected or HDMI-Rx source is not active(Try waking up the device by pressing the key on remote).


Notes for gst-launch-1.

...

0 commands:

  • Make sure the HDMI-Rx
  • resolution from 1080p60 to 4kp60.
    • Check current HDMI Input Source Resolution (1080p60) by following the above-mentioned steps.
    • Run modetest followed by vcu_gst_app for current HDMI resolution (1080p60) by executing the following command.

...

  • media pipeline is configured for 4kp60 resolution and source/sink has the same color format. Run below xmedia-ctl commands to set the resolution and format of the HDMI scaler node.

When HDMI Input Source is NVIDIA SHIELD

Code Block
themeMidnight
$ modetestxmedia-ctl -D fd4a0000.zynqmp-displayd /dev/media0 -s 39:1920x1080-60@RG16
$ vcu_gst_app /media/card/config/input.cfg

Below configurations needs to be set in input.cfg for HDMI-1080p60.

Code Block
themeMidnight
Common Configuration    : START
Num Of Input            : 1
Output                  : DP
Out Type                : Display
Frame Rate              : 60
Exit


Input Configuration     : START
Input NumV "\"a0080000.v_proc_ss\":0  [fmt:RBG888_1X24/3840x2160 field:none]"
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":1  [fmt:VYYUYY8_1X24/3840x2160 field:none]"

NOTE: Make sure NVIDIA SHIELD is configured for 4kp resolution and RGB888 color format.

When HDMI Input Source is ABOX

Code Block
themeMidnight
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":0  [fmt:VYYUYY8_1X24/3840x2160 field:none]"
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":1  [fmt:VYYUYY8_1X24/3840x2160 field:none]"

NOTE: Make sure ABOX is configured for 4kp resolution and VYYUYY8 color format.


  • Follow the below steps to switch the HDMI-Rx resolution from 1080p60 to 4kp60.
    • Check current HDMI Input Source Resolution (1080p60) by following the above-mentioned steps.
    • Run modetest followed by vcu_gst_app for current HDMI resolution (1080p60) by executing the following command.
Code Block
themeMidnight
$ modetest -D fd4a0000.zynqmp-display -s 39:1920x1080-60@RG16
$ vcu_gst_app /media/card/config/input.cfg

Below configurations needs to be set in input.cfg for HDMI-1080p60.

Code Block
themeMidnight
Common Configuration    : START
Num Of Input            : 1
Output                  : 1DP
InputOut Type                : Display
Frame Rate  hdmi Raw           : 60
Exit


Input Configuration     : TRUE
WidthSTART
Input Num               : 1
Input Type        : 1920 Height    : hdmi
Raw            : 1080
Exit
    • Change Resolution of HDMI Input Source from 1080p60 to 4kp60 by following the below steps.
      • Set the HDMI source resolution to 4kp60 (Homepage → settings → display & Sound → Resolution → change to 4kp60).
      • Save the configuration to take place the change.
    • Verify desired HDMI Input Source Resolution (4kp60) by following the above-mentioned steps.
  • Run the following gst-launch-1.0 command to record HDMI video using the GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true cpb-size=1000 initial-delay=500 ! queue ! mpegtsmux alignment=7 name=mux ! filesink location="/run/media/sda/test.ts"

...

        : TRUE
Width                   : 1920
Height                  : 1080
Exit
    • Change Resolution of HDMI Input Source from 1080p60 to 4kp60 by following the below steps.
      • Set the HDMI source resolution to 4kp60 (Homepage → settings → display & Sound → Resolution → change to 4kp60).
      • Save the configuration to take place the change.
    • Verify desired HDMI Input Source Resolution (4kp60) by following the above-mentioned steps.


  • Run the following gst-launch-1.0 command for the CBR stream-out pipeline. Where "videoX" indicates a video node for the input sourceto record HDMI video using the GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true cpb-size=1000 initial-delay=500 periodicity-idr=60 ! video/x-h265, profile=main, alignment=au ! queue ! mpegtsmux alignment=7 name=mux ! rtpmp2tpay ! udpsink host=192.168.25.89 port=5004

...

filesink location="/run/media/sda/test.ts"

NOTE: The file location should be SATA SSD(ext4 format) to avoid the read-write bandwidth issue.

  • Run the following gst-launch-1.0 command for low-latency(LLP1) the CBR stream-out pipeline. Where "videoX" indicates a video node for the input source and 192.168.25.89 is host/client IP address and 5004 is port novideo node for the input source.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 device=/dev/videoX ! video/x-raw, format=NV12, width=3840, height=2160, format=NV12, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=low-delay-pbasic gop-length=60 periodicity-idr=60 b-frames=0 target-bitrate=2500060000 num-slices=8 control-rate=low-latencyconstant prefetch-buffer=TRUEtrue low-bandwidth=false filler-data=0true cpb-size=1000 initial-delay=500 periodicity-idr=60 ! video/x-h265, profile=main, alignment=nalau ! queue ! queue max-size-buffers=0mpegtsmux alignment=7 name=mux ! rtph265payrtpmp2tpay ! udpsink host=192.168.25.89 port=5004 buffer-size=60000000 max-bitrate=120000000 max-lateness=-1 qos-dscp=60 async=false

NOTE: The low latency(LLP1) stream-out pipeline is supported with tsmux in vcu_gst_app.

...

NOTE: Here 192.168.25.89 is host/client IP address and 5004 is port no.

  • Run the following gst-launch-1.0

...

  • Make sure the HDMI-Rx media pipeline is configured for 4kp60 resolution and source/sink has the same color format. Run below xmedia-ctl commands to set the resolution and format of the HDMI scaler node.

...

  • command for low-latency(LLP1) stream-out pipeline. Where "videoX" indicates a video node for the input source and 192.168.25.89 is host/client IP address and 5004 is port no.
Code Block
themeMidnight
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":0  [fmt:RBG888_1X24/3840x2160 field:none]"
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":1  [fmt:VYYUYY8_1X24/3840x2160 field:none]"

NOTE: Make sure NVIDIA SHIELD is configured for 4kp resolution and RGB888 color format.

When HDMI Input Source is ABOX

Code Block
themeMidnight
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":0  [fmt:VYYUYY8_1X24/3840x2160 field:none]"
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":1  [fmt:VYYUYY8_1X24/3840x2160 field:none]"

...

 gst-launch-1.0 v4l2src io-mode=4 device=/dev/videoX ! video/x-raw, width=3840, height=2160, format=NV12, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=low-delay-p gop-length=60 periodicity-idr=60 b-frames=0 target-bitrate=25000 num-slices=8 control-rate=low-latency prefetch-buffer=TRUE low-bandwidth=false filler-data=0 cpb-size=1000 initial-delay=500 ! video/x-h265, alignment=nal ! queue max-size-buffers=0 ! rtph265pay ! udpsink host=192.168.25.89 port=5004 buffer-size=60000000 max-bitrate=120000000 max-lateness=-1 qos-dscp=60 async=false

NOTE: The low latency(LLP1) stream-out pipeline is supported with tsmux in vcu_gst_app.