A codec is an encoding and compression scheme for a media stream or file format. The term is an acronym derived from COding and DECoding. See this article for more technical information: http://en.wikipedia.org/wiki/Codec. FreeSWITCH™ has provisions for bypassing the media server altogether to save bandwidth and load on the server as well as proxy media in cases where a particular codec is not supported; this allows devices to exchange media directly between them.
HD Audio support
FreeSWITCH supports most HD (high definition) audio codecs including Speex, G.722, G.722.1 (Siren) and SILK. BroadVoice codecs were added by Brian (bkw) just 90 minutes after official release.
Enabling codecs in modules.conf.xml
FreeSWITCH supports a large number of VoIP compression codecs out of the box, however the default config does not enable them all for all transport types. Codecs are built from various modules and from the core FreeSWITCH source (no need to load modules for core codecs, they are in CORE_PCM_MODULE, e.g. they're built into the core of FreeSWITCH). For codecs not in core, you need to compile and load the corresponding module.
Some codecs are encumbered by patents, therefore they are not open source and can not be distributed directly. Licenses are available for purchase where applicable.
Executing the fs_cli command "show codec" displays the enabled codecs.
The vars.xml file contains the the following lines that globally control which codecs are negotiated with remote endpoints:
Note: iLBC@30i configures the iLBC codec to default to 30ms frames instead of 20ms frames which will allow you to receive iLBC calls from Asterisk servers which unfortunately do not correctly send their iLBC codec preferences.
Most transports (channels) have a config block at the top of their configuration file like the following:
Note: There are generally other lines inside the <settings> block, but you can safely ignore them for now.
The default dingaling.conf.xml config contains the following (codec related) settings:
While you may use almost any codec you wish when using dingaling to talk between two FreeSWITCH servers, the official Google Talk(tm) client has some very peculiar quirks in its codec handling.
The default sofia.conf.xml config contains the following settings related to codecs:
FreeSWITCH can proxy media between endpoints if is NATed or you want to reduce usage of your CPU
Benefits of proxy media
- Lower CPU usage*
- N.A.T. handling (RTP Side)
- Pass–through not supported Codecs like G721, G728, G719, AMR and some other codecs*
- Video conferencing through external MCU
Codecs ofered by Proxy_media
- PROXY PASS-THROUGH to pass audio media in proxy mode
- PROXY VIDEO PASS-THROUGH to pass video media in proxy mode
- Audio Codecs
- Codec Negotiation
- Proxy Media
- Bypass Media
- Proxy Media
- Daala codec — YouTube of Linux 2015 Conference presentation of Daala codec project, includes nice graph at 7:20 plotting capabilities versus bandwidth of various audio codecs