How can I create multicast rtsp server using gst-rtsp-server?

Hi guys, i’m a beginner to GStreamer, and want to create a custom rtsp server using gst-rtsp-server plugin. This server can send frames (which will be generated from a camera & using other libraries) to multiple clients.

For this reason, i’ve tried example codes, test-multicast.c and test-multicast2.c.
I understood that the first one is set to send packets using only udp-multicast protocol, and the other one can send udp-uni/multicast and tcp. So, both codes can send packets through udp-multicast.

But when i create using that two codes, and create a client with a command below (same PC), the client gives me an error and cannot be connected.

gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test latency=0 protocols="udp-mcast" ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: No supported stream was found. You might need to allow more transport protocols or may otherwise be missing the right GStreamer RTSP extension plugin.
Additional debug info:
../gst/rtsp/gstrtspsrc.c(7688): gst_rtspsrc_setup_streams_start (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0

I’m using Ubuntu 22.04 and the version of GStreamer & gst-rtsp-server follows below.

$ gst-launch-1.0 --gst-version
GStreamer Core Library version 1.20.3
// meson.build
project('gst-rtsp-server', 'c',
  version : '1.19.2',
...

I’ve tried that codes without editting any lines… Is there any settings do I have to edit?
Thank’s for reading my question.

p.s.) I’ve also tested test-multicast.c server with multiple clients using udp-unicast & tcp, and they works well… Is there any documentation descripting the way how gst-rtsp-server communicates with rtsp client using that protocols? I want to know the structure of sink sending frames to each clients (e.g. unicast - packet creating for all clients).

I think there are known issues about the multicast examples not working in gitlab.

1.19.2 is a quite old unstable development snapshot, which you should not be using nowadays. It probably means you checked out the gst-rtsp-server git module from gitlab, which is no longer maintained.

Development has moved to the GStreamer monorepo, see GStreamer mono repository FAQ

Alternatively you can also find recent versions as source release tarballs here: Index of /src/gst-rtsp-server

1 Like

Thank’s for your reply. I’m really appreciated.
I reinstalled whole gst packages with latest monorepo.
However, when I execute the multicast examples and create a rtsp client (gst and vlc) I get this error on multicast examples.


I’ve followed the build guide on gstreamer docs (Building from source using Meson).
Is there any missed thing before the installation?

Thank you.

Are you in the uninstall development environment?

If not, run

ninja -C builddir devenv

and then run the binaries from the build tree.

The development environment will set environment variables so that all the plugins that have been built are found inside the build tree.

Thanks, and sorry for late reply. I’ve kept on cleaning my pc with dependencies and reinstalled the monorepo.

Now, at the devenv, that no element error no longer appears, but the client also gives me the error at the top, with showing
Error binding to address 0.0.0.0:5000: Address already in use: error binding to 224.3.0.1:5000
Error leaving multicast group

The multicast streaming using udpsink - udpsrc works well, but I don’t know why this way doesn’t work.