
A one-to-one video call in the browser is mostly solved: WebRTC connects the two peers directly and the media never touches your servers. Add a third, a tenth or a hundredth participant and that model breaks down, because every browser would have to upload its video to every other browser. Group calls, virtual classrooms and live broadcasts need a media server in the middle. mediasoup is an open-source library for building that server yourself, with full control over how audio and video are routed.
This article explains what mediasoup is, how its SFU model works, where it fits, when a hosted service is the better choice, and how it compares with the alternatives.
What is mediasoup?
mediasoup is an open-source WebRTC SFU (Selective Forwarding Unit). An SFU receives audio and video streams from each participant and forwards them to the others without decoding or mixing them. mediasoup is not a ready-made conferencing product: it is a Node.js module, also available as a Rust crate, that you build your own media server with.
It was created by Iñaki Baz Castillo and José Luis Millán. The first package appeared on npm at the start of 2016, version 1.0.0 followed on 21 April 2017, and the current v3 line began on 6 May 2019. The library is released under the permissive ISC licence.
WebRTC itself, the browser technology mediasoup builds on, became a W3C Recommendation and a set of IETF standards in January 2021.
How mediasoup works
A JavaScript API over C++ workers. Your Node.js code uses mediasoup's API, while the media work (ICE, DTLS, RTP and RTCP) runs in C++ subprocesses called workers. Each worker runs on one CPU core, so you start as many workers as the machine has cores, and no more.
Routers, transports, producers and consumers. A router usually represents one room. Each participant connects through a transport, most often a WebRtcTransport. Media a participant sends becomes a producer; each stream another participant receives is a consumer. Because the server keeps these as separate objects, it can decide per receiver which streams, and which quality layers, to forward.
Simulcast and SVC. Senders can publish several qualities of the same video. mediasoup picks the right layer for each receiver from its bandwidth estimate, so one participant on a weak connection does not lower the quality for everyone.
No signalling built in. mediasoup handles only the media layer. How clients join a room, exchange parameters and learn about new streams is up to you, usually over WebSockets with a library such as Socket.IO.
Scaling beyond one core or host. Routers can be connected to each other with pipe transports, on the same machine or across hosts. A broadcast can then be fanned out to many routers instead of overloading one.
Key features
- SFU forwarding without transcoding, which keeps latency and server cost low.
- Node.js and Rust server APIs on the same C++ media core.
- Client libraries: mediasoup-client for browsers and Node.js, and libmediasoupclient in C++ for native apps.
- Plain RTP transports for bringing in or sending out media from tools that do not speak WebRTC, such as recorders or streaming encoders.
- Data channels alongside audio and video, plus observers for active speaker and audio levels.
Where mediasoup is used
- Video conferencing and collaboration tools that need their own layout, permissions and branding.
- Virtual classrooms and webinars, with a few speakers and many viewers.
- Telemedicine platforms where media has to stay on infrastructure the operator controls.
- Low-latency live streaming to audiences that need to react in real time.
When to choose mediasoup, and when not to
Choose mediasoup when:
- You need full control over the media pipeline: who receives what, at which quality, and where it is recorded.
- Media must run on your own servers for privacy, compliance or data-residency reasons.
- Your team is comfortable with Node.js or Rust and with WebRTC concepts.
Look elsewhere when:
- You need video in the product next month and have no WebRTC experience. A hosted platform such as Agora gives you SDKs and a global network without running servers.
- You want a complete, self-hosted product with signalling, rooms and SDKs included; LiveKit or Jitsi are closer to that.
- No one on the team will own TURN servers, monitoring, scaling and upgrades.
mediasoup and its alternatives
| Option | Type | Best fit |
|---|---|---|
| mediasoup | SFU library (Node.js, Rust) | Custom media servers with full control |
| LiveKit | Open-source SFU platform in Go, plus a cloud | Self-hosted or managed with ready SDKs |
| Janus | Plugin-based WebRTC server in C | Teams that want gateway and plugin flexibility |
| Jitsi Videobridge | SFU behind the Jitsi Meet stack, in Java | A complete open-source meeting product |
| Agora | Hosted real-time platform | Shipping quickly without media servers |
The deciding question is how much you want to build. mediasoup is the lowest-level option here: it gives you the forwarding engine and leaves rooms, signalling and the client experience to you. LiveKit and Jitsi bring more of the product with them; Agora removes the servers altogether in exchange for running on its network.
How we use mediasoup at Internative
We use mediasoup for real-time audio and video systems that need low latency, scalability and full control over the media pipeline. It lets us build custom communication platforms where off-the-shelf solutions fall short. When a project calls for an API-based service instead, we evaluate Agora for audio, video and live streaming.
If you are planning a product with group video, live classes or remote consultations, our custom software development team can help you decide between building on mediasoup and using a hosted platform. For a healthcare example of the trade-offs, see Custom Telehealth Software Development: what it really takes.
Frequently asked questions
Is mediasoup an SFU or an MCU?
An SFU. It forwards each participant's streams to the others without mixing them into one composite video, as an MCU would. That keeps server CPU and latency low, and lets every client choose its own layout.
What is WebRTC used for?
WebRTC lets browsers and apps send audio, video and data to each other in real time, with low latency. It powers video calls, screen sharing, online classes and live streaming. mediasoup builds on WebRTC to route those streams between many participants.
Is mediasoup open source and free?
Yes. mediasoup is open source under the ISC licence and free to use in commercial products. The costs come from the servers, bandwidth and TURN infrastructure you run, and from the engineering time to build the product around it.
Should I use mediasoup or LiveKit?
Choose mediasoup when you want a low-level engine and full control over the server logic, in Node.js or Rust. Choose LiveKit when you want a more complete platform with signalling, client SDKs and an optional managed cloud, and are happy to follow its model.
Keep reading
The articles that follow this one.



