tags:

views:

510

answers:

4

If the client wants to watch a stream that is on my RTSP server, it first tries to setup a stream through the UDP protocol. How can I tell it that my server only supports RTP/AVP/TCP and that it should switch transports? I want to terminate the UDP support on my server, but all the clients first try to SETUP the session over UDP, and later they do so over TCP... and I want to switch them to TCP as soon as possible in RTSP protocol. How can I do that?

+2  A: 

OK one way is to send "400 Bad Request" as the response to the client's SETUP request... and it automatically switches to TCP protocol. This is for RealOne and QuickTime.

But I am not sure that it will work on all other players since this is a hack.

Any other ideas? =|

Cipi
+1  A: 

What client connects to your server? Some clients can be triggered through the URI method in the URL. For example, you could specify rtspt://myhost/path.sdp.

If you have control over client/servers you could use the Require header on clients and Unsupported on servers to indicate that UDP isn't supported; but most clients I've seen don't use this.

J. Fritz Barnes
Multimedia players that support RTSP. Like RealOne, QuickTime, VLC, Media Player Clasic... What method I dont get you? I dont have control over clients, I wrote the server, so its the only control I have. I cant send Unsupported for Transfer header. =\
Cipi
Windows Media Player supports the use of rtspt in the URLs and some mobile handset RTSP players also support this as a signalling method to attempt interleaved RTP transport instead of the standard UDP. However, VLC and QT do not support this signalling.
J. Fritz Barnes
If I get you all I need to do is add the "t" in "rtspt"? =|
Cipi
Correct. I know that Windows Media Player on Windows supports this and in WinMo. I tried this against QT, but it didn't seem to recognize the rtspt; this seems to be a vendor specific implementation whether to recognize it.
J. Fritz Barnes
+1  A: 

You can try to pass "transport" header in a response to Describe request, and state there that your server only supports RTP/AVP/TCP transport, and the client should know that UDP is unsupported.

Sendro
+1  A: 

As far as I know, there is no control at server side for transport type preference. Server should be made generic it should support RTP over UDP, RTP over TCP, RTP over RTSP and RTP over RTSP over HTTP(S). And its clients choice which transport to choose. Transport field is first sent in SETUP request

1) UDP

 C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/1.0
               CSeq: 1
               Transport: RTP/AVP/UDP;unicast;client_port=3056-3057

2) TCP

    C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/1.0
               CSeq: 1
               Transport: RTP/AVP/TCP;unicast;client_port=3056-3057

3) RTP over RTSP and RTP over RTSP over HTTP(S)

S->C: RTSP/1.0 200 OK
           CSeq: 2
           Date: 05 Jun 1997 18:57:18 GMT
           Transport: RTP/AVP/TCP;interleaved=0-1

As we can see "Transport type" request is sent by client side.

If you want to support TCP only server you can send "400 Bad Request" or "461 Unsupported transport" in response to SETUP request as suggested by you or another way is to send 200 OK but do not transmit any RTP packets. Client will timeout and get to know that it is behind proxy and it will send SETUP request again with RTP/AVP/TCP parameter (Not an ideal case).

alam
+1 for 461, but basically the same idea that I had. =)
Cipi
Yes your approach was correct
alam