Codec

A codec is a piece of software that encodes and decodes a digital stream of media.

The encode process takes raw digital data of voice or video and compresses/encodes it to make it easier to send over the network and store on digital media.

The decode process takes the encoded/compressed data and decompresses,decodes it to make it possible to play it back through a speaker or show it on a display.

In VoIP and real time communications, lossy codecs are used. These codecs reduce the information in the raw digital stream when they encode to get better compression rates at the expense of quality.

Codecs differ by the level of compression they offer, the CPU they require, the speed at which they can operate and encode a single unit of media and the patents they are bound to.

Codecs can be implemented in software, hardware or a combination of both.

WebRTC Codecs

CodecTypeWebRTC
G.711AudioMandatory
OpusAudioMandatory
VP8VideoMandatory
H.264VideoMandatory
VP9VideoOptional
H.265 / HEVCVideoOptional
AV1VideoOptional

Additional reading

Tsahi Levent-Levi

Tsahi Levent-Levi

Independent WebRTC analyst. 20+ years in telecom, 13 focused on WebRTC. Writes for developers and product teams who need to understand, not just implement, real-time communications.