How to keep RTSP session alive?

ⅰ亾dé卋堺 提交于 2020-01-01 18:02:54

问题


I tried streaming on Google nexus S (2.3.7), HTC Desire (2.3.3), and Samsung Galaxy (3.2). And only Google Nexus has RTSP session timeout issue.

I read up on some threads about this problem. It seems like I'll have to send RTCP request every second to keep the session alive, or I'll just send RTSP "OPTION" request which will basically do nothing but keep alive for my app. Could anyone give me a head start on how to generate that request? I have no experience dealing with RTCP before.


回答1:


There are two ways to keep your RTSP connection alive.

  1. Use RTCP protocol, it should send a package within seconds.

  2. Use RTSP "OPTION" request, send this request every 50-60 seconds to keep alive.

I suggest you read some source code of RTSP library, such as "libnemesi"(implemented by C), it gives a good example for your problem.

https://github.com/syhou/Libnemesi-reborn



来源:https://stackoverflow.com/questions/9880998/how-to-keep-rtsp-session-alive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!