gst-rtsp-server: add a dynamic RTSP server example
Dynamic RTSP Relay
This application provides a simple relay and server based on the GStreamer RTSP server.
The relay server allows to register resources dynamically. The syntax is
In the following example, a camera is registered to "garage" /garage -> rtsp://garage.fritz.box
The first step is the URI encode the camera the relay is to connect to:
$ python3 -c 'import urllib.parse; print("rtsp://localhost:8554/garage?uri=%s" % urllib.parse.quote("rtsp://garage.fritz.box/", safe=""))' rtsp://localhost:8554/garage?uri=rtsp%3A%2F%2Fgarage.fritz.box%2F
When the relay gets the options, it will inspect if the resource /garage (the path in the URI) is registered. If it is not, it will register it. From that point onwards, all other clients connecting to '/garage' will receive the same relayed stream.
The source the relay needs to connect to, is URI encoded in the 'uri' key in the query part of the connection string.
rtsp://server/?uri=
Once the last client disconnects, the relay session is removed.
Many sessions can be registered in parallel
Connect to the server with: $ gst-play-1.0 rtsp://localhost:8554/garage?uri=rtsp%3A%2F%2Fgarage.fritz.box%2F