mediastreamer2 的简介

来源:互联网 发布:visual studio编程教材 编辑:程序博客网 时间:2024/04/30 08:50
原文:http://www.linphone.org/eng/documentation/dev/mediastreamer2.html

Mediastreamer2 是一个功能强大且小巧的流引擎,专门为音视频电话应用而开发。这个库为linphone中所有的接收、发送多媒体流提供处理,包括音/视频捕获,编码和解码,渲染。

特色
Read/Write from to an alsa device, an oss device, a windows waveapi device
Send and receive RTP packets
Encode and decode the following formats: speex, G711, GSM, iLBC, AMR , H263, theora, MPEG4, and H264.
Read and write from/to a wav file
Read YUV pictures from a webcam (provided that it has video4linux v1 or v2 driver)
Display YUV pictures (using SDL library or native apis on windows)
Dual tones generation
Echo cancelation, using the extraordinary echo canceler algorithm from the speex library
Audio conferencing
Audio parametric equalizer using a FIR filter
Volume control, automatic gain control

Mediastreamer2可以使用动态插件进行扩展,当前可用的插件有h264,ILBCt和AMR

可移植性: linux/x86、linux/x86_64、Embedded linux:ARM and Blackfin 、windows XP、Vista and 7、 Mac Os X、Google Android

设计与原理:
   每一个处理实体都被封装在MSFilter对象中,MSFilter使用inputs和outputs与其它MSFilter进行连接。
  一个简单实例帮助理解:
      MSRtpRecv 是一个接收RTP包的MSFilter,解包后再把它们放到output上。
      MSSpeexDec是一个依赖input的MSFilter,如果input接收到speex编码包,对它们进行解码并放在output
      MSFileRec是一个依赖input的MSFilter,如果input是16位pcm数据则保存为wav格式
MSFilter可以可以连在一起组成一个MSFIlter chain,如果我们把这三个Filter连在一起,这样就形成了一个可以接收RTP包,对包进行解码,把解码的数据保存成wav格式的处理链。
        MSRtpRecv --> MSSpeexDec --> MSFileRec
   媒体处理任务通过“MSTicker”对象来调度,一个线程可以每隔10ms处理MSFilter chain的数据,几个MSTicker可以被同时使用,比如一个音频filter、一个视频 filter。


使用简单:
如果你想创建音视频流,要调用audiostream.h和videostream.h的定义来创建音视频流。
如果你想添加mediastreamer2的功能,实现一个mediastreamer2 filter是非常简单的,因为mediastreamer2是非常轻量级的封装。
由于mediastreamer2是一个轻框架,工程师可以集中精力在于:图像/信号算法的实现。


mediastreamer2适用于嵌入式系统
mediastreamer2是纯C开发的
mediastreamer2可以用gcc编译
mediastreamer2最小依赖只需oRTP和libc。其他(ffmpeg, speex, alsa...)根据需要添加。
由于是插件框架,mediastreamer2可以通过硬件codecs接口扩展,如video codecs dsp
ediastreamer2是轻量级的。例如,在linux/x86平台上,使用共享库的时全功能大约只有800k


下载
Mediastreamer2 是 linphone 的一部分
你也可能使用git获取最新的源码:
git clone git://git.linphone.org/mediastreamer2.git


采用GPL许可协议 
原文:http://www.linphone.org/eng/documentation/dev/mediastreamer2.html

原创粉丝点击