live555库安装_live555库的使用总结 | 学步园

一、

live555\testProgs\testRTSPClient.cpp 测试rtsp命令和数据接收:

1.发送并处理Describe消息

rtspClient->sendDescribeCommand(continueAfterDESCRIBE);

2.发送并处理Setup消息

rtspClient->sendSetupCommand(*scs.subsession, continueAfterSETUP);

3. 创建sink,准备接收媒体数据

scs.subsession->sink =DummySink::createNew(env, *scs.subsession, rtspClient->url());

4.开始播放

scs.subsession->sink->startPlaying(*(scs.subsession->readSource()),

subsessionAfterPlaying, scs.subsession);

5.获取媒体数据

Poll 模式调用getNexFrame获取媒体数据

fSource->getNextFrame(fReceiveBuffer, DUMMY_SINK_RECEIVE_BUFFER_SIZE,

afterGettingFrame,this,

onSourceClosure, this);

VLC 的live555插件也是使用poll模式调用getNexFame 获取媒体数据

日志信息

------------------------------------------------------------------------------------------------------------------------------------

$ ./testRTSPClient rtsp://10.148.6.83:8554/123.mp3

Opening connection to 10.148.6.83, port 8554...

...remote connection opened

Sending request: DESCRIBE rtsp://10.148.6.83:8554/123.mp3 RTSP/1.0

CSeq: 2

User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2013.08.16)

Accept: application/sdp

Received 554 new bytes of response data.

Received a complete DESCRIBE response:

RTSP/1.0 200 OK

CSeq: 2

Date: Thu, Aug 29 2013 08:28:33 GMT

Content-Base: rtsp://10.148.6.83:8554/123.mp3/

Content-Type: application/sdp

Content-Length: 389

v=0

o=- 1377764913366009 1 IN IP4 10.148.6.83

s=MPEG-1 or 2 Audio, streamed by the LIVE555 Media Server

i=123.mp3

t=0 0

a=tool:LIVE555 Streaming Media v2013.04.01

a=type:broadcast

a=control:*

a=range:npt=0-115.984

a=x-qt-text-nam:MPEG-1 or 2 Audio, streamed by the LIVE555 Media Server

a=x-qt-text-inf:123.mp3

m=audio 0 RTP/AVP 14

c=IN IP4 0.0.0.0

b=AS:128

a=control:track1

[URL:"rtsp://10.148.6.83:8554/123.mp3/"]: Got a SDP description:

v=0

o=- 1377764913366009 1 IN IP4 10.148.6.83

s=MPEG-1 or 2 Audio, streamed by the LIVE555 Media Server

i=123.mp3

t=0 0

a=tool:LIVE555 Streaming Media v2013.04.01

a=type:broadcast

a=control:*

a=range:npt=0-115.984

a=x-qt-text-nam:MPEG-1 or 2 Audio, streamed by the LIVE555 Media Server

a=x-qt-text-inf:123.mp3

m=audio 0 RTP/AVP 14

c=IN IP4 0.0.0.0

b=AS:128

a=control:track1

[URL:"rtsp://10.148.6.83:8554/123.mp3/"]: Initiated the "audio/MPA" subsession (client ports 59780-59781)

Sending request: SETUP rtsp://10.148.6.83:8554/123.mp3/track1 RTSP/1.0

CSeq: 3

User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2013.08.16)

Transport: RTP/AVP;unicast;client_port=59780-59781

Received 201 new bytes of response data.

Received a complete SETUP response:

RTSP/1.0 200 OK

CSeq: 3

Date: Thu, Aug 29 2013 08:28:33 GMT

Transport: RTP/AVP;unicast;destination=10.148.6.83;source=10.148.6.83;client_port=59780-59781;server_port=6970-6971

Session: 317A2B2D

[URL:"rtsp://10.148.6.83:8554/123.mp3/"]: Set up the "audio/MPA" subsession (client ports 59780-59781)

[URL:"rtsp://10.148.6.83:8554/123.mp3/"]: Created a data sink for the "audio/MPA" subsession

Sending request: PLAY rtsp://10.148.6.83:8554/123.mp3/ RTSP/1.0

CSeq: 4

User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2013.08.16)

Session: 317A2B2D

Range: npt=0.000-

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 835 bytes.     Presentation time: 1377764913.797714!

Received 186 new bytes of response data.

Received a complete PLAY response:

RTSP/1.0 200 OK

CSeq: 4

Date: Thu, Aug 29 2013 08:28:33 GMT

Range: npt=0.000-

Session: 317A2B2D

RTP-Info: url=rtsp://10.148.6.83:8554/123.mp3/track1;seq=49924;rtptime=3855656678

[URL:"rtsp://10.148.6.83:8554/123.mp3/"]: Started playing session (for up to 117.984000 seconds)...

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 835 bytes.     Presentation time: 1377764913.849856

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 836 bytes.     Presentation time: 1377764913.902100

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 836 bytes.     Presentation time: 1377764913.954344

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 836 bytes.     Presentation time: 1377764914.006588

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 836 bytes.     Presentation time: 1377764914.058832

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 836 bytes.     Presentation time: 1377764914.111087

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 836 bytes.     Presentation time: 1377764914.163331

Stream "rtsp://10.148.6.83:8554/123.mp3/"; audio/MPA:   Received 836 bytes.     Presentation time: 1377764914.215575

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值