当前位置:   article > 正文

Xilinx zynqmp VCU使用_xlnx,video-format的参数

xlnx,video-format的参数

参考

Zynq UltraScale+ MPSoC VCU TRD 2019.1
Zynq UltraScale+ MPSoC VCU TRD 2019.1 - VCU TRD : Multi Stream
Zynq UltraScale+ MPSoC VCU TRD 2019.1 - Run and Build Flow
Xilinx DRM KMS DisplayPort 1.4 TX Subsystem Driver
Xilinx DRM KMS HDMI-Tx Driver
HDMI Receiver Subsystem v3.1 - Patch Updates for the HDMI Receiver Subsystem v3.1 in Vivado 2018.1
音视频编解码: YUV存储格式中的YUV420P,YUV420SP,NV12, NV21理解(转)
常用视频像素格式NV12、NV21、I420、YV12、YUYV
对颜色空间YUV、RGB的理解
图解YU12、I420、YV12、NV12、NV21、YUV420P、YUV420SP、YUV422P、YUV444P的区别
ZCU106 VCU Linux驱动转裸机驱动篇(一)
hi3519v101 h265编码器编码出第一帧延迟是多少毫秒?
Frambuffer_rd在Windows下的vivado 2020.1编译报错解决方法
AR# 72324 2019.1 - Zynq UltraScale+ MPSoC VCU - Patches for 2019.1 LogiCORE H.264/H.265 Video Codec Unit (VCU) - Linux Kernel Module, VCU Control Software, GStreamer and OMX
AR# 73275 PetaLinux - Zynq UltraScale+ MPSoC VCU - Why Do I see OpenSSL errors when RTMP is enabled in the 2019.1 or 2019.2 VCU TRD in gstreamer1.0-plugins-bad?
AR# 73049 2019.2 Zynq UltraScale+ MPSoC VCU — 使用示例 GStreamer 应用时,最后一行中的 QP 值更新不正确
MPSoC PYNQ框架集成VCU-1.VCU在ZCU104上运行
xilinx平台dma分析
VCU: 一个简单的 VCU 视频编解码设计
Xilinx Zynq UltraScale+ MPSoC VCU ROI Demo跑
Hobbit玩转Zynq MPSoC系列之1:VCU解码+DP显示
Hobbit玩转Zynq MPSoC系列之2:TPG输入+VCU编码+rtp网络传输
在VCUTRD 2020.1 里设置HDMI-TX显示QT界面
MPSOC VCU Example Gstreamer pipelines YUV 422 10bit
[分享] 独立编译VCU Ctrl-sw的办法
ZCU106使用VCU TRD的MIPI的例子
【分享】ZCU106在PLDDR实现超低延时编码
RK3399探索之旅 Display子系统 从modetest 到 DRM driver
Gstreamer中的sink插件及区别
【GStreamer】gstreamer工具详解之:gst-launch-1.0
gst-launch-1.0用法小记
Download GStreamer
H265 Profile & Level & Tier 介绍
Xilinx FPGA I/O电平标准简介
Virtex-7 DIFF_HSTL_II_18和DIFF_HSTL_II_DCI_18电平使用问题
【工程师分享】MPSoC VCU Ctrl-SW 2020.2 编码不同Stride的YUV文件
【工程师分享】MPSoC VCU Ctrl-SW 2020.2 输出NV12的YUV文件
【分享】查看VCU ctrlsw_decoder解码的XV20视频
ZCU106–(2)–20180626-0703

源代码

基于ZCU104做了一个工程,有需要可联系我。

基本概念

  • omit:省略
  • chroma:色度

RGB

RGB 模型是目前常用的一种彩色信息表达方式,它使用红、绿、蓝三原色的亮度来定量表示颜色。该模型也称为加色混色模型,是以RGB三色光互相叠加来实现混色的方法,因而适合于显示器等发光体的显示。

YUV

Y表示亮度,CbCr表示颜色,可以粗浅地视YUV为YCbCr。怎么表示颜色,引用网上的一张图,
72
YUV采样方式有三种,Chroma Resampler用于在这三个方式中进行转换,

  • YUV 4:4:4采样,每一个Y对应一组UV分量。
  • YUV 4:2:2采样,每两个Y共用一组UV分量。比如YUVY,UYVY,YUV422P。
  • YUV 4:2:0采样,每四个Y共用一组UV分量。比如YU12(I420),YV12,NV12,NV21。

YUV的数据组织格式有两种,planar和packed,

  • planar的YUV格式,先连续存储所有像素点的Y,紧接着存储所有像素点的U,随后是所有像素点的V。比如YUV422P,YU12(I420/YUV420P)和YV12(YUV420P)。
  • packed的YUV格式,每个像素点的Y,U,V是连续交叉存储的。比如YUVY,UYVY。
  • 融合了上面两种格式。比如NV12(YUV420SP)、NV21(YUV420SP)。

YUV每个分量占一个字节,一副图像的YUV444大小为x*y*3,YUV420大小为x*y*3/2
RGB和YUV可通过RGB to YCrCb Color-Space ConverterYCrCb to RGB Color-Space Converter进行转换。
一个6*4的图像的NV12存储方式如下,
5
axis video格式,YUV420和YUV422是兼容的,每隔一行少了一次色度信息,
6

VCU

Video Codec Unit (VCU) 核编码器块是采用 H.265 (ISO/IEC 23008-2 高效视频编码)和 H.264 (ISO/IEC 14496-10 高级视频编码)标准对视频流进行处理的视频编码器引擎。编码器块全面支持上述标准(这些标准包括支持 8 位和 10 颜色深度、4:2:0、4:2:2 和 4:0:0 Y-only(单色) 色度格式、以及高达 4K UHD @ 60 Hz 分辨率的性能)。
VCU PLL需满足sub-100ps jitter标准,输入范围27 MHz~60 MHz。

图像格式

图形显示DP/HDMI像素格式是ARGB8888(AR24)
视频格式支持下4种,

  • NV12 YUV 4:2:0 8bit
  • NV16 YUV 4:2:2 8bit
  • XV15 YUV 4:2:0 10bit
  • XV20 YUV 4:2:2 10bit

GStreamer和VCU支持的格式,
11

性能

速率为 @ 667 MHz(2) 时的性能,

  • 32 个流 @ 720×480p @ 30 Hz
  • 8 个流 @ 1920×1080p @ 30 Hz
  • 4 个流 @ 1920×1080p @ 60 Hz
  • 2 个流 @ 3840×2160p @ 30 Hz
  • 1 个流 @ 3840×2160p @ 60 Hz
  • 1 个流 @ 7680×4320p @ 15 Hz

采样位深度:8 bpc、10 bpc,
色度格式:YCbCr 4:2:0、YCbCr 4:2:2、Y-only(单色),

内存

CMA大小需求,
73
解码器存储器的带宽取决于帧速率、分辨率、颜色深度、色度格式和解码器配置信息。根据 GUI 中选择的视频参数来提供解码器的带宽估算值。赛灵思建议尽可能使用最快的DDR4存储器接口。具体来说,8x8 位的存储器接口比 4x16 位的存储器接口更有效,因为x8模式有4个bank组,而x16模式只有2个bank组;而且DDR4允许同时访问多个bank组。如需了解更多信息,请参阅AR# 71209

编码器缓存

启用编码器缓存,请将 prefetch-buffer 参数传递到使用硬件的 GStreamer 流水线中。

$ gst-launch-1.0 videotestsrc ! omxh265enc prefetch-buffer=true ! fakesink
  • 1

时延

对于编解码,第一帧图像开始时会存在一个初始化延迟,但当图像流水起来之后,编解码器的总延迟是稳态延迟。

Vivado

VCU的地址在0xA0000000,此时HPM0只有192MB可用空间,从0xA4000000开始,ZCU104 User guide中有一处bug,clk_300_c_p/n的引脚分配和原理图不一致,参考原理图的引脚分配|,
341
接收部分,
4

Vivado2018.2打补丁

对Vivado 2018.2打补丁,AR71203_Vivado_2018_1_preliminary_rev4.zip,按照压缩包内的README.txt的提示打补丁即可,在Vivado 2019.1及以后的版本不需要,主要修复下面两个bug,

  • (Xilinx Answer 71935) Info frame packets corrupted when switching resolutions
  • (Xilinx Answer 70870) Link quality becomes bad after running for 15~45 minutes.

Linux

数据流,
8

驱动

v4l驱动栈:

  • Media device node: /dev/media*, discover the device topology of a video pipeline and to configure it at run time
  • Video device node: /dev/video*
  • V4L subdevice node: /dev/v4l-subdev*

10
开机调试信息,

# 添加EMIO到复位
[    5.655423] xilinx-frmbuf a0000000.v_frmbuf_rd: Unable to locate reset property in dt
[    5.655441] xilinx-frmbuf: probe of a0000000.v_frmbuf_rd failed with error -2
[    5.655489] xilinx-frmbuf a0020000.v_frmbuf_wr: Unable to locate reset property in dt
[    5.655504] xilinx-frmbuf: probe of a0020000.v_frmbuf_wr failed with error -2
[    5.655551] xilinx-frmbuf a0030000.v_frmbuf_wr: Unable to locate reset property in dt
[    5.655566] xilinx-frmbuf: probe of a0030000.v_frmbuf_wr failed with error -2
[    5.701267] xilinx-tpg a0010000.v_tpg: invalid number of ports 0
[    5.701281] xilinx-tpg: probe of a0010000.v_tpg failed with error -22
# 添加bus width到flash0
[    7.567194] zynqmp-qspi ff0f0000.spi: rx bus width not found
[    7.572908] zynqmp-qspi ff0f0000.spi: tx bus width not found
# 添加phys
[    7.666543] dwc3-of-simple ff9d0000.usb0: dwc3_simple_set_phydata: Can't find usb3-phy
[    7.674946] dwc3 fe200000.dwc3: Failed to get clk 'ref': -2
# 暂时不用wifi,忽略
[    8.109651] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    8.121265] cfg80211: failed to load regulatory.db
# 添加EMIO到复位
[    8.399957] xilinx-vcu-core a0140000.vcu: No reset gpio info from dts for vcu. This may lead to incorrect functionality if VCU isolation is removed post initialization.
[    8.708911] xilinx-vcu xilinx-vcu: Could not get core_enc clock
[    8.721748] VCU PLL: enable
[    8.728767] xilinx-vcu xilinx-vcu: xvcu_probe: Probed successfully
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

添加设备树节点,Probe deferred due to GPIO reset defer这个打印还是存在,好像是驱动都初始化了2次?暂不深究,

[    5.219188] xilinx-frmbuf a0000000.v_frmbuf_rd: Probe deferred due to GPIO reset defer
[    5.219241] xilinx-frmbuf a0040000.v_frmbuf_rd: Probe deferred due to GPIO reset defer
[    5.219290] xilinx-frmbuf a0020000.v_frmbuf_wr: Probe deferred due to GPIO reset defer
[    5.219339] xilinx-frmbuf a0030000.v_frmbuf_wr: Probe deferred due to GPIO reset defer
[    5.219387] xilinx-frmbuf a0050000.v_frmbuf_wr: Probe deferred due to GPIO reset defer
...
[    5.264871] xilinx-video amba_pl@0:vcap_tp0: /amba_pl@0/vcap_tp0/ports/port@0 initialization failed
[    5.264885] xilinx-video amba_pl@0:vcap_tp0: DMA initialization failed
...
[    6.748250] xilinx-frmbuf a0000000.v_frmbuf_rd: Xilinx AXI frmbuf DMA_MEM_TO_DEV
[    6.755706] xilinx-frmbuf a0000000.v_frmbuf_rd: Xilinx AXI FrameBuffer Engine Driver Probed!!
[    6.764354] xilinx-frmbuf a0040000.v_frmbuf_rd: Xilinx AXI frmbuf DMA_MEM_TO_DEV
[    6.771811] xilinx-frmbuf a0040000.v_frmbuf_rd: Xilinx AXI FrameBuffer Engine Driver Probed!!
[    6.780461] xilinx-frmbuf a0020000.v_frmbuf_wr: Xilinx AXI frmbuf DMA_DEV_TO_MEM
[    6.787912] xilinx-frmbuf a0020000.v_frmbuf_wr: Xilinx AXI FrameBuffer Engine Driver Probed!!
[    6.796562] xilinx-frmbuf a0030000.v_frmbuf_wr: Xilinx AXI frmbuf DMA_DEV_TO_MEM
[    6.804020] xilinx-frmbuf a0030000.v_frmbuf_wr: Xilinx AXI FrameBuffer Engine Driver Probed!!
[    6.812663] xilinx-frmbuf a0050000.v_frmbuf_wr: Xilinx AXI frmbuf DMA_DEV_TO_MEM
[    6.820116] xilinx-frmbuf a0050000.v_frmbuf_wr: Xilinx AXI FrameBuffer Engine Driver Probed!!
...
[    7.472985] xilinx-video amba_pl@0:vcap_tp0: device registered
[    7.482519] xilinx-tpg a0010000.v_tpg: device found, version 0.000
[    7.492090] xilinx-video amba_pl@0:vcap_tp0: Entity type for entity a0010000.v_tpg was not initialized!
...
[    8.082901] mali: loading out-of-tree module taints kernel.
[    8.444071] VCU PLL: enable
[    8.450935] xilinx-vcu xilinx-vcu: xvcu_probe: Probed successfully
[    8.482970] al5d a0120000.al5d: l2 prefetch size:11468800 (bits), l2 color bitdepth:10
[    8.484123] al5e a0100000.al5e: l2 prefetch size:11468800 (bits), l2 color bitdepth:10
...
Running postinst /etc/rpm-postinsts/100-libmali-xlnx...
/usr/sbin/run-postinsts: line 70: update-alternatives:: command not found
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

设备树

>=2018.1
Documentation/devicetree/bindings/display/xlnx
<2018.1
Documentation/devicetree/bindings/drm/xilinx
  • 1
  • 2
  • 3
  • 4

APP

下载测试视频

wget petalinux.xilinx.com/sswreleases/video-files/bbb_sunflower_2160p_30fps_normal_avc.mp4
wget petalinux.xilinx.com/sswreleases/video-files/bbb_sunflower_2160p_30fps_normal_hevc.mkv
  • 1
  • 2

vcu_qt

图形化应用界面。

vcu_gst_app

命令行应用程序。

vcu_gst_lib

VCU GStreamer接口库,配置pipeline,控制pipeline中的数据流,

  • Display configuration
  • VCU configuration
  • Video pipeline control
  • Audio pipeline control
  • Video buffer management

库输出以下函数接口,

  • set video pipeline parameters such as resolution, format, and source type (v4l2src,
    filesrc)
  • set encoder parameters
  • start and stop the pipeline
  • calculate FPS
  • perform error handling
  • calculate bit rate for file/stream-in playback
  • poll for an end of stream (EOS) event

vcu_video_lib

通过libmediactllibv4l2subdev,控制,

  • Enumerate entities pads links
  • Configure sub-devices
  • Set media bus format
  • Set dimensions (width/height)

vcu_apm_lib

vcu_qt用这个接口来监控VCU编解码访存性能。

gst-launch-1.0

gst-launch

调试信息

查看DRI设备,

# ls -l /dev/dri/by-path/
total 0
lrwxrwxrwx    1 root     root             8 Aug  4 08:14 platform-fd4a0000.zynqmp-display-card -> ../card0
  • 1
  • 2
  • 3

测试图像,

# 失败
$ modetest -D fd4a0000.zynqmp-display -s 39:1920x1080-24@BG24 &
# 彩条
$ modetest -D fd4a0000.zynqmp-display -s 39:1920x1080-60@BG24 &
$ modetest -D fd4a0000.zynqmp-display -s 39:1920x1080-60@AR24 &
$ gst-launch-1.0 videotestsrc ! kmssink bus-id="fd4a0000.zynqmp-display"
$ gst-launch-1.0 videotestsrc pattern=1 ! kmssink bus-id="fd4a0000.zynqmp-display"
# 2020.2 zcu104
$ ps -ef
root       792     1  0 02:17 ?        00:00:00 xinit /etc/X11/Xsession -- /usr/bin/Xorg :0 -br -pn
$ kill 792
$ modetest -M xlnx -c
Connectors:
id      encoder status          name            size (mm)       modes   encoders
43      42      connected       DP-1            530x300         32      42
# 彩条
$ modetest -M xlnx -D fd4a0000.zynqmp-display -s 43:1920x1080-60@AR24 &

# 失败
$ gst-launch-1.0 videotestsrc ! video/x-raw,width=1920,height=1080,framerate=60/1 ! kmssink bus-id="fd4a0000.zynqmp-display"
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
WARNING: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: A lot of buffers are being dropped.
Additional debug info:
../../../../git/libs/gst/base/gstbasesink.c(2902): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: A lot of buffers are being dropped.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

解码显示,

gst-launch-1.0 filesrc location="/run/media/mmcblk0p1/VID_20200427_184617.mp4" ! qtdemux name=demux demux.video_0 ! h264parse ! omxh264dec ! queue max-size-bytes=0 ! kmssink bus-id=fd4a0000.zynqmp-display fullscreen-overlay=true sync=false
gst-launch-1.0 filesrc location=/media/usb/test.NV12! videoparse format=23 width=1920   height=1080 framerate=15/1 ! queue ! kmssink bus-id="fd4a0000.zynqmp-display"fullscreen-overlay=true
  • 1
  • 2

调试信息,

# entity 1是"a0010000.v_tpg",entity 5是"vcap_tp0 output 0"
root@zynqmp_vcu:~# media-ctl -d /dev/media0 -p
Media controller API version 4.19.0

Media device information
------------------------
driver          xilinx-video
model           Xilinx Video Composite Device
serial          
bus info        
hw revision     0x0
driver version  4.19.0

Device topology
- entity 1: vcap_tp0 output 0 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "a0010000.v_tpg":0 [ENABLED]

- entity 5: a0010000.v_tpg (1 pad, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Source
                [fmt:UYVY10_1X20/0x0@1/30 field:none colorspace:srgb]
                -> "vcap_tp0 output 0":0 [ENABLED]

root@zynqmp_vcu:~# modetest -c                
Connectors:
id      encoder status          name            size (mm)       modes   encoders
39      38      connected       DP-1            530x300         32      38
  modes:
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 148352 flags: phsync, pvsync; type: driver
  1920x1080 50 1920 2448 2492 2640 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  1920x1080 24 1920 2558 2602 2750 1080 1084 1089 1125 74250 flags: phsync, pvsync; type: driver
  1920x1080 24 1920 2558 2602 2750 1080 1084 1089 1125 74176 flags: phsync, pvsync; type: driver
  1600x1200 60 1600 1664 1856 2160 1200 1201 1204 1250 162000 flags: phsync, pvsync; type: driver
  1680x1050 60 1680 1784 1960 2240 1050 1053 1059 1089 146250 flags: nhsync, pvsync; type: driver
  1280x1024 75 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 108000 flags: phsync, pvsync; type: driver
  1280x800 60 1280 1352 1480 1680 800 803 809 831 83500 flags: nhsync, pvsync; type: driver
  1152x864 75 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
  1280x720 60 1280 1390 1430 1650 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  1280x720 60 1280 1390 1430 1650 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  1280x720 60 1280 1390 1430 1650 720 725 730 750 74176 flags: phsync, pvsync; type: driver
  1280x720 50 1280 1720 1760 1980 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  1024x768 75 1024 1040 1136 1312 768 769 772 800 78750 flags: phsync, pvsync; type: driver
  1024x768 60 1024 1048 1184 1344 768 771 777 806 65000 flags: nhsync, nvsync; type: driver
  800x600 75 800 816 896 1056 600 601 604 625 49500 flags: phsync, pvsync; type: driver
  800x600 60 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
  720x576 50 720 732 796 864 576 581 586 625 27000 flags: nhsync, nvsync; type: driver
  720x576 50 720 732 796 864 576 581 586 625 27000 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27027 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27027 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  640x480 75 640 656 720 840 480 481 484 500 31500 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 25200 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  720x400 70 720 738 846 900 400 412 414 449 28320 flags: nhsync, pvsync; type: driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
                        00ffffffffffff0010acc4a04c574131
                        15190104a5351e783a7c15a7544b9f26
                        0d5054a54b008100b300d100714fa940
                        8180d1c00101565e00a0a0a029503020
                        35000f282100001a000000ff004e4459
                        373335354e3141574c0a000000fc0044
                        454c4c205032343136440a20000000fd
                        0031561d711c000a2020202020200185
                        02031df1509005040302071601061112
                        1513141f202309070783010000023a80
                        1871382d40582c45000f282100001e01
                        1d8018711c1620582c25000f28210000
                        9e011d007251d01e206e2855000f2821
                        00001e8c0ad08a20e02d10103e96000f
                        2821000018f44c00c082802b4060d835
                        480f282100001c0000000000000000d7
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0
        5 link-status:
                flags: enum
                enums: Good=0 Bad=1
                value: 0
        6 non-desktop:
                flags: immutable range
                values: 0 1
                value: 0
        19 CRTC_ID:
                flags: object
                value: 37
        40 sync:
                flags: range
                values: 0 1
                value: 0
        41 bpc:
                flags: enum
                enums: 6BPC=6 8BPC=8 10BPC=10 12BPC=12
                value: 8

root@zynqmp_vcu:~# modetest -e
Encoders:
id      crtc    type    possible crtcs  possible clones
38      37      TMDS    0x00000001      0x00000000

root@zynqmp_vcu:~# modetest -f
Frame buffers:
id      size    pitch

root@zynqmp_vcu:~# modetest -p
CRTCs:
id      fb      pos     size
37      45      (0,0)   (1920x1080)
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  props:
        20 ACTIVE:
                flags: range
                values: 0 1
                value: 1
        21 MODE_ID:
                flags: blob
                blobs:

                value:
                        144402008007d8070408980800003804
                        3c044104650400003c00000005000000
                        40000000313932307831303830000000
                        00000000000000000000000000000000
                        00000000
        18 OUT_FENCE_PTR:
                flags: range
                values: 0 18446744073709551615
                value: 0
        30 output_color:
                flags: enum
                enums: rgb=0 ycrcb444=1 ycrcb422=2 yonly=3
                value: 0
        31 bg_c0:
                flags: range
                values: 0 4095
                value: 0
        32 bg_c1:
                flags: range
                values: 0 4095
                value: 0
        33 bg_c2:
                flags: range
                values: 0 4095
                value: 0

Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
35      0       0       0,0             0,0     0               0x00000001
  formats: VYUY UYVY YUYV YVYU YU16 YV16 YU24 YV24 NV16 NV61 GREY Y10  BG24 RG24 XB24 XR24 XB30 XR30 YU12 YV12 NV12 NV21 XV15 XV20
  props:
        7 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        16 FB_ID:
                flags: object
                value: 0
        17 IN_FENCE_FD:
                flags: signed range
                values: -1 2147483647
                value: -1
        19 CRTC_ID:
                flags: object
                value: 0
        12 CRTC_X:
                flags: signed range
                values: -2147483648 2147483647
                value: 0
        13 CRTC_Y:
                flags: signed range
                values: -2147483648 2147483647
                value: 0
        14 CRTC_W:
                flags: range
                values: 0 2147483647
                value: 0
        15 CRTC_H:
                flags: range
                values: 0 2147483647
                value: 0
        8 SRC_X:
                flags: range
                values: 0 4294967295
                value: 0
        9 SRC_Y:
                flags: range
                values: 0 4294967295
                value: 0
        10 SRC_W:
                flags: range
                values: 0 4294967295
                value: 0
        11 SRC_H:
                flags: range
                values: 0 4294967295
                value: 0
        34 tpg:
                flags: range
                values: 0 1
                value: 0
36      37      45      0,0             0,0     0               0x00000001
  formats: AB24 AR24 RA24 BA24 BG24 RG24 RA15 BA15 RA12 BA12 RG16 BG16
  props:
        7 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        16 FB_ID:
                flags: object
                value: 45
        17 IN_FENCE_FD:
                flags: signed range
                values: -1 2147483647
                value: -1
        19 CRTC_ID:
                flags: object
                value: 37
        12 CRTC_X:
                flags: signed range
                values: -2147483648 2147483647
                value: 0
        13 CRTC_Y:
                flags: signed range
                values: -2147483648 2147483647
                value: 0
        14 CRTC_W:
                flags: range
                values: 0 2147483647
                value: 1920
        15 CRTC_H:
                flags: range
                values: 0 2147483647
                value: 1080
        8 SRC_X:
                flags: range
                values: 0 4294967295
                value: 0
        9 SRC_Y:
                flags: range
                values: 0 4294967295
                value: 0
        10 SRC_W:
                flags: range
                values: 0 4294967295
                value: 125829120
        11 SRC_H:
                flags: range
                values: 0 4294967295
                value: 70778880
        28 alpha:
                flags: range
                values: 0 255
                value: 255
        29 g_alpha_en:
                flags: range
                values: 0 1
                value: 1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273

命令参考

$ gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux ! queue ! h265parse ! avdec_h265 ! videoconvert ! autovideosink

$ gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux ! queue ! h265parse ! video/x-h265, profile=main, alignment=au ! omxh265dec internal-entropy-buffers=5 low-latency=0 ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix"

$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV16, 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 ! rtpmp2tpay ! udpsink host=192.168.6.6 port=5004

$ gst-launch-1.0 -v rtspsrc location="rtsp://admin:adminpw@10.0.0.210:554/11" ! rtph264depay ! h264parse ! video/x-h264,stream-format=byte-stream ! filesink location=/media/usb/videos/dump210.h264
gst-launch-1.0 -v filesrc location=/media/usb/videos/dump210.h264 ! h264parse ! omxh264dec ! kmssink bus-id=fd4a0000.zynqmp-display fullscreen-overlay=true

# Zynq UltraScale+ MPSoC VCU TRD 2019.1 - HDMI Video Capture
$ 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"
$ 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
$ gst-launch-1.0 v4l2src device=/dev/videoX 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=low-latency prefetch-buffer=true low-bandwidth=false filler-data=true cpb-size=1000 initial-delay=500 periodicity-idr=60 ! video/x-h265, profile=main, alignment=nal ! queue ! mpegtsmux alignment=7 name=mux ! rtpmp2tpay ! udpsink host=192.168.25.89 port=5004

# Zynq UltraScale+ MPSoC VCU TRD 2019.1 - HDMI Video Display
$ gst-launch-1.0 uridecodebin uri="file:///run/media/sda/test.ts" ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix"
$ gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux ! queue ! h265parse ! video/x-h265, profile=main, alignment=au ! omxh265dec internal-entropy-buffers=5 low-latency=0 ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix"
$ gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux ! queue ! h265parse ! video/x-h265, profile=main, alignment=nal ! omxh265dec internal-entropy-buffers=5 low-latency=1 ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix"

# Zynq UltraScale+ MPSoC ZCU104 VCU HDMI ROI 2020.2
gst-launch-1.0 mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, 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 # Capture → (ROI) → Encode → Decode → Display
gst-launch-1.0 mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, format=NV12, width=3840, height=2160, 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 periodicity-idr=60 qp-mode=roi ! video/x-h265, profile=main, alignment=au ! queue ! mpegtsmux alignment=7 name=mux ! rtpmp2tpay ! udpsink host=192.168.25.89 port=5004 # Capture → (ROI) → Encode → Stream-out
gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux ! queue ! h265parse ! video/x-h265, profile=main, alignment=au ! 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 # Stream-in→ Decode → Display

# Xilinx Zynq UltraScale+ MPSoC VCU ROI Demo跑
gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! queue ! omxh264enc ! video/x-h264, profile=main, alignment=au ! omxh264dec ! kmssink bus-id="a0060000.v_mix" # RX->ENC->DEC->TX
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 ! omxh265enc qp-mode=roi num-slices=8 prefetch-buffer=true gop-length=60 periodicity-idr=270 control-rate=low-latency target-bitrate=5000 gop-mode=low-delay-p cpb-size=200 initial-delay=100 filler-data=false min-qp=15 max-qp=40 b-frames=0 low-bandwidth=false ! video/x-h265, profile=main, alignment=au ! queue ! omxh265dec internal-entropy-buffers=5 low-latency=0 ! queue max-size-bytes=0 ! fpsdisplaysink text-overlay=false video-sink="kmssink bus-id="a0060000.v_mix"" # RX->ROI->ENC->DEC->TX

# MPSOC VCU Example Gstreamer pipelines YUV 422 10bit
#  modetest -D a0070000.v_mix -s 37:1920x1080-60@BG24 &                                                              (find hdmi drm crtc id)
#  xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":0  [fmt:VUY8_1X24/1920x1080 field:none]“
#  xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":1  [fmt:UYVY10_1X20/1920x1080 field:none]“
#   gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV16_10LE32, framerate=60/1 ! queue max-size-bytes=0 ! fpsdisplaysink text-overlay=false video-sink="kmssink bus-id="a0070000.v_mix" plane-id=30“      

# gst-launch-1.0 uridecodebin uri="file:///media/usb/avit_stream/4KP50highCBR42210bit20M.ts" ! queue max-size-bytes=0 ! fpsdisplaysink text-overlay=false video-sink="kmssink bus-id="a0070000.v_mix" plane-id=30"

# Hobbit玩转Zynq MPSoC系列之3:HDMI输入+DP显示
gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, width=1920, height=1080! kmssink bus-id=fd4a0000.zynqmp-display fullscreen-overlay=1

# Hobbit玩转Zynq MPSoC系列之2:TPG输入+VCU编码+rtp网络传输
gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, width=1920, height=1080! omxh264enc target-bitrate=20000 ! h264parse config-interval=-1 ! mpegtsmux ! rtpmp2tpay ! udpsink host=192.168.1.99 port=9001 sync=true

# H.265 1080p 运行 Xilinx Low Latency PL DDR XV20 HDMI Video Capture and Display
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw\(memory:XLNXLL\), width=1920, height=1080, format=NV16_10LE32, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=low-delay-p gop-length=60  b-frames=0 target-bitrate=20000 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44

问题

failed to open device ‘xlnx’: No such file or directory

# modetest -c
failed to open device 'xlnx': No such file or directory
  • 1
  • 2

板卡上电时显示器没有启动,后面再上电启动,执行命令报这个错误。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/346132
推荐阅读
相关标签
  

闽ICP备14008679号