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

live555的使用(转载)的更多相关文章

  1. live555—VS2010/VS2013 下live555编译、使用及测试(转载)

    Ⅰ live555简介 Live555 是一个为流媒体提供解决方案的跨平台的C++开源项目,它实现了对标准流媒体传输协议如RTP/RTCP.RTSP.SIP等 的支持.Live555实现了对多种音视频 ...

  2. 40 网络相关函数(八)——live555源码阅读(四)网络

    40 网络相关函数(八)——live555源码阅读(四)网络 40 网络相关函数(八)——live555源码阅读(四)网络 简介 15)writeSocket向套接口写数据 TTL的概念 函数send ...

  3. 39 网络相关函数(七)——live555源码阅读(四)网络

    39 网络相关函数(七)——live555源码阅读(四)网络 39 网络相关函数(七)——live555源码阅读(四)网络 简介 14)readSocket从套接口读取数据 recv/recvfrom ...

  4. 38 网络相关函数(六)——live555源码阅读(四)网络

    38 网络相关函数(六)——live555源码阅读(四)网络 38 网络相关函数(六)——live555源码阅读(四)网络 简介 12)makeSocketNonBlocking和makeSocket ...

  5. 37 网络相关函数(五)——live555源码阅读(四)网络

    37 网络相关函数(五)——live555源码阅读(四)网络 37 网络相关函数(五)——live555源码阅读(四)网络 简介 10)MAKE_SOCKADDR_IN构建sockaddr_in结构体 ...

  6. 36 网络相关函数(四)——live555源码阅读(四)网络

    36 网络相关函数(四)——live555源码阅读(四)网络 36 网络相关函数(四)——live555源码阅读(四)网络 简介 7)createSocket创建socket方法 8)closeSoc ...

  7. 35 网络相关函数(三)——live555源码阅读(四)网络

    35 网络相关函数(三)——live555源码阅读(四)网络 35 网络相关函数(三)——live555源码阅读(四)网络 简介 5)NoReuse不重用地址类 6)initializeWinsock ...

  8. 34 网络相关函数(二)——live555源码阅读(四)网络

    34 网络相关函数(二)——live555源码阅读(四)网络 34 网络相关函数(二)——live555源码阅读(四)网络 2)socketErr 套接口错误 3)groupsockPriv函数 4) ...

  9. 33 网络相关函数(一)——live555源码阅读(四)网络

    33 网络相关函数(一)——live555源码阅读(四)网络 33 网络相关函数(一)——live555源码阅读(四)网络 简介 1)IsMulticastAddress多播(组播)地址判断函数 多播 ...

随机推荐

  1. java 465端口发送邮件

    package com.fr.function; import java.io.IOException; import java.security.Security; import java.util ...

  2. 关于Objective-C新增的__kindof关键字

    Objective-C随着Xcode 7的升级带来了许多新特性,当然此次更新最最大的就是引入了Objective-C的轻量级泛型,确切地说是Objective-C类的轻量级泛型.除此之外,还有一个小特 ...

  3. Python3基础 函数 __name__ 得到引用所指向的真正名字

             Python : 3.7.3          OS : Ubuntu 18.04.2 LTS         IDE : pycharm-community-2019.1.3    ...

  4. 011-数据结构-树形结构-B+树[mysql应用]、B*树

    一.B+树概述 B+树是B树的变种,有着比B树更高的查询效率. 一棵 B+ 树需要满足以下条件: 节点的子树数和关键字数相同(B 树是关键字数比子树数少一) 节点的关键字表示的是子树中的最大数,在子树 ...

  5. bim模型中所有IfcWallStandardCase构件

    ifc中的IfcWallStandardCase构件 //执行吊装 void startHoisting() { osg::Vec3f vec3f1 = index_node1->getBoun ...

  6. piecewise_construct存在的意义

    C++11中大部分的容器对于添加元素除了传统的 insert 或者 pusb_back/push_front 之外都提供一个新的函数叫做 emplace. 比如如果你想要向 std::vector 的 ...

  7. linux echo -e 处理特殊字符

    linux echo -e 处理特殊字符 若字符串中出现以下字符,则特别加以处理,而不会将它当成一般文字输出:\a 发出警告声:\b 删除前一个字符:\c 最后不加上换行符号:\f 换行但光标仍旧停留 ...

  8. 使用WinFrom + CefSharp 开发客户端程序

    今天使用CefSharp,加上本地资源文件嵌入了HTML.CSS.JS文件,做为Winform的UI:效果不错,漂亮可控,简简单单,半天时间搞定从开发到上线: 下面记录下相关的备忘: (窗口的效果) ...

  9. java byte与int互相转换

    一.Int2Byte byte[] bytes = new byte[4]; for (int i = 0; i < 4; i++) { bytes[i] = (byte)(integer &g ...

  10. [转载] - Entity Framework 性能优化建议

    1.对象管理机制-复杂为更好的管理模型对象,EF提供了一套内部管理机制和跟踪对象的状态,保存对象一致性,使用方便,但是性能有所降低. 2.执行机制-高度封装在EF中,所有的查询表达式都会经过语法分析. ...