背景:
RTSP(Real Time Streaming Protocol)实时流媒体协议: RFC 2326
The Real Time Streaming Protocol, or RTSP, is an application-level protocol for control over the delivery of data with real-time properties. RTSP provides an extensible framework to enable controlled,
on-demand delivery of real-time data, such as audio and video. Sources of data can include both live data feeds and stored clips. This protocol is intended to control multiple data delivery sessions, provide a means for choosing delivery channels such as UDP, multicast
UDP and TCP, and provide a means for choosing delivery mechanisms based upon RTP (RFC 1889).
Live555是一个完整的RTSP服务器应用程序。
This code forms a set of C++ libraries for multimedia streaming, using open standard protocols (RTP/RTCP, RTSP, SIP). These libraries - which can be compiled for Unix (including Linux and Mac OS X),
Windows, and QNX (and other POSIX-compliant systems) - can be used to build streaming applications. The libraries are already being used to implement applications such as the "LIVE555 Media Server"
and "LIVE555 Proxy Server" (RTSP server applications), and "vobStreamer" (for streaming DVD content using RTP/RTCP/RTSP). The
libraries can also be used to stream, receive, and process MPEG, H.265, H.264, H.263+, DV or JPEG video, and several audio codecs. They can easily be extended to support additional (audio and/or video) codecs, and can also be used to build basic RTSP or SIP clients
and servers, and have been used to add streaming support to existing media player applications, such as "VLC" and "MPlayer". (For some
specific examples of how these libraries can be used, see the test programs below.)
Q.Windows下如何编译Live555?
Live555发布的代码中没有提供vs solution工程,但是通过nmake编译还是比较方便的,几乎不费周折。
具体的可以参考: http://www.live555.com/liveMedia/#config-windows
打开genWindowsMakefile.cmd文件, 可以看出此bat脚本还是比较简单的,只是根据各目录中的Makefile.head, Makefile.tail以及win32config文件生成.mak文件。
查看一下win32config文件
其中的两项需要做修改:
第一项是:
TOOLS32 = C:\Program Files\Microsoft Visual Studio 9.0\VC
第二项是:
LINK_OPTS_0 = $(linkdebug) msvcrt.lib
执行genWindowsMakefile.cmd脚本后,在各个目录中将会生成.mak文件。利用vs自带的nmake可以直接编译了。
为了方便,不妨写一bat脚本:
call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" cd liveMedia nmake /B -f liveMedia.mak cd ../groupsock nmake /B -f groupsock.mak cd ../UsageEnvironment nmake /B -f UsageEnvironment.mak cd ../BasicUsageEnvironment nmake /B -f BasicUsageEnvironment.mak cd ../testProgs nmake /B -f testProgs.mak cd ../mediaServer nmake /B -f mediaServer.mak
执行一下上面的脚本,就会在目录中生成.lib和.exe文件。
然而,没有solution工程,分析代码确实不太舒服。为了长久打算本人新建了一份solution工程,结构为:
live
vs2008_live555
│ clean.bat
│ vs2008_live555.sln
│
├─BasicUsageEnvironment
│ BasicUsageEnvironment.vcproj
│
├─Groupsock
│ Groupsock.vcproj
│
├─liveMedia
│ LiveMedia.vcproj
│
├─MediaServer
│ MediaServer.vcproj
│
├─ProxyServer
│ ProxyServer.vcproj
│
└─UsageEnvironment
UsageEnvironment.vcproj
其中, live目录是代码所在的目录。目录意义请参考:http://www.live555.com/liveMedia/。
为了省去诸君的麻烦,本人把整个工程上传了一份。请猛击。
至于如何测试RTSP Server,可以参考,http://www.cnblogs.com/skyseraph/archive/2012/04/11/2442840.html及
http://blog.csdn.net/beitiandijun/article/details/9232405。
Live555分析(一):VS2008编译,布布扣,bubuko.com