如何使 RTSP 会话保持活动状态? [英] How to keep RTSP session alive?

查看:87
本文介绍了如何使 RTSP 会话保持活动状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 Google nexus S (2.3.7)、HTC Desire (2.3.3) 和 Samsung Galaxy (3.2) 上进行流式传输.并且只有 Google Nexus 有 RTSP 会话超时问题.

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.

我阅读了有关此问题的一些主题.似乎我必须每秒发送一次 RTCP 请求以保持会话处于活动状态,或者我将只发送 RTSP选项"请求,该请求基本上除了为我的应用程序保持活动状态外什么都不做.谁能给我一个关于如何生成该请求的先机?我之前没有处理 RTCP 的经验.

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.

推荐答案

有两种方法可以使您的 RTSP 连接保持活动状态.

There are two ways to keep your RTSP connection alive.

  1. 使用 RTCP 协议,它应该在几秒钟内发送一个包.

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

使用 RTSP "OPTION" 请求,每 50-60 秒发送一次此请求以保持活动状态.

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

我建议你阅读一些 RTSP 库的源代码,比如libnemesi"(由 C 实现),它为你的问题提供了一个很好的例子.

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

这篇关于如何使 RTSP 会话保持活动状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆