This section describes some recommended settings to be used for encoder and decoder to run Xilinx low-latency mode pipelines with optimum latency.
- Use encoder and decoder parameters as shown in the following table.
Table 1. Parameters for Xilinx Low-Latency Mode Codec and Streams Encoder Parameters kmssink Parameters target-bitrate periodicity-idr cpb-size initial-delay max-lateness processing-deadline All 1x AVC/HEVC 2 25000 240 500 250 5 ms (default) 0 ms (default) 2x 1080p AVC/HEVC 2 12500 240 500 250 5 ms (default) 0 ms (default) 4x 1080p AVC 3 6250 240 500 250 5 ms (default) 0 ms (default) 4x 1080p HEVC 3 6250 240 500 250 5 ms (default) 5 ms (NV12) 7 ms (XV20)
2x 4kp30 AVC 2 12500 240 500 250 5 ms (default) 0 ms (default) 2x 4kp30 HEVC 2 12500 240 500 250 10 ms 0 ms (default) - 1x: Single stream use-case
- 2x: Use case with two streams (for example, video0 and video1) running in parallel
- 4x: Use case with four streams (for example, video0, video1, video2 and video3) running in parallel
The following are the common encoder parameters for Xilinx low latency pipelines:
Table 2. Encoder Parameters num-slices control-rate gop-mode filler-data prefetch-buffer gdr-mode 8 low-latency low-delay-p 0 True horizontal Note: Use the decoder parameterinternal-entropy-buffers=3
for XV20 2x 4kp30 use case only. Use decoder parameterinternal-entropy-buffers=3
for XV20 2x 4kp30 due to memory constraints. Useprocessing-deadline=5 ms
for 4x HEVC use-cases as shown in above table to mitigate high latencies in the multi-stream environment. - For 4x hevc serial pipelines, it is recommended to set
processing-deadline = 5 ms
for NV12 andprocessing-deadline = 7 ms
for XV20 to mitigate higher latencies due to multistream as mentioned in the table. - It is recommended to set the decoder parameter
internal-entropy-buffers=3
for XV20 2x 4kp30 use case only due to memory constraints. - It is recommended to use more output buffers for HEVC use-case in multistream
scenarios to optimize the latencies further. This is possible by prefixing
pipeline with ENC_EXTRA_OP_BUFFERS as shown in the following
pipes:
ENC_EXTRA_OP_BUFFERS=10 gst-launch-1.0 -v v4l2src io-mode=dmabuf device=/dev/video0 ! video/x-raw/(memory:XLNXLL/), width=3840, height=2160, format=NV12, framerate=30/1 ! omxh265enc control-rate=low-latency target-bitrate=6250 filler-data=0 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 gdr-mode=horizontal initial-delay=250 gop-mode=low-delay-p ! video/x-h265, alignment=nal ! queue max-size-buffers=0 ! omxh265dec low-latency=1 ! video/x-raw/(memory:XLNXLL/) ! queue max-size-bytes=0 ! fpsdisplaysink name=fpssink text-overlay=false 'video-sink=kmssink bus-id=a0070000.v_mix plane-id=33 max-lateness=5000000 hold-extra-sample=1 show-preroll=false render-rectangle=<0,0,3840,2160> sync=true processing-deadline=0' sync=true -v > /run/pipeline0_$filename.txt 2>&1 &
ENC_EXTRA_OP_BUFFERS=10 gst-launch-1.0 -v v4l2src io-mode=dmabuf device=/dev/video1 ! video/x-raw/(memory:XLNXLL/), width=3840, height=2160, format=NV12, framerate=30/1 ! omxh265enc control-rate=low-latency target-bitrate=6250 filler-data=0 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 gdr-mode=horizontal initial-delay=250 gop-mode=low-delay-p ! video/x-h265, alignment=nal ! queue max-size-buffers=0 ! omxh265dec low-latency=1 ! video/x-raw/(memory:XLNXLL/) ! queue max-size-bytes=0 ! fpsdisplaysink name=fpssink text-overlay=false 'video-sink=kmssink bus-id=a0070000.v_mix plane-id=34 max-lateness=5000000 hold-extra-sample=1 show-preroll=false render-rectangle=<1920,0,3840,2160> sync=true processing-deadline=0' sync=true -v > /run/pipeline1_$filename.txt 2>&1 &