Live555 是一个为跨平台的C++开源项目,它实现了RTP/RTCP、RTSP、SIP等的支持。并且相对于其他的流媒体服务器是完全开源并且免费的。
废话不多说,下面开始。
http://blog.csdn.net/lawishere/article/details/8182952
1、首先到它的主页下载一个源码包:
http://www.live555.com/liveMedia/public/
我下载的是latest的,具体什么版本还真不清楚
2、放到linux目录下解压:
[html] view plaincopyprint?
1. root@kubuntu:/home/frank tar zxvf live555-latest.tar.gz
2. root@kubuntu:/home/frank# cd live
3. root@kubuntu:/home/frank/live#
3、首先尝试在PC的Linux上编译:
区别于传统的源码包,不是传统的配置方式,而是通过genMakefiles配对目录下的config.*文件生成Makefile
[html] view plaincopyprint?
1. root@kubuntu:/home/frank/live# ./genMakefiles linux
2. root@kubuntu:/home/frank/live# make
编译很顺利,然后上网找一个*.264文件(常见的就是那个test.264在新闻报道)放在当前目录下
执行mediaServer目录下的live555MediaServer服务器原型
[html] view plaincopyprint?
1. root@kubuntu:/home/frank/live# ./mediaServer/live555MediaServer (我在这里遇到找不到库的问题,在我的"error while loading shared libraries: xxx.so.x" 错误的原因和解决办法一文有解答)
2. LIVE555 Media Server
3. version 0.75 (LIVE555 Streaming Media library version 2012.11.08).
4. Play streams from this server using the URL
5. rtsp://192.168.1.41:8554/<filename>
6. where <filename> is a file present in the current directory.
7. Each file's type is inferred from its name suffix:
8. ".264" => a H.264 Video Elementary Stream file
9. ".aac" => an AAC Audio (ADTS format) file
10. ".ac3" => an AC-3 Audio file
11. ".amr" => an AMR Audio file
12. ".dv" => a DV Video file
13. ".m4e" => a MPEG-4 Video Elementary Stream file
14. ".mkv" => a Matroska audio+video+(optional)subtitles file
15. ".mp3" => a MPEG-1 or 2 Audio file
16. ".mpg" => a MPEG-1 or 2 Program Stream (audio+video) file
17. ".ts" => a MPEG Transport Stream file
18. (a ".tsx" index file - if present - provides server 'trick play' support)
19. ".wav" => a WAV Audio file
20. ".webm" => a WebM audio(Vorbis)+video(VP8) file
21. See http://www.live555.com/mediaServer/ for additional documentation.
22. (We use port 8080 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream files only).)
通过VLC可以点播rtsp://192.168.1.41:8554/test.264视频,
(注意:test.264所在的目录要和live555MediaServer执行目录相一致,若test.264放在live目录下,则需要在live目录下执行./mediaServer/live555MediaServer)