Live555 OpenRTSP 客户端重新连接到服务器
情况是这样的:
- 我用 Live555 openRTSP Client 连接到 RTSP Server
- 然后假设服务器连接丢失
要重新连接 rtsp 服务器,我应该做什么?
- openRTSP Client 是否处理这个问题? [在我的实验中没有]
- 如果不是,我应该如何检测连接丢失, 并修改Open Rtsp Client代码重新连接服务器?
有什么建议吗?
This is the situation:
- I connect to RTSP Server with Live555 openRTSP Client
- Then supose that The Server connection is lost
To Re-connect the rtsp server, what should i do?
- Does openRTSP Client handle this? [ in my experiment it does not]
- If Not how should i detect connection lost,
and modify the Open Rtsp Client code to re-connect the server?
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
IMO 最简单的方法是设置一个新的 RTSP 会话。
1.) 据我所知,没有
2.) 您可以在 live555 事件循环中安排一个定期任务,检查在过去的 n 秒内是否收到了任何样本。如果没有,您可以尝试在开始新会话之前拆除现有会话。但是,如果服务器和客户端之间的连接已断开,则 TEARDOWN 也可能会失败(这没关系,因为 RTSP 服务器在任何情况下都会使 RTSP 会话超时)。据我所知,RTSP 服务器上的 live555 超时是 60 秒。
为了清楚起见:
连接到底是什么意思:RTSP 服务器和客户端之间的链接?
您是通过 UDP 传输 RTP 还是通过 RTSP (TCP) 传输 RTP?如果您在 RTSP 上交错 RTP,则当 TCP 连接断开时,您也许能够检测到连接故障。
IMO it would be easiest to setup a new RTSP session.
1.) not as far as I know
2.) you can schedule a periodic task in the live555 event loop that checks if any samples have been received in the last n seconds. If not, you could try to teardown the existing session before beginning a new one. However if the connection has gone down between the server and client, your TEARDOWN might also fail (which is ok since the RTSP server times out RTSP sessions in any case). The live555 timeout on the RTSP server is 60 seconds as far as I remember.
For clarity purposes:
What exactly do you mean by connection: the link between the RTSP server and client?
Are you streaming RTP over UDP or RTP over RTSP (TCP)? If you are interleaving RTP over RTSP, you may be able to detect the connection failure when the TCP connection goes down.