live555流媒体框架介绍
LIVE555 Streaming Media
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.)
Source code
The project source code is available - as a ".tar.gz" file - here. See below for instructions on how to build it.
(Note: To use this software, you must be aware of how it is licensed, and your obligations under this license.)
Mailing list
There is a developers' mailing list: "live-devel@lists.live555.com". Users (or prospective users) of the libraries are encouraged to join this (low-volume) mailing list, and/or to review the mailing list's archives. (You can also search these archives using Google, by adding "site:lists.live555.com" to your search query.) Before posting to the mailing list for the first time, please read the FAQ, to check if your question has already been answered.
Support
The primary means of support for these libraries is the "live-devel@lists.live555.com" mailing list described above. (Note that you must firstsubscribe to the mailing list before you can post to it.)
Are you planning to implement RTP (and/or RTSP)? Instead of writing your own implementation from scratch, consider using these libraries. They have already been used in many real-world RTP-based applications, and are well-suited for use within embedded systems. The code includes an implementation of RTCP, and can easily be extended (via subclassing) to support new RTP payload types.
Help support improvements and extensions to the "LIVE555 Streaming Media" software: LIVE555 Funded Projects.
- Description (including test programs)
- How to configure and build the code on Unix (including Linux, Mac OS X, QNX, and other Posix-compliant systems)
- How to configure and build the code on Windows
- Frequently Asked Questions (FAQ). (Please read this before posting questions to the mailing list.)
- Source code license
- To do...
- Some third-party applications
Description
The code includes the following libraries, each with its own subdirectory:
UsageEnvironment
The "UsageEnvironment" and "TaskScheduler" classes are used for scheduling deferred events, for assigning handlers for asynchronous read events, and for outputting error/warning messages. Also, the "HashTable" class defines the interface to a generic hash table, used by the rest of the code.
These are all abstract base classes; they must be subclassed for use in an implementation. These subclasses can exploit the particular properties of the environment in which the program will run - e.g., its GUI and/or scripting environment.
groupsock
The classes in this library encapsulate network interfaces and sockets. In particular, the "Groupsock" class encapsulates a socket for sending (and/or receiving) multicast datagrams.
liveMedia
This library defines a class hierarchy - rooted in the "Medium" class - for a variety of streaming media types and codecs.
BasicUsageEnvironment
This library defines one concrete implementation (i.e., subclasses) of the "UsageEnvironment" classes, for use in simple, console applications. Read events and delayed operations are handled using a select() loop.
testProgs
This directory implements some simple programs that use "BasicUsageEnvironment" to demonstrate how to develop applications using these libraries.
RTSP client
- testRTSPClient is a command-line program that shows you how to open and receive media streams that are specified by a RTSP URL - i.e., an URL that begins with rtsp://
In this demonstration application, nothing is done with the received audio/video data. You could, however, use and adapt this code in your own application to (for example) decode and play the received data.
- openRTSP is similar to "testRTSPClient", but has many more features. It is a command-line program that - unlike "testRTSPClient" - is intended to be used as a complete, full-featured application (rather than having its code used within other applications). For more information about "openRTSP" - including its many command-line options - see the online documentation.
RTSP server
- testOnDemandRTSPServer creates a RTSP server that can stream, via RTP unicast, from various types of media file, on demand. (Supported media types include: MPEG-1 or 2 audio or video (elementary stream), including MP3 audio; MPEG-4 video (elementary stream); H.264 video (elementary stream); H.265 video (elementary stream); MPEG Program or Transport streams, including VOB files; DV video; AMR audio; WAV (PCM) audio.) The server can also stream from a Matroska orWebM file (by demultiplexing and streaming the tracks within the file). MPEG Transport Streams can also be streamed over raw UDP, if requested - e.g., by a set-top box.
- This server application also demonstrates how to deliver - via RTSP - a MPEG Transport Stream that arrived at the server as a UDP (raw-UDP or RTP/UDP) multicast or unicast stream. In particular, it is set up, by default, to accept input from the "testMPEG2TransportStreamer" demo application.
SIP client
- playSIP is a command-line program (similar to "openRTSP") that makes a call to a SIP session (using a sip: URL), and then (optionally) records the incoming media stream into a file.
MP3 audio test programs
- testMP3Streamer repeatedly reads from a MP3 audio file (named "test.mp3"), and streams it, using RTP, to the multicast group 239.255.42.42, port 6666 (with RTCP using port 6667). This program also has an (optional) built-in RTSP server.
- testMP3Receiver does the reverse: It reads a MP3/RTP stream (from the same multicast group/port), and outputs the reconstituted MP3 stream to "stdout". It also sends RTCP Reception Reports.
- Alternatively, the MP3/RTP stream could be played using one of these tools.
MPEG video test programs
- testMPEG1or2VideoStreamer repeatedly reads from a MPEG-1 or 2 video file (named "test.mpg"), and streams it, using RTP, to the multicast group 239.255.42.42, port 8888 (with RTCP using port 8889). This program also has an (optional) built-in RTSP server.
- By default, the input file is assumed to be a MPEG Video Elementary Stream. If, however, it is a MPEG Program Stream, then you can also insert a demultiplexing filter to extract the Video Elementary Stream. (See "testMPEG1or2VideoStreamer.cpp" for details.)
- Apple's "QuickTime Player" can be used to receive and view this streamed video (provided that it's MPEG-1, not MPEG-2). To use this, have QuickTime Player open the file "testMPEG1or2Video.sdp". (If "testMPEG1or2VideoStreamer's" RTSP server has been enabled, then QuickTime Player can also play the stream using a "rtsp://" URL.)
- The Open Source "VLC" and "MPlayer" media players can also be used.
- RealNetworks' "RealPlayer" can also be used to play the stream. (A recent version is recommended.)
- testMPEG1or2VideoReceiver does the reverse: It reads a MPEG Video/RTP stream (from the same multicast group/port), and outputs the reconstituted MPEG video (elementary) stream to "stdout". It also sends RTCP Reception Reports.
- testMPEG4VideoStreamer repeatedly reads from a MPEG-4 Elementary Stream video file (named "test.m4e"), and streams it using RTP multicast. This program also has a built-in RTSP server.
- Apple's "QuickTime Player" can be used to receive and play this audio stream. To use this, have the player open the session's "rtsp://" URL (which the program prints out as it starts streaming).
- The Open Source "VLC" and "MPlayer" media players can also be used.
- testH264VideoStreamer repeatedly reads from a H.264 Elementary Stream video file (named "test.264"), and streams it using RTP multicast. This program also has a built-in RTSP server.
- Apple's "QuickTime Player" can be used to receive and play this audio stream. To use this, have the player open the session's "rtsp://" URL (which the program prints out as it starts streaming).
- The Open Source "VLC" and "MPlayer" media players can also be used.
- testH265VideoStreamer repeatedly reads from a H.265 Elementary Stream video file (named "test.265"), and streams it using RTP multicast. This program also has a built-in RTSP server.
MPEG audio+video (Program Stream) test programs
- testMPEG1or2AudioVideoStreamer reads a MPEG-1 or 2 Program Stream file (named "test.mpg"), extracts from this an audio and a video Elementary Stream, and streams these, using RTP, to the multicast group 239.255.42.42, port 6666/6667 (for the audio stream) and 8888/8889 (for the video stream). This program also has an (optional) built-in RTSP server.
- Apple's "QuickTime Player" can be used to receive and view this streamed video (provided that it's MPEG-1, not MPEG-2). To use this, have QuickTime Player open the file "testMPEG1or2AudioVideo.sdp". (If "testMPEG1or2VideoStreamer's" RTSP server has been enabled, then QuickTime Player can also play the stream using a "rtsp://" URL.)
- The Open Source "VLC" and "MPlayer" media players can also be used.
- testMPEG1or2Splitter reads a MPEG-1 or 2 Program Stream file (named "in.mpg"), and extracts from this an audio and a video Elementary Stream. These two Elementary Streams are written into files named "out_audio.mpg" and "out_video.mpg" respectively.
MPEG audio+video (Transport Stream) test programs
- testMPEG2TransportStreamer reads a MPEG Transport Stream file (named "test.ts"), and streams it, using RTP, to the multicast group 239.255.42.42, port 1234 (with RTCP using port 1235). This program also has an (optional) built-in RTSP server.
- The Open Source "VLC" media player can be used to play this stream.
- testMPEG2TransportReceiver does the reverse: It reads a MPEG Transport/RTP stream (from the same multicast group/port), and outputs the reconstituted MPEG Transport Stream stream to "stdout". It also sends RTCP Reception Reports.
- testMPEG1or2ProgramToTransportStream reads a MPEG-1 or 2 Program Stream file (named "in.mpg"), and converts it to an equivalent MPEG Transport Stream file, named "out.ts".
- testH264VideoToTransportStream reads a H.264 Video Elementary Stream file (named "in.264"), and converts it to an equivalent MPEG Transport Stream file, named "out.ts".
- testH265VideoToTransportStream reads a H.265 Video Elementary Stream file (named "in.265"), and converts it to an equivalent MPEG Transport Stream file, named "out.ts".
PCM audio test program
- testWAVAudioStreamer reads from a WAV-format audio file (named "test.wav"), and streams the enclosed PCM audio stream via IP multicast, using a built-in RTSP server.
- The program supports 8 or 16-bit PCM streams, mono or stereo, at any sampling frequency.
- Apple's "QuickTime Player" can be used to receive and play this audio stream. To use this, have the player open the session's "rtsp://" URL (which the program prints out as it starts streaming).
- Optionally, 16-bit PCM streams can be converted to 8-bit u-law format prior to streaming. (See "testWAVAudioStreamer.cpp" for instructions on how to do this.)
- The Open Source "VLC" and "MPlayer" media players can also be used.
AMR audio test program
- testAMRAudioStreamer reads from a AMR-format audio file (named "test.amr") - as defined in RFC 3267, section 5 - and streams the enclosed audio stream via IP multicast, using a built-in RTSP server.
- Apple's "QuickTime Player" can be used to receive and play this audio stream. To use this, have the player open the session's "rtsp://" URL (which the program prints out as it starts streaming).
DV video test program
- testDVVideoStreamer reads from a DV video file (named "test.dv"), and streams it via IP multicast, using a built-in RTSP server.
- At present, we know of no widely-available media player client that can play this stream.
Matroska (or 'Webm') streaming test program
- testMKVStreamer reads from a 'Matroska' (or 'Webm') file (named "test.mkv"), and streams it via IP multicast, using a built-in RTSP server.
VOB (DVD) streaming test program
- vobStreamer reads one or more ".vob" files (e.g., from a DVD), extracts the audio and video streams, and transmits them using RTP multicast.
Support for server 'trick play' operations on MPEG Transport Stream files
- The applications MPEG2TransportStreamIndexer and testMPEG2TransportStreamTrickPlay
Miscellaneous test programs
- testRelay repeatedly reads from a UDP multicast socket, and retransmits ('relays') each packet's payload to a new (multicast or unicast) address and port.
- testReplicator is similar to testRelay, except that it replicates the input stream - using the "FrameReplicator" class - and retransmits one replica stream to another (multicast or unicast) address and port, while writing the other replica stream to a file.
- sapWatch reads and prints SDP/SAP announcements made on the default SDP/SAP directory (224.2.127.254/9875)
- registerRTSPStream sends a custom RTSP "REGISTER" command to a given RTSP client (or proxy server), asking it to stream from a given "rtsp://" URL.
WindowsAudioInputDevice
This is an implementation of the "liveMedia" library's "AudioInputDevice" abstract class. This can be used by a Windows application to read PCM audio samples from an input device.
(This project builds two libraries: "libWindowsAudioInputDevice_mixer.lib", which uses Windows' built-in mixer, and "libWindowsAudioInputDevice_noMixer.lib", which doesn't.)
How to configure and build the code on Unix (including Linux, Mac OS X, QNX, and other Posix-compliant systems)
The source code package can be found (as a ".tar.gz" file) here. Use "tar -x" and "gunzip" (or "tar -xz", if available) to extract the package; then cd to the "live" directory. Then run
./genMakefiles <os-platform>
where <os-platform> is your target platform - e.g., "linux" or "solaris" - defined by a "config.<os-platform>" file. This will generate a Makefile in the "live" directory and each subdirectory. Then run "make".
- If the "make" fails, you may need to make small modifications to the appropriate "config.<os-platform>" file, and then re-run "genMakefiles <os-platform>". (E.g., you may need to add another "-I<dir>" flag to the COMPILE_OPTS definition.)
- Some people (in particular, FreeBSD users) have reported that the GNU version of "make" - often called "gmake" - works better than their default, pre-installed version of "make". (In particular, you should try using "gmake" if you encounter linking problems with the "ar" command.)
- If you're using "gcc" version 3.0 or greater: You may also wish to add the -Wno-deprecated flag to CPLUSPLUS_FLAGS.
- If no "config.<os-platform>" file exists for your target platform, then try using one of the existing files as a template.
If you wish, you can also 'install' the headers, libraries, and applications by running "make install".
How to configure and build the code on Windows
- Unpack and extract the '.tar.gz' file (using an application such as "WinZip").
- If the 'tools' directory on your Windows machine is something other than "c:\Program Files\DevStudio\Vc", change the "TOOLS32 =" line in the file "win32config".
- In a command shell, 'cd' to the "live" directory, and run
genWindowsMakefiles
This will generate - in each subdirectory - a "*.mak" makefile suitable for use by (e.g.) Microsoft Visual Studio.
- Alternatively, if you're starting from a Unix machine, you can generate the Windows Makefiles by running
./genWindowsMakefiles
(after - if necessary - changing the "TOOLS32 =" line in the file "win32config", as noted above). Then, copy the "live" directories and its subdirectories (in ASCII mode) to a Windows machine.
- To use these Makefiles from within Visual Studio, use the "Open Workspace" menu command, then (in the file selection dialog) for "Files of type", choose "Makefiles (.mak)". Visual Studio should then prompt you, asking if you want to use this Makefile to set up a new project. Say "OK".
- Note that you will need to build each of the "UsageEnvironment", "groupsock", "liveMedia", and "BasicUsageEnvironment" projects first, before building "testProgs".
- If you wish, you can build the "WindowsAudioInputDevice" project also.
- Doug Kosovic notes: Visual C++ 2003 no longer comes with the old I/O Streams headers iostreams.h et al, or the corresponding library msvcirt.lib. So anybody trying to build the LIVE555 code with VC++ 2003 might find the following useful: A non-sourcecode modification workaround for VC++ 2003 is to copy the missing headers and msvcirt.lib from VC++ 2002. In file 'win32config' add an extra -I switch to COMPILE_OPTS to find the old headers and a -LIBPATH: switch to LINK_OPTS_0 to find msvcirt.lib.
If you're using the Borland C++ compiler
The instructions above assume that you use Microsoft Visual Studio (version 5 or greater) as your C++ development environment. If, however, you are using Borland's development tools, then the instructions above are amended as follows:
- Before running the "genWindowsMakefiles.cmd" script, edit it to replace each occurrence of "win32config" with "win32config.Borland".
- After running "genWindowsMakefiles", edit each of the new Makefiles by following these instructions.
Frequently Asked Questions (FAQ)
(Please read this before posting questions to the mailing list.)
Source code license
This code is "open source", and is released under the LGPL. This allows you to use these libraries (via linking) inside closed-source products. It also allows you to make closed-source binary extensions to these libraries - for instance, to support proprietary media codecs that subclass the existing "liveMedia" class hierarchy. Nonetheless, we hope that subclass extensions of these libraries will also be developed under the LGPL, and contributed for inclusion here. We encourage developers to contribute to the development and enhancement of these libraries.
To do...
- Extend the "liveMedia" library to support even more media types and/or codecs.
- Supply additional "UsageEnvironment" subclassed implementations - e.g., for use with scripted environments, such as Tcl, Python, or Perl.
- Expand the RTCP implementation to support more SDES items (other than just CNAME), and to more completely handle incoming RTCP packets.
- In places the code uses data types such as "unsigned", where instead specific lengths (e.g., 32 bits) are required. The data types should be changed in each such case.
- Fix the "groupsock" implementation so that it could use IPv6 instead of IPv4. (At present, 4-byte addresses are hard-wired into the code in several places.)
- Switch to using ISO-conformant C++ headers (but in such a way that the code can remain portable across both Unix (using gcc) and Windows (using Visual C++)).
- Implement network sockets ("groupsock"s) as "liveMedia" 'sources'. This will make the code for RTP sources more consistent with the rest of the "liveMedia" library, allowing them to be "FramedFilters". (This will make it possible to use synthetic network sockets - e.g., for debugging or simulation.)
- Add support for SRTP ('secure' RTP), and perhaps also RTSP-over-TLS.
Some third-party applications
Several third-party devices and applications have made use of the LIVE555 Streaming Media Software. Here is a list of some of them:
Hardware
- "RaspberrIPCam" - a full HD IP Camera based on Raspberry Pi
- Network-enabled, RTP-streaming Security Cameras, from RVision
- The "LMLM4" MPEG-4 audio/video hardware encoder PCI board, from Linux Media Labs.
- WIS Technologies media encoders. (The "wis-streamer" server application - for Linux - can be used to stream from many of these encoders.)
- Elphel Network Video Cameras (with optional JPEG streaming over RTP).
- The "Cam.ly" wireless security camera system uses "openRTSP" to archive recorded video.
Software
- The "VLC" media player (uses the "LIVE555 Streaming Media" libraries for its RTSP client implementation).
- The "MPlayer media player.
- Ralf Globisch's "Video Processing Project" - a RTSP client DirectShow Filter
- "Morgan RTP DirectShowTM Filters", from Morgan Multimedia
- "Omnimeeting" - a videoconferencing application
- "Network-Integrated Multimedia Middleware (NMM)", from Saarland University
- "ivrworx" - a SIP IVR application - uses "LIVE555 Streaming Media" code for RTP mixing
- "LiveMediaStreamer" - an open source multimedia framework
- "MediaPortal - an open source media center
- "Valkka" - an open source video management library
If you would like your product (or project) added to this list, please send email to the developers' mailing list.
Live Networks, Inc. (LIVE555.COM)
live555流媒体框架介绍的更多相关文章
- Live555流媒体服务器编译(Windows下)
最近在回顾之前做过的相关项目,其中包括live555流媒体服务器相关,今天先把live555开源框架在Windows下的编译方法记录一下. live555是一套使用使用开放的标准协议(RTP/RTCP ...
- [转]流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls)
[转]流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls) http://blog.csdn.net/tttyd/article/details/12032357 RTP ...
- [连载]《C#通讯(串口和网络)框架的设计与实现》-1.通讯框架介绍
[连载]<C#通讯(串口和网络)框架的设计与实现>- 0.前言 目 录 第一章 通讯框架介绍... 2 1.1 通讯的本质... 2 1 ...
- YARN基本框架介绍
YARN基本框架介绍 转载请注明出处:http://www.cnblogs.com/BYRans/ 在之前的博客<YARN与MRv1的对比>中介绍了YARN对Hadoop 1.0的完善.本 ...
- Selenium自动化测试框架介绍
Selenium自动化测试框架介绍 1.测试架构作用 a.可维护性 b.提高编写脚本效率 c.提高脚本的可读性 2.框架的几大要素: Driver管理,脚本,数据,元素对象,LOG,报告,运行机制,失 ...
- UiAutomator自动化测试框架介绍
UiAutomator自动化测试框架介绍 环境搭建 1 必要条件 1.1 JDK 1.2 SDK(API高于15) 1.3 Eclipse 2 ...
- [翻译]Spring框架参考文档(V4.3.3)-第二章Spring框架介绍 2.1 2.2 翻译--2.3待继续
英文链接:http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/overview.ht ...
- MJExtension框架介绍
MJExtension框架介绍 标签: MJExtension 2015-05-01 08:22 1120人阅读 评论(0) 收藏 举报 分类: Foundation(14) 版权声明:本文为博主 ...
- 人工智能深度学习Caffe框架介绍,优秀的深度学习架构
人工智能深度学习Caffe框架介绍,优秀的深度学习架构 在深度学习领域,Caffe框架是人们无法绕过的一座山.这不仅是因为它无论在结构.性能上,还是在代码质量上,都称得上一款十分出色的开源框架.更重要 ...
随机推荐
- Notepad++ 【自动完成】与【输入时提示函数参数】互相冲突,无奈
Notepad++ 既然可以在输入时提示函数参数,可是当提示函数参数的时候,输入具体参数时[自动完成]失效了. 一位用户遇到和我一样的问题:https://community.notepad-plus ...
- SpringMvc通过controller上传文件代码示例
上传文件这个功能用的比较多,不难,但是每次写都很别扭.记录在此,以备以后copy用. package com.**.**.**.web.api; import io.swagger.annotatio ...
- php form表单ajax上传图片方法
form表单ajax上传图片方法 先引用jquery.form.js 前台代码<pre><form id="form1"> <input id=&qu ...
- 中级java面试经历
2018年已经远去,2019年悄然而至.跳槽不仅是为了涨薪,更是为了锻炼自己,提高自己的能力.树挪死,人挪活.在一个公司呆的时间越长,就越老油条,从而失去不断前进的动力.现在下面就主要讲述我这一个月面 ...
- SQL系列(二)—— 查询(select)
在开始之前先了解下SQL中的操作分类.根据与数据库不同操作的交互,对数据不同的处理类型,可以将SQL分为四种:插入.删除.修改.查询.本篇文章中主要介绍查询操作.其实查询操作也是日常应用使用最为频繁且 ...
- java变量的声明和数据类型
一.关键字 java程序语言的关键字只有53个.具体如下: 访问控制:private.protected.public 修饰类.方法.属性和变量:abstract.class.extends.fina ...
- 整理:WPF中CommandBindings的用法
原文:整理:WPF中CommandBindings的用法 目的:了解一下CommandBindings.InputBindings.ICommandSource中在WPF中扮演什么样的角色 Comma ...
- C# GDI graphics.DrawImage 的参数问题
graphics.DrawImage(imageSource, new System.Drawing.Point[] { ,), , ), , ), } ); graphics.DrawImage(i ...
- Javascript文件上传插件
jQuery File Uploader 这是最受欢迎的 jQuery 文件上传组件,支持批量上传,拖放上传,显示上传进度条以及校验功能. 支持预览图片.音频和视频,支持跨域上传和客户端图片缩放,支持 ...
- 推荐算法之E&E
一.定义 E&E就是探索(explore)和利用(exploit). Exploit:基于已知最好策略,开发利用已知具有较高回报的item(贪婪.短期回报),对于推荐来讲就是用户已经发现的兴趣 ...