首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RTSP设置请求响应实现中的问题

RTSP设置请求响应实现中的问题
EN

Stack Overflow用户
提问于 2013-09-11 22:13:09
回答 1查看 1.7K关注 0票数 0

我正在实现简单的rtsp服务器,它应该在RTSP上流mjpeg。我面临的第一个问题是当我使用一些响应数据( buffering issue with java communicating vlc )响应时,“挂起”RTSP客户端(我尝试了vlc和buffering issue with java communicating vlc)。

但是,很容易发现问题的根源在请求结束时漏掉了双重\r\n序列。我已经成功地为选项和描述编写了响应,这些选项和描述是在客户机上正确处理的。

当我试图实现安装时,我遇到了这个问题。当我输出一些格式正确的RTSP响应到安装程序时,两个openRTSPvlc都没有完整地处理响应:

代码语言:javascript
复制
openRTSP rtsp://localhost:6666/autostream.mjpg
Opening connection to 127.0.0.1, port 6666...
...remote connection opened
Sending request: OPTIONS rtsp://localhost:6666/autostream.mjpg RTSP/1.0
CSeq: 2
User-Agent: openRTSP (LIVE555 Streaming Media v2013.04.30)


Received 158 new bytes of response data.
Received a complete OPTIONS response:
RTSP/1.0 200 OK
CSeq: 2
Public: OPTIONS, PAUSE, PLAY, SETUP, SET_PARAMETER, TEARDOWN
Server: GStreamer RTSP server
Date: Tue, 10 Sep 2013 19:56:53 GMT


Sending request: DESCRIBE rtsp://localhost:6666/autostream.mjpg RTSP/1.0
CSeq: 3
User-Agent: openRTSP (LIVE555 Streaming Media v2013.04.30)
Accept: application/sdp


Received 484 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 3
Content-Type: application/sdp
Content-Base: rtsp://localhost:6666/autostream.mjpeg/
Server: GStreamer RTSP server
Date: Tue, 10 Sep 2013 19:56:53 GMT
Content-Length: 279

v=0
o=- 1188340656180883 1 IN IP4 127.0.0.1
s=Session streamed with GStreamer
i=rtsp-server
e=NONE
t=0 0
a=tool:GStreamer
a=type:broadcast
a=control:*
a=range:npt=0,000000-119,961667
m=video 0 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 JPEG/90000
a=control:stream=0

(plus 2 additional bytes)
Opened URL "rtsp://localhost:6666/autostream.mjpg", returning a SDP description:
v=0
o=- 1188340656180883 1 IN IP4 127.0.0.1
s=Session streamed with GStreamer
i=rtsp-server
e=NONE
t=0 0
a=tool:GStreamer
a=type:broadcast
a=control:*
a=range:npt=0,000000-119,961667
m=video 0 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 JPEG/90000
a=control:stream=0

Created receiver for "video/JPEG" subsession (client ports 57074-57075)
Sending request: SETUP rtsp://localhost:6666/autostream.mjpeg/stream=0 RTSP/1.0
CSeq: 4
User-Agent: openRTSP (LIVE555 Streaming Media v2013.04.30)
Transport: RTP/AVP;unicast;client_port=57074-57075


Received 215 new bytes of response data.

在留言之后什么都没发生。我猜想,有些东西在幕后与RTP和RTCP联系在一起,但是如何调试它呢?VLC和openRTSP的输出不够详细。

有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-09-11 22:52:17

和往常一样,向堆栈溢出发送愚蠢的问题有助于我自己找出问题(看上去像是墨菲定律;我必须在3个小时前发布,以挽救我的睡眠!)

关键词是

代码语言:javascript
复制
(plus 2 additional bytes)  

(openRTSP)

代码语言:javascript
复制
(plus 2 additional bytes)
[0x7f73900013f8] live555 demux debug: RTP subsession 'video/JPEG'

(vlc)

我在响应中硬编码了第二个/r/n来描述,尽管有那个响应的消息体。对于那些有空体的响应,应该有双/r/n。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18752173

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档