VS2013编译Live555
2017-05-03 本文已影响255人
SniperPan
Live555 Media Server是一个RTSP服务端程序,它支持Stream多种媒体格式文件,具体如下:
- MPEG Transport Stream file(.ts)
- Matroska file(.mkv)
- WebM file(.webm)
- Ogg file(.ogg, .ogv, .opus)
- MPEG-1 or 2 Program Stream file(.mpg)
- MPEG-4 Video Elementary Stream file(.m4e)
- H.264 Video Elementary Stream file(.264)
- H.265 Video Elementary Stream file(.265)
- VOB video+audio file(.vob)
- DV video file(.dv)
- MPEG-1 or 2 (including layer III) audio file(.mp3)
- WAV(PCM) audio file(.wav)
- AMR audio file(.amr)
- AC-3 audio file(.ac3)
- AAC(ADTS format) audio file(.aac)
所串出的流支持通过标准RTSP/RTP媒体客户端进行接收或播放,如:
- VLC media player
- QuicTime Player
- Amino set-top boxes(仅支持MPEG ts流)
- openRTSP命令行客户端,可接收/存储流数据,但不支持播放
Notes:
- 服务端可并行传输同个流
- 默认情况下,服务端通过RTP/UDP packets传输流,但如果发起客户端使用RTSP,则服务端可通过TCP传输RTP/RTCP packets进行串流(这在需要穿透防火墙时尤其有用)
- 部分非标准RTSP客户端如Amino,会请求原始UDP流而不是标准RTP流。尽管如此,服务端仍然会进行匹配,从而提供所需串流服务。
获取 Live555 Media Server
已编译可执行文件
现已对如下平台进行预编译支持:
- MacOSX(on Intel x86 processors:)live555MediaServer
- Linux(on Intel x86 processors:)live555MediaServer
- FreeBSD(on Intel x86 processors:)live555MediaServer
如上述中未包含所需平台,则需要手动编译源码。
源码编译
这里我们不使用官方文档中说明进行Windows平台编译,一来是实际操作过程中容易出错,二来VS编译便于后面的源码分析及调试。
1. 下载源码
打开src链接中对应源码,下载下图中任一文件:

逐层解压(推荐使用开源软件7-Zip)后获得如下文件夹:

至此,所有Debug版本编译完成。

4. 测试编译结果
拷贝bipbop-gear1-all.ts至live555MediaServer.exe同一目录下,双击运行live555MediaServer文件。
以VLC客户端为例,输入MediaServer运行后命令行输出中的rstp地址前缀。

正常播放结果如下:

5.后记
粗通编译原理后编译思路上并无太大困难,需要注意的是应结合官方文档进行预先理解。
后续会陆续更新源码解析部分,所有文章中,如有疑虑或发现错误,欢迎指出。