[Live-devel] RTSP server - Parsing URL parameters

Ross Finlayson finlayson at live555.com
Mon Nov 30 20:38:05 PST 2020



> On Dec 1, 2020, at 5:15 PM, Idan Freiberg <idan at tokagroup.com> wrote:
> 
> Hi live555 developers,
> 
> I wonder if it’s possible to pass parameters through the RTSP url and fetch them on the MediaSession level when getting the request and after the MediaSession has been registered.
> 
> For example: I would like to be able to connect as follows: rtsp://<ip>/camera/1?resolution=640x480&audio=true

Our RTSP client software does not interpret the contents of the “rtsp://' URL string after the IP address; it simply passes the string, untouched, to the RTSP server.  Any ‘parameters’ within the URL are intended to be interpreted/handled by the RTSP server, not the RTSP client.  So, if your RTSP server handles these parameters, then our RTSP client software should work OK.

You can test this with our “openRTSP” command-line client (see http://www.live555.com/openRTSP/ ):
	openRTSP 'rtsp://<ip>/camera/1?resolution=640x480&audio=true’
(Note that you’ll need to enclose the RTSP URL in quotes, because of the ‘?’ and ‘&’ characters.)


Note, however, that our RTSP *server* code does not, by default, interpret parameters in URLs.  By default, it treats the part of the URL after the IP address as an opaque string.  If you are using our RTSP server implementation, and wish to have it interpret parameters in URLs, then you would need to subclass “RTSPServer”, and reimplement the virtual member function “lookupServerMediaSession()”, similar to what we did to implement the “LIVE555 Media Server” application.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list