简介
Live555
是一个为流媒体提供解决方案的跨平台的C++
开源项目,它实现了对标准流媒体传输协议如RTP/RTCP
、RTSP
、SIP
等的支持。Live555
实现了对多种音视频编码格式的音视频数据的流化、接收和处理等支持,包括MPEG
、H.263+
、DV
、JPEG
视频和多种音频编码。同时由于良好的设计,Live555
非常容易扩展对其他格式的支持。目前,Live555
已经被用于多款播放器的流媒体播放功能的实现,如VLC(VideoLan)
、MPlayer
。
该项目的源代码包括四个基本的库,各种测试代码以及LIVE555 Media Server
,四个基本的库分别是UsageEnvironment&TaskScheduler
,groupsock
,liveMedia
,BasicUsageEnvironment
。可在下载。
编译运行
编译
$ ./genMakefile linux // MAC下使用./genMakefile macosx$ make
运行
$ cd mediaServer$ ./live555MediaServerLIVE555 Media Server version 0.88 (LIVE555 Streaming Media library version 2015.11.09).Play streams from this server using the URL rtsp://192.168.1.101:8554/where is a file present in the current directory.Each file's type is inferred from its name suffix: ".264" => a H.264 Video Elementary Stream file ".265" => a H.265 Video Elementary Stream file ".aac" => an AAC Audio (ADTS format) file ".ac3" => an AC-3 Audio file ".amr" => an AMR Audio file ".dv" => a DV Video file ".m4e" => a MPEG-4 Video Elementary Stream file ".mkv" => a Matroska audio+video+(optional)subtitles file ".mp3" => a MPEG-1 or 2 Audio file ".mpg" => a MPEG-1 or 2 Program Stream (audio+video) file ".ogg" or ".ogv" or ".opus" => an Ogg audio and/or video file ".ts" => a MPEG Transport Stream file (a ".tsx" index file - if present - provides server 'trick play' support) ".vob" => a VOB (MPEG-2 video with AC-3 audio) file ".wav" => a WAV Audio file ".webm" => a WebM audio(Vorbis)+video(VP8) fileSee http://www.live555.com/mediaServer/ for additional documentation.(We use port 8000 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream files only).)
以上命令列出了支持的文件格式。
测试
$ ./live555MediaServer video.264
打开vlc
,点击Media
中的Open Network Stream...
选项,在URL
栏中填入rtsp://192.168.1.101:8554/video.264
,最后点击Play
就可以播放了。
图片描述