哪种是 Android 上最好的 SIP 兼容编解码器类型
我想开发一个 Android 应用程序,它将使用我客户端的 SIP 服务器。我的客户正在从 SIP 服务器公开几个REST API,以便与应用程序进行通信。
我想知道该应用的最佳编解码器类型是什么?
基本上,我想创建一个SIP-Stack并将SIP数据包发送到服务器。因此,应该有一个数据包的编码和解码系统。我的客户更喜欢 16 kb/秒,但我不确定应该使用哪个。
I want to develop a Android App which will use a SIP Server of my client. My client is exposing couple of REST API from the SIP server for communicating with the apps.
I want to know which would be the best codec type for this app?
Basically, I want to create a SIP-Stack and send the SIP Packets to the Server. So, there should be a coding and decoding system for the packets. My client prefers 16 kb/sec but I am not sure which should I use.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
正如其他人所说,SIP 不传输音频或视频。尽管从理论上讲,您可以通过任何传输方式发送数据,包括 ATM、模拟线路、DS0 等,但在现实世界中,RTP 是最常见的。 RTP(实时协议)和RTCP(实时控制协议)或SRTP(安全RTP)通常承载音频和视频。
就编解码器而言,您将受到服务器支持的限制。以下是一些常见的编解码器以及每种编解码器的优缺点。
G.711 - 长途电话质量(即与良好的模拟电话线一样好,甚至更好一点)。 “通用”是指几乎所有设备都支持 G.711。占用大量带宽,它并没有真正压缩数据(G.711 是一个“压缩扩展器”)。基线 G.711 非常简单(它实际上是几个查找表)。附录 I 添加了丢包隐藏 (PLC),附录 II 添加了静音抑制和舒适噪声生成。
GSM - 用于手机,听起来不错,PLC 良好,压缩性好
G.729A - 广泛使用,接近长途电话质量,压缩性良好(8Kbps)
G.723.1 - 广泛使用,几乎与 G.729 一样好,压缩性更好(4- 5Kbps)
G.722 - 听起来比 G.711 更好,宽带(G.711 或模拟呼叫的音频带宽的两倍),线路上使用的带宽与 G.711
GIPS 相同 - 存在各种实现,其中之一是免费的。 IIRC,使用13.5Kbps左右就行,声音不如G.723.1(但这是一个感性指标,YMMV)占用大量处理器。
所有编解码器都使用一些处理器和其他系统资源,根据经验,编解码器越激进(带宽越小),使用的处理器就越多。此外,所有这些特定编解码器都是有损编解码器——它们会丢失一些数据。这意味着存在压缩,而不是由于路由不良和线路质量差而导致部分音频丢失。就像 MP3 被认为是有损编解码器而 FLAC 被认为是无损一样。如果您有兴趣,以下维基百科文章将进行更详细的解释: http://en.wikipedia.org/wiki /有损压缩
As others have said, SIP does not transfer audio or video. Although in theory, you can send data over any transport, including ATM, analog lines, a DS0, etc, in the real world, RTP is the most common. RTP (Real Time Protocol) and RTCP (Real Time Control Protocol) or SRTP (Secure RTP) usually carry the audio and video.
As far as codecs go, you will be limited by what your server supports. Here are a few common codecs and some pros and cons of each.
G.711 - Toll quality (ie good as a good analog phone line, or even a bit better). "Universal" in that virtually every device supports G.711. Takes a lot of bandwidth, it doesn't really compress data (G.711 is a "compander"). The baseline G.711 is pretty bare-bones (its really a couple of look up tables). Appendix I adds packet loss concealment (PLC) and Appendix II adds silence suppression and comfort noise generation.
GSM - used on cellphones, sounds ok, good PLC, good compression
G.729A - widely used, near toll quality, good compression (8Kbps)
G.723.1 - widely used, almost as good as G.729, better compression (4-5Kbps)
G.722 - sounds better than G.711, wideband (twice the audio bandwidth of G.711 or an analog call), same bandwidth used on the line as G.711
GIPS - various implemnetations exist, one is free. IIRC, uses about 13.5Kbps on the line, sound is not as good asG.723.1 (but this is a perceptual metric, YMMV) Takes a lot of processor.
All the codecs use some processor and other system resources, as a rule of thumb the more aggressive the codec (the smaller the bandwidth) the more processor used. Also, all of these particular codecs are lossy codecs--they lose some of the data. This means that there is compression, not that portions of the audio are dropped due to poor routing and poor line quality. Much like an MP3 is considered a LOSSY codec while FLAC is considered Lossless. If you're interested the following wikipedia article explains in further detail: http://en.wikipedia.org/wiki/Lossy_compression
您需要知道该 SIP 服务器将支持哪些编解码器和协议。如果您控制两端并希望坚持 16Kbps,则需要 iLBC(无版税)或 G.729(需要版税)。 G.711 和(现在)G.722 也没有版税,但都使用约 64Kbps。
之前给出的列表很好,但有一些问题:
GIPS 不是编解码器 - iLBC 和 iSAC 是 GIPS 设计的编解码器。 iLBC 是免费且标准化的。 iLBC 质量很高,为 13 或 15Kbps,并且与 G.729 甚至 G.711 相比,对数据包丢失的恢复能力非常强。使用 iLBC,您可能会损失 30% 甚至 50%,但仍然可以被理解。我不确定是否会说与 G.729 相比它使用了大量的 CPU。
嗯,G.711 本身并不是真正有损的(理论上是的,但它几乎更多的是量化级别的损失)。 64K G.722 的损耗也不是很大。 G.723 通过花园软管吸死沙鼠。 :-)
You need to know what codecs and protocols this SIP server will support. If you control both ends and want to stick to 16Kbps, you'll want iLBC (no royalties) or G.729 (royalties apply). G.711 and (now) G.722 have no royalties either, but both use ~64Kbps.
The list given before is good, with a few issues.:
GIPS is not a codec - iLBC and iSAC are codecs designed by GIPS. iLBC is free and standardized. iLBC is high quality, 13 or 15Kbps, and is very resilient to packet loss compared to G.729 or even G.711. You can have 30 or even 50% loss with iLBC and still be understood. I'm not sure I'd say it uses a lot of CPU compared to say G.729.
Well, G.711 isn't really lossy per-se (in theory yes, but it's almost more quantization-level loss). 64K G.722 isn't very lossy either. G.723 sucks dead gerbils through garden hoses. :-)
自己动手听起来是个坏主意。开发 sip 客户端并不是一项简单的任务,因为您必须实现多种协议。与其他决定相比,选择编码并不是非常重要的决定。
恕我直言,您应该使用可用的开源 sip 堆栈之一(如 pjsip)或在开源 sip 客户端(如 sipdroid)之上构建您的应用程序。
但既然您要求编解码器:请使用 GSM 编解码器。节省了带宽并且听起来不错。 G.711 是 99% 的 sip 服务器支持的标准编解码器。
It sounds like a bad idea to do it yourself. Developing a sip client is not a trivial task since there are several protocols you would have to implement. Choosing the coding is not very important decision compared to the rest.
imho you should use one of the open source sip stacks available (like pjsip) or build your application on top of an open source sip client (like sipdroid).
But since you asked for codec: Use the GSM codec. Saved bandwidth and sounds OK. G.711 is otherwise the standard codec that 99% of all sip servers support.
任何?
SIP 不发送和处理任何数据包。 SIP 是会话发起协议,它处理会话协商。
然后,会话(在音频和视频的情况下)基于 RTP 并使用 RTSP 进行信令。所以,你的问题表明你真正缺乏对你需要做什么的了解 - 真正的问题是:你需要一个 RTP 兼容的编解码器。
这同样毫无意义。 RTP 只是一种运营商协议。这就像问“什么是 HTTP 兼容图像格式”。 HTTP 不在乎。浏览器确实如此。
对于 RTP,这意味着 - RTP 不关心。它可以传输任何数据。重要的是双方都知道相同的编解码器。所以,就你的情况而言,这意味着:
Any?
SIP does not send and deal with ANY data packets. SIP is the Session Initiation Protocol and it handles the NEGOTIATION OF SESSIONS.
The sessions then arae - in case of auio and video - are based on RTP and use RTSP for signalling. So, your question indicates a REAL lack of knowledge of what you need to do - the real uestion is: you need a RTP compatible codec.
Which is similar senseless. RTP is jsut a carrier protocol. THis is like asking "what is a HTTP compatioble image format". HTTP does not care. The browser does.
In case of RTP, it means - RTP does not care. It can transport ANY data. WHat is important is that BOTH SIDES know the same codec. So, in your case it means:
这里您需要考虑两件事:
一旦您已经确定了上述两个问题的答案,您可以选择。
对于移动设备,通常使用的语音编解码器是AMR-NB或AMR-WB。对于 SIP,通常是 G.729 或 G.722.x。
您还有 Speex、ISAC 和 SILK 可供选择。
无论如何,您可能需要使用 G.711 才能与所有内容进行互操作 - 但带宽会更高。
这里没有简单的答案。如果您的客户可以选择或说明正在使用哪些其他设备 - 您将更容易选择。
There are two things you need to take into consideration here:
Once you have nailed down the answers to the two questions above you will be able to select.
For mobile devices, the voice codecs usually used are AMR-NB or AMR-WB. For SIP it is usually G.729 or G.722.x.
You also have Speex, ISAC and SILK to choose from.
You will probably need to do G.711 in any case just to interoperate with everything - bandwidth will be higher though.
No easy answer here. If your customer can select, or state what other devices are being used - it will be easier for you to select.