UDP Streaming

From RidgeRun Developer Wiki





Follow Us On Twitter LinkedIn Email Share this page



Preferred Partner Logo 3



Streaming

In this section we present some pipeline examples of how to stream video over the network using the udpsink element.

H264

This pipeline generates a test video pattern, compresses it using the H.264 codec, and streams it over UDP:

GST_DEBUG="GST_TRACER:7" GST_TRACERS="interlatency;framerate;cpuusage" gst-launch-1.0 -e videotestsrc is-live=true ! 'video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1' ! queue ! v4l2h264enc ! h264parse ! queue ! rtph264pay mtu=1400 ! queue ! udpsink host=127.0.0.1 port=5000

H265

This pipeline creates a test video feed, encodes it in H.265 format with specific settings, and delivers it via UDP:

GST_DEBUG="GST_TRACER:7" GST_TRACERS="interlatency;framerate;cpuusage" gst-launch-1.0 -e videotestsrc is-live=true ! 'video/x-raw, width=1920, height=1080, format=NV12, framerate=30/1' ! queue ! v4l2h265enc ! h265parse ! queue ! rtph265pay mtu=1400 ! queue ! udpsink host=127.0.0.1 port=5000

Clients

This section provides information about how to receive and display the UDP stream generated by the streaming pipelines, using GStreamer.

Note
These pipelines should be run inside the board as well, since they are using the local host.

H264

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! queue ! v4l2h264dec ! queue ! autovideosink

H265

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse ! queue ! v4l2h265dec ! queue ! autovideosink