跳转到主要内容

【工程师分享】ZCU106的超低延时gstreamer编解码命令

作者:付汉杰,<a href="mailto:hankf@xilinx.com">hankf@xilinx.com</a&gt;,文章转载自:<a id="link_3" href="https://forums.xilinx.com/t5/%E5%B5%8C%E5%85%A5%E5%BC%8F-%E5%B7%A5%E5%8…;

Xilinx提供超低延时编解码方案,在ZCU106单板上可以验证。文档<a href="https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1010368921/Zynq+U…; target="_blank" rel="noopener nofollow noreferrer">MPSoC VCU TRD 2020.2 Low Latency NV16</a> 提供了详细命令。

下面的命令,能表现得更加稳定。
注意,其中每行最后的,表示本行没有结束,下一行也是本行内容。一定要保证最后的\后面,没有任何字符,要注意不能有空格字符。

发送端命令:
<pre>gst-launch-1.0 -v v4l2src device=/dev/video0 io-mode=4 \
! video/x-raw\(memory:XLNXLL\), format=NV16, width=3840, height=2160, framerate=60/1 \
! omxh265enc num-slices=8 periodicity-idr=240 cpb-size=500 gdr-mode=horizontal \
initial-delay=250 control-rate=low-latency prefetch-buffer=true \
target-bitrate=25000 gop-mode=low-delay-p \
! video/x-h265, alignment=nal ! queue max-size-buffers=0 ! rtph265pay \
! udpsink buffer-size=60000000 host=127.0.0.1 port=5004 async=false \
max-lateness=-1 qos-dscp=60 max-bitrate=120000000 -v</pre>

在执行上述命令前,需要配置视频输入pipeleine为4K的NV16模式,并根据接收单板指定其中的IP。

接收端命令:
<pre>gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 \
caps="application/x-rtp, media=video, clock-rate=90000, payload=96, encoding-name=H265" \
! rtpjitterbuffer latency=17 ! rtph265depay ! h265parse \
! video/x-h265, alignment=nal ! omxh265dec low-latency=1 internal-entropy-buffers=5 \
! video/x-raw\(memory:XLNXLL\) ! queue max-size-bytes=0 \
! fpsdisplaysink name=fpssink text-overlay=false video-sink="kmssink bus-id=a00c0000.v_mix" sync=true -v </pre>