Transcoding

Transcoding is the process of decoding media from one codec format and re-encoding it into another. In WebRTC, transcoding is generally avoided because it is computationally expensive and adds latency.

When transcoding is needed in WebRTC

  • PSTN interop: Converting between WebRTC's Opus audio and the PSTN's G.711
  • Legacy system bridging: Connecting WebRTC endpoints to SIP devices that don't support modern codecs
  • Codec mismatch: When two peers do not share a common video codec (rare in modern WebRTC)
  • MCU mixing: MCUs inherently transcode as they decode, mix, and re-encode media

Alternatives to transcoding

WebRTC has developed several techniques to avoid transcoding:

  • Simulcast: Sending multiple encodings so the SFU can forward without transcoding
  • SVC: Scalable layers that can be selectively forwarded
  • Codec negotiation: SDP ensures both sides agree on a common codec before media flows

Transcoding a video stream can increase server CPU costs by 10-100x compared to simple SFU forwarding, making it a significant factor in infrastructure cost calculations.

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.