Sending Gstreamer pipeline output over RTSP

first lets clear the difference between RTP and RTSP, RTSP is a real-time streaming protocol, while RTP is the transport protocol used to transport media data negotiated over RTSP.
In order to send a Gstreamer pipeline output over RTSP you’ll first need to install an RTSP server, in case of Hailo15 one is already installed as part of the Gstreamer.

for example:

  1. Download and extract a standalone binary from the release page that corresponds to your operating system and architecture.
  2. Start the server:
    ./mediamtx
    

now you can run the pipeline on the server side, for example streaming an h264 video to localhost:

gst-launch-1.0 -v videotestsrc ! videoconvert ! videoscale ! video/x-raw,width=640,height=480 ! x264enc speed-preset=veryfast tune=zerolatency bitrate=800 ! rtspclientsink location=rtsp://localhost:8554/test

on the client side you can use either a Gstreamer pipeline:

gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:8554/test latency=0 ! decodebin ! autovideosink

or open a VLC and configure it according to this:
open vlc-player → Media → Open Network Stream, set network url as:
rtsp://localhost:8554/test

1 Like

A couple of more points:

  1. You may need to install rtspclientsink plugin by running sudo apt install gstreamer1.0-rtsp

  2. If you are streaming a USB camera input or a file compressed in H264, you may have to convert to NV12 because the decoder on the client side may not be able to decode other format. At least, that’s the case when it uses VAAPI decoder.
    Example:
    gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw,format=NV12,width=640,height=480 ! x264enc speed-preset=veryfast tune=zerolatency bitrate=800 ! rtspclientsink location=rtsp://localhost:8554/test