<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head><body style=""><div>Hello</div>
<div> </div>
<div>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:</div>
<div>options -> describe -> setup -> play ... -> teardown</div>
<div> </div>
<div>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:</div>
<div>v=0\r\nt=0 0\r\na=type:broadcast\r\na=recvonly\r\nm=video 0 RTP/AVP 33</div>
<div> </div>
<div>Unfortunately my plan has come unstuck. When I attempt to send the setup command, the server throws back a 400 error.</div>
<div> </div>
<div>The full setup command is:</div>
<div>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<br>CSeq: 2<br>User-Agent: LIVE555 Streaming Media v2017.04.10<br>Transport: RTP/AVP;unicast;client_port=50794-50795</div>
<div> </div>
<div>The full response is:</div>
<div>RTSP/1.0 400 Bad Request<br>Content-Type:text/parameters<br>CSeq:2<br>Content-Length: 103<br><br>Check-Syntax: ?src=1&freq=11538&sr=22000&pol=v&msys=dvbs&fec=45&mtype=qpsk&pids=0,654,604,624,16,17,18/</div>
<div> </div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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:</div>
<div>
<ul>
<li>prefix is taken from fBaseUrl, which is absolute</li>
<li>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)</li>
<li>separator is set as '/' as a result of the content of prefix and suffix</li>
</ul>
</div>
<div>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.</div>
<div> </div>
<div>Regards,</div>
<div>Nathan</div></body></html>