Live555 是一个为流媒体提供解决方案的跨平台的C++开源项目,它实现了对标准流媒体传输协议如RTP/RTCP、RTSP、SIP等的支持。Live555实现 了对多种音视频编码格式的音视频数据的流化、接收和处理等支持,包括MPEG、H.263+、DV、JPEG视频和多种音频编码。同时由于良好的设 计,Live555非常容易扩展对其他格式的支持。目前,Live555已经被用于多款播放器的流媒体播放功能的实现,如VLC(VideoLan)、 MPlayer。下面介绍Live555的基本使用方法。

编译

编译方法:

./genMakefiles <os-platform>

如在Linux 下解压Live555后进入目录:

#./genMakefiles linux

#Make

使用

1)进入mediaServer目录启动服务器:

[root@localhost mediaServer]# cd mediaServer]

[root@localhost mediaServer]# ./live555MediaServer

LIVE555 Media Server

version 0.5 (LIVE555 Streaming Media library version 2010.07.29).

Play streams from this server using the URL

rtsp://192.168.1.120/<filename>

where <filename> is a file present in the current directory.

Each file's type is inferred from its name suffix:

".aac" => an AAC Audio (ADTS format) file

".amr" => an AMR Audio file

".m4e" => a MPEG-4 Video Elementary Stream file

".dv" => a DV Video file

".mp3" => a MPEG-1 or 2 Audio file

".mpg" => a MPEG-1 or 2 Program Stream (audio+video) file

".ts" => a MPEG Transport Stream file

(a ".tsx" index file - if present - provides server 'trick play' support)

".wav" => a WAV Audio file

See http://www.live555.com/mediaServer/ for additional documentation.

2)进入testProgs使用客户端工具播放mp3

[root@localhost testProgs]# ./openRTSP rtsp://192.168.1.120/1.mp3

Opening connection to 192.168.1.120, port 554...

...remote connection opened

Sending request: OPTIONS rtsp://192.168.1.120/1.mp3 RTSP/1.0

CSeq: 2

User-Agent: ./openRTSP (LIVE555 Streaming Media v2010.07.29)

Received 152 new bytes of response data.

Received a complete OPTIONS response:

RTSP/1.0 200 OK

CSeq: 2

Date: Sun, Aug 01 2010 05:17:32 GMT

Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER

Sending request: DESCRIBE rtsp://192.168.1.120/1.mp3 RTSP/1.0

CSeq: 3

User-Agent: ./openRTSP (LIVE555 Streaming Media v2010.07.29)

Accept: application/sdp

Received 547 new bytes of response data.

Received a complete DESCRIBE response:

RTSP/1.0 200 OK

CSeq: 3

Date: Sun, Aug 01 2010 05:17:32 GMT

Content-Base: rtsp://192.168.1.120/1.mp3/

Content-Type: application/sdp

Content-Length: 387

v=0

o=- 1280639653739259 1 IN IP4 192.168.1.120

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

i=1.mp3

t=0 0

a=tool:LIVE555 Streaming Media v2010.07.29

a=type:broadcast

a=control:*

a=range:npt=0-219.555

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

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

m=audio 0 RTP/AVP 14

c=IN IP4 0.0.0.0

b=AS:128

a=control:track1

Opened URL "rtsp://192.168.1.120/1.mp3", returning a SDP description:

v=0

o=- 1280639653739259 1 IN IP4 192.168.1.120

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

i=1.mp3

t=0 0

a=tool:LIVE555 Streaming Media v2010.07.29

a=type:broadcast

a=control:*

a=range:npt=0-219.555

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

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

m=audio 0 RTP/AVP 14

c=IN IP4 0.0.0.0

b=AS:128

a=control:track1

Created receiver for "audio/MPA" subsession (client ports 32772-32773)

Sending request: SETUP rtsp://192.168.1.120/1.mp3/track1 RTSP/1.0

CSeq: 4

User-Agent: ./openRTSP (LIVE555 Streaming Media v2010.07.29)

Transport: RTP/AVP;unicast;client_port=32772-32773

Received 205 new bytes of response data.

Received a complete SETUP response:

RTSP/1.0 200 OK

CSeq: 4

Date: Sun, Aug 01 2010 05:17:32 GMT

Transport: RTP/AVP;unicast;destination=192.168.1.120;source=192.168.1.120;client_port=32772-32773;server_port=6970-6971

Session: 624DAEF4

Setup "audio/MPA" subsession (client ports 32772-32773)

Created output file: "audio-MPA-1"

Sending request: PLAY rtsp://192.168.1.120/1.mp3/ RTSP/1.0

CSeq: 5

User-Agent: ./openRTSP (LIVE555 Streaming Media v2010.07.29)

Session: 624DAEF4

Range: npt=0.000-219.555

Received 188 new bytes of response data.

Received a complete PLAY response:

RTSP/1.0 200 OK

CSeq: 5

Date: Sun, Aug 01 2010 05:17:33 GMT

Range: npt=0.000-219.555

Session: 624DAEF4

RTP-Info: url=rtsp://192.168.1.120/1.mp3/track1;seq=38835;rtptime=1769974566

Started playing session

Receiving streamed data (for up to 224.555000 seconds)...

Sending request: TEARDOWN rtsp://192.168.1.120/1.mp3/ RTSP/1.0

CSeq: 6

User-Agent: ./openRTSP (LIVE555 Streaming Media v2010.07.29)

Session: 624DAEF4

Received 65 new bytes of response data.

Received a complete TEARDOWN response:

RTSP/1.0 200 OK

CSeq: 6

Date: Sun, Aug 01 2010 05:21:17 GMT

最新文章

  1. RedisRepository封装—Redis发布订阅以及StackExchange.Redis中的使用
  2. ssh批量互信脚本
  3. 关于android:configChanges小结
  4. Linux 统计代码行数命令
  5. Asp.net mvc4 + HighCharts + 柱状图
  6. eclipse ldt update resource
  7. 生成csv格式文件并导出至页面的前后台实现
  8. Python 官方文档解读(2):threading 模块
  9. linun 乌班图 vim : 依赖: vim-common (= 2:7.3.429-2ubuntu2) 但是 2:7.3.429-2ubuntu2.1 正要被安装
  10. 小米Note3 MIUI9可以用的XPosed框架
  11. enum类使用
  12. JAVA(三)JAVA常用类库/JAVA IO
  13. Improving your submission -- Kaggle Competitions
  14. IPM
  15. Immutable集合
  16. bzoj P1058 [ZJOI2007]报表统计——solution
  17. 最小化安装CentOS7,没有ifconfig命令---yum search command_name搜索未知包名
  18. 将NSString变成贝塞尔曲线
  19. Django 工作流程
  20. Fibonacci使用递归和循环实现

热门文章

  1. (5)Flask项目会员登录页
  2. MSYS2 常见操作
  3. 系统重装之认识UEFI
  4. PAT 甲级 1080 Graduate Admission (30 分) (简单,结构体排序模拟)
  5. PP篇11 增、改生产订单组件BAPI
  6. [LeetCode] 800. Similar RGB Color 相似的红绿蓝颜色
  7. 函数vs方法
  8. python:单元测试框架pytest的一个简单例子
  9. Oracle和Mysql中的字符串的拼接
  10. DHCP配置实例(含DHCP中继代理)