Difference between revisions of "Xilinx ZYNQ UltraScale+ MPSoC/GStreamer/Example Pipelines/Video Encoding"

From RidgeRun Developer Connection
Jump to: navigation, search
(Camera to network)
 
Line 38: Line 38:
  
 
== Camera to network ==  
 
== Camera to network ==  
 +
 +
We optimized these pipelines to show the low-latency capabilities of this device.
  
 
For the receiving pipeline please see the [[Xilinx ZYNQ UltraScale+ MPSoC/GStreamer/Example Pipelines/Video Decoding|Video Decoding examples]].
 
For the receiving pipeline please see the [[Xilinx ZYNQ UltraScale+ MPSoC/GStreamer/Example Pipelines/Video Decoding|Video Decoding examples]].
Line 45: Line 47:
 
'''H.264'''
 
'''H.264'''
 
<syntaxhighlight>
 
<syntaxhighlight>
gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=30/1 ! omxh264enc ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=5000
+
gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=30/1 ! queue ! omxh264enc control-rate=low-latency target-bitrate=25000 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 initial-delay=250 gdr-mode=horizontal gop-mode=low-delay-p ! video/x-h264, alignment=nal ! queue max-size-buffers=0 ! rtph264pay ! udpsink host=127.0.0.1 port=5000 buffer-size=60000000
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
'''H.265'''
 
'''H.265'''
 
<syntaxhighlight>
 
<syntaxhighlight>
gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=30/1 ! omxh265enc ! h265parse ! rtph265pay ! udpsink host=127.0.0.1 port=5000
+
gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=30/1 ! queue ! omxh265enc control-rate=low-latency target-bitrate=25000 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 initial-delay=250 gdr-mode=horizontal gop-mode=low-delay-p ! video/x-h265, alignment=nal ! queue max-size-buffers=0 ! rtph265pay ! udpsink host=127.0.0.1 port=5000 buffer-size=60000000
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 57: Line 59:
 
'''H.264'''
 
'''H.264'''
 
<syntaxhighlight>
 
<syntaxhighlight>
gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! omxh264enc ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=5000
+
gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! queue ! omxh264enc control-rate=low-latency target-bitrate=6000 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 initial-delay=250 gdr-mode=horizontal gop-mode=low-delay-p ! video/x-h264, alignment=nal ! queue max-size-buffers=0 ! rtph264pay ! udpsink host=127.0.0.1 port=5000
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
'''H.265'''
 
'''H.265'''
 
<syntaxhighlight>
 
<syntaxhighlight>
gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! omxh265enc ! h265parse ! rtph265pay ! udpsink host=127.0.0.1 port=5000
+
gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! omxh265enc control-rate=low-latency target-bitrate=6000 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 initial-delay=250 gdr-mode=horizontal gop-mode=low-delay-p ! video/x-h265, alignment=nal ! queue max-size-buffers=0 ! rtph265pay ! udpsink host=127.0.0.1 port=5000
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
<noinclude>{{Xilinx ZYNQ UltraScale+ MPSoC/Foot|GStreamer/Example Pipelines/Display to FPGA|GStreamer/Example Pipelines/Video Decoding}}</noinclude>
 
<noinclude>{{Xilinx ZYNQ UltraScale+ MPSoC/Foot|GStreamer/Example Pipelines/Display to FPGA|GStreamer/Example Pipelines/Video Decoding}}</noinclude>

Latest revision as of 13:12, 8 December 2022






Previous: GStreamer/Example Pipelines/Display to FPGA Index Next: GStreamer/Example Pipelines/Video Decoding






The following pipelines were tested using the smartcam firmware, which is based on the kv260_ispMipiRx_vcu_DP Vitis platform provided by Xilinx. This platform contains the following input pipeline:

AR1335 camera -> AP1302 ISP -> MIPI CSI-2 RX Subsystem -> Video Frame Buffer Write

Camera to disk

4K

H.264

gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=30/1 ! omxh264enc ! h264parse ! mp4mux ! filesink location=test.mp4

H.265

gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=30/1 ! omxh265enc ! h265parse ! mp4mux ! filesink location=test.mp4

1080p

H.264

gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! omxh264enc ! h264parse ! mp4mux ! filesink location=test.mp4

H.265

gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! omxh265enc ! h265parse ! mp4mux ! filesink location=test.mp4

Camera to network

We optimized these pipelines to show the low-latency capabilities of this device.

For the receiving pipeline please see the Video Decoding examples.

4K

H.264

gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=30/1 ! queue ! omxh264enc control-rate=low-latency target-bitrate=25000 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 initial-delay=250 gdr-mode=horizontal gop-mode=low-delay-p ! video/x-h264, alignment=nal ! queue max-size-buffers=0 ! rtph264pay ! udpsink host=127.0.0.1 port=5000 buffer-size=60000000

H.265

gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=30/1 ! queue ! omxh265enc control-rate=low-latency target-bitrate=25000 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 initial-delay=250 gdr-mode=horizontal gop-mode=low-delay-p ! video/x-h265, alignment=nal ! queue max-size-buffers=0 ! rtph265pay ! udpsink host=127.0.0.1 port=5000 buffer-size=60000000

1080p

H.264

gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! queue ! omxh264enc control-rate=low-latency target-bitrate=6000 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 initial-delay=250 gdr-mode=horizontal gop-mode=low-delay-p ! video/x-h264, alignment=nal ! queue max-size-buffers=0 ! rtph264pay ! udpsink host=127.0.0.1 port=5000

H.265

gst-launch-1.0 -e mediasrcbin media-device=/dev/media0 v4l2src0::io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1 ! omxh265enc control-rate=low-latency target-bitrate=6000 prefetch-buffer=true num-slices=8 periodicity-idr=240 cpb-size=500 initial-delay=250 gdr-mode=horizontal gop-mode=low-delay-p ! video/x-h265, alignment=nal ! queue max-size-buffers=0 ! rtph265pay ! udpsink host=127.0.0.1 port=5000


Previous: GStreamer/Example Pipelines/Display to FPGA Index Next: GStreamer/Example Pipelines/Video Decoding