如何强制客户端将 RTP 传输从 UDP 切换到 TCP?

问题描述:

如果客户端想要观看我的 RTSP 服务器上的流,它首先尝试通过 UDP 协议设置流.我怎么能告诉它我的服务器只支持 RTP/AVP/TCP 并且它应该切换传输?

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?

我想终止我服务器上的 UDP 支持,但所有客户端首先尝试通过 UDP 设置会话,然后他们通过 TCP 设置......我想尽快将它们切换到 TCPRTSP 协议.

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.

我该怎么做?

OK 一种方法是发送400 Bad Request"作为对客户端 SETUP 请求的响应......它会自动切换到 TCP 协议.这适用于 RealOne 和 QuickTime.

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.

但我不确定它是否适用于所有其他玩家,因为这是一个 hack.

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

还有其他想法吗?=|