I’m confused about the RTSP multicast example: https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-multicast.c
I thought this was setting up an RTSP stream on multicast from 126.96.36.199 to 188.8.131.52 with ports 5000 to 5010, but at the end it prints out:
stream ready at rtsp://127.0.0.1:8554/test
If I want to use VLC to test this shouldn’t I use something like:
You are confusing the service address with the RTP/RTCP connection address.
- The RTSP server listens for new connection requests from clients on the service address. In your example this is 127.0.0.1:8554
- A new client sends a request to the service address .
- The SDP handshake is performed between the server/client to discover the common capabilities.
- If successful, the server will assign the client a new unique address pair: one for the RTP data (media content) and another for the RTCP (control content). In your example, these would be taken from the multicast addresses you specified in the pool.
In short, clients still request a stream to
rtsp://127.0.0.1:8554/test but the actual RTP packets of the stream travel through the multicast address. A tool like wireshark can verify this behavior.
GStreamer development has moved to the gstreamer monorepo now, so the latest version of this example can be found at subprojects/gst-rtsp-server/examples · main · GStreamer / gstreamer · GitLab these days for what it’s worth (not that much has changed recently).
Is there any documentation on the difference between the two examples?
The example is the same in both links, it has not been changed. However the latest version of the gst-rtsp-server code is the one in the monorepo (the one that @tpm shared). You should be looking at that one instead.
But in that repo there’s a test-multicast.c and a test-multicast2.c. Would be useful to have documentation for them.
Ah! my bad. I’m not aware of any documentation about the examples. But if it is of any help:
- test-multicast.c: shows how to provide a pool of multicast addresses and let the server use it to automatically assign them to clients and their streams. Use this if you don’t care which client/stream is assigned to which address/ports (most typical scenario I would say).
- test-multicast2.c: shows how to assign each individual stream a specific multicast address. Use this if you need to have control of which client/stream is assigned to which address/ports.