Which codecs should I choose for devices
It depends.
What codecs are supported?
Audio:
- G.711 A-law
- G.711 u-law
- G.723.1
- G.726
- G.729
- GSM
- iLBC
- LPC10
- Speex
- ADPCM
- 16 bit Signed Linear PCM
Video:
- H.261
- H.263
- H.263+
- H.264
Audio codecs
Most commonly used are:
- G711
- G729
G711
PSTN quality codec which is supported in 99% of all devices/providers (but often disabled to save traffic).
It has best quality but highest bandwidth (64kbps + ~20 kbps overhead ~= 84kbps to one direction).
It comes in 2 flavours - G711u (ulaw) - used in USA, and G711a (alaw) - used mostly in Europe and other countries.
Do not use this codec if you have Voice quality issues!
G729
Little worse quality but is often used because it saves traffic (~8kbps + ~20kbps overhead ~= 28kbps to one direction).
It takes a lot of CPU power to transcode so total call count on the server is greatly reduced using this codec.
It needs to be installed separately and it is not free.
G722
- G.722 is a ITU-T standard 7 kHz wideband speech codec operating at 48, 56 and 64 kbit/s. 64 kbit/s (comprises 48, 56 or 64 kbit/s audio and 16, 8 or 0 kbit/s auxiliary data).
- HD VoIP in the Asterisk world involves selecting the G722 codec for VoIP calls.G722 is known as a wideband codec as opposed to g711 which is narrowband.
The nice thing about it is that it does not require any more bandwidth than G711. Both require 64kbit/s each way for a 2-way conversation.
- The difference is that G722 employs compression combined with a higher sample rate to obtain a practical acoustic bandwidth of 50 Hz-7000 Hz as opposed to G711 which has a practical acoustic bandwidth of 200-3000 Hz.
The difference in voice quality is quite noticeable. Instead of sounding like you are talking into a tin can it now sounds like the other person is in the same room.
You can hear more subtle nuances in the person’s voice and certain letters/syllables that are hard to distinguish on regular calls become much easier.
- If one endpoint is using G722 and the other is using G711, the endpoint using G722 will hear better sound quality from the other end but the G711 end will not notice much if any difference.
- Transcoding overhead between G722 and g711 is minimal. Roughly equivalent to half the transcoding overhead between G711 and GSM. G.722 patents have expired, so it is freely available.
GSM
Acceptable codec for poor networks.
Video
Read manual for your device to check which codec is supported on your device.
H263/H264 are most popular.
Make sure same codec is chosen between devices you are trying to communicate.
Fax
If your system/provider/devices does not support T38 you should use G711 codec for fax transmitting/receiving.
Notes
Make sure you have always selected audio codec! Otherwise you will not be able to place calls!