[Live-devel] RTSP client adds undesirable trailing slash on setup command URL

Nathan nathan at team-mediaportal.com
Fri Apr 21 06:31:00 PDT 2017


Hello
 
We've built an RTSP client based on the LIVE555 streaming media library. The
client is fairly basic, so the only command/response sequence currently
supported is:
options -> describe -> setup -> play ... -> teardown
 
All has worked fine until now when we've encountered an RTSP server (actually,
SAT>IP to be specific) that doesn't support describe commands. I know the
server's output stream format in advance (MPEG 2 transport stream), so I figured
handling this shouldn't be too much of a problem. My plan was to skip the
describe command and create the required media session [for setup] by passing in
a generic SDP description. The SDP description I came up with is:
v=0\r\nt=0 0\r\na=type:broadcast\r\na=recvonly\r\nm=video 0 RTP/AVP 33
 
Unfortunately my plan has come unstuck. When I attempt to send the setup
command, the server throws back a 400 error.
 
The full setup command is:
SETUP
rtsp://192.168.2.102:554/?src=1&freq=11538&sr=22000&pol=v&msys=dvbs&fec=45&mtype=qpsk&pids=0,654,604,624,16,17,18/
RTSP/1.0
CSeq: 2
User-Agent: LIVE555 Streaming Media v2017.04.10
Transport: RTP/AVP;unicast;client_port=50794-50795
 
The full response is:
RTSP/1.0 400 Bad Request
Content-Type:text/parameters
CSeq:2
Content-Length: 103

Check-Syntax:
?src=1&freq=11538&sr=22000&pol=v&msys=dvbs&fec=45&mtype=qpsk&pids=0,654,604,624,16,17,18/
 
 
I've confirmed that the error response is caused by the trailing slash (ie.
"...17,18/") on the setup command URL. The URL we provide to LIVE555 [via
RTSPClient::createNew()] doesn't have a slash in that position.
 
LIVE555 constructs the request URL "<prefix><separator><suffix>" in
RTSPClient::setRequestFields(). The values of prefix, separator and suffix are
determined by RTSPClient::constructSubsessionURL(). In the context of this
command:
* prefix is taken from fBaseUrl, which is absolute
* suffix is not provided (no control attribute in the SDP description -
according to the RTSP RFC section C3 the control attribute is optional when the
presentation only has a single stream, which it does in this context)
* separator is set as '/' as a result of the content of prefix and suffix
When suffix is not provided/available the implication is that prefix is
absolute. In that case wouldn't it be correct for separator to be the empty
string instead of slash? After all, there's no requirement for RTSP command URLs
to end with a slash.
 
Regards,
Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20170422/20e1f814/attachment.html>


More information about the live-devel mailing list