Imagine you're building a live auction platform.
A seller starts broadcasting. Hundreds of participants connect. Everyone needs to see what's happening almost instantly.
You want three things:
- Sub-second video delivery.
- Infrastructure that can scale as the audience grows.
- Features such as recording, transcoding, and adaptive bitrate streaming.
WebRTC addresses the real-time delivery requirement, but scaling it introduces architectural complexity.
Traditional CDN-based streaming is excellent for reaching large audiences, but conventional HLS introduces additional latency.
What if you could combine real-time delivery with a relay-based distribution model?
That's the idea behind Media over QUIC (MoQ).
And there's an interesting implementation detail in Ant Media Server that developers should understand: the same live broadcast can offer different MoQ playback paths, each with different tradeoffs.
First, What Makes MoQ Different?
Media over QUIC is an emerging protocol designed for publishing and subscribing to live media over QUIC-based infrastructure.
Instead of requiring a separate peer connection for every media session in the traditional WebRTC model, MoQ introduces a relay-friendly publish/subscribe architecture.
Conceptually, it looks like this:
Live Publisher
|
v
MoQ Relay
|
+-----+-----+
| | |
v v v
Viewer Viewer Viewer
Relays can distribute media to subscribers without every subscriber requiring the publisher to send another independent copy.
This model creates opportunities for scalable, low-latency distribution, particularly when relays can be deployed geographically closer to viewers.
But there's an important distinction.
MoQ is not simply WebRTC with a different name.
WebRTC remains a mature choice for interactive, bidirectional communication.
MoQ focuses on efficient media distribution through a relay-based model.
Both can be valuable within the same application.
The Interesting Part: Ant Media's Different MoQ Tracks
Ant Media Server supports MoQ through a plugin available for version 3.0.0 and later.
Its implementation exposes different media tracks depending on how the stream is published and processed.
Consider three examples:
| Track | Purpose |
|---|---|
publish |
Direct stream from the browser publisher through the MoQ relay |
source |
Original-quality stream processed through Ant Media Server |
720p |
Transcoded rendition created by Ant Media Server |
These aren't merely different names for the same video.
They represent different paths through your streaming infrastructure.
Path 1: Direct Relay Delivery
Browser Publisher
|
v
MoQ Relay
|
v
MoQ Viewer
When a browser publishes directly to the MoQ relay, viewers can subscribe to the publish track.
This route bypasses the Ant Media processing pipeline.
That means:
- No additional AMS transcoding.
- No AMS adaptive bitrate renditions.
- No recording through the AMS pipeline.
- Less processing overhead along the media path.
For applications prioritizing direct, low-overhead delivery, this is an interesting option.
But what happens when you need server-side functionality?
That's where the second path comes in.
Path 2: Delivery Through Ant Media Server
Browser Publisher
|
v
MoQ Relay
|
v
Ant Media Server
|
Media Pipeline
|
+---+----+
| |
v v
Source 720p
| |
+---+----+
|
v
MoQ Relay
|
v
MoQ Viewer
In this architecture, the incoming MoQ stream becomes a regular broadcast within Ant Media Server.
AMS can then provide capabilities such as:
- Recording.
- Transcoding.
- Adaptive bitrate renditions.
- Stream management through its REST API.
- Distribution through additional supported protocols.
The processed stream is made available through named MoQ tracks.
For example:
moq://your-domain:4443/demo/source
Or, when a 720p rendition has been configured:
moq://your-domain:4443/demo/720p
These are logical MoQ track addresses, not browser HTTP URLs.
The benefit is architectural flexibility.
You can use MoQ for low-latency delivery while keeping the capabilities of a full-featured media server.
The tradeoff is that media processing can introduce additional computational cost and delay.
Why This Matters for Real Applications
Let's return to the auction platform.
Suppose the requirements evolve.
Initially, the application only needs live video delivery. A simple relay path might be sufficient.
Later, the business introduces new requirements:
Requirement 1: Record every auction.
You need a recording pipeline rather than relay-only delivery.
Requirement 2: Support viewers with slower connections.
You may want multiple quality renditions, such as 720p and 480p.
Requirement 3: Deliver video using different protocols.
Some viewers might use WebRTC, while others use MoQ or HLS.
Suddenly, the streaming architecture needs more than a low-latency transport protocol.
It needs media processing and distribution capabilities.
This is where integrating MoQ with a media server becomes valuable.
Try MoQ with Ant Media Server
You can experiment with the MoQ plugin using Ant Media Server 3.0.0 or later.
You'll need:
- A supported Linux x86_64 server.
- Administrator access.
- The Ant Media MoQ plugin.
- HTTPS configured for remote browser access.
- Port 4443 available for the embedded relay.
- A compatible browser, preferably Chrome or Edge for initial testing.
After installing the plugin, Ant Media provides two useful pages.
MoQ publisher:
https://your-domain:5443/live/moq/publish.html
MoQ player:
https://your-domain:5443/live/moq/play.html
From the publishing page, select your camera or screen, assign a stream ID, and start broadcasting.
Open the player page and connect using the same stream ID.
Depending on your configuration, you'll be able to explore the available source, rendition, and direct-publish tracks.
For complete installation instructions, see the official MoQ documentation.
What Should Developers Actually Measure?
Before deciding whether MoQ fits your application, run a controlled experiment.
Start with a single publisher and compare direct-relay playback against processed playback.
Measure:
| Metric | Why it matters |
|---|---|
| Glass-to-glass latency | Measures actual capture-to-display delay |
| Playback startup time | Determines how quickly a viewer joins |
| CPU usage | Reveals processing overhead |
| Playback stalls | Shows reliability under changing network conditions |
| Bandwidth consumption | Affects distribution costs |
| Viewer concurrency | Helps determine scaling limits |
Run tests under the same network, resolution, bitrate, and hardware conditions.
Repeat the experiment with increasing viewer counts and degraded network conditions.
This will tell you much more than comparing theoretical latency numbers.
Is MoQ Ready to Replace WebRTC?
Not completely.
WebRTC is mature, broadly supported, and well suited for interactive communication.
MoQ offers an interesting alternative for relay-based live media distribution, but it remains an evolving technology.
The current Ant Media implementation is based on moq-lite, a simplified implementation rather than the complete emerging IETF MoQ transport specification.
Browser compatibility, interoperability, operational maturity, and production requirements all deserve attention.
It's also worth remembering that MoQ's potential to support CDN-scale distribution doesn't guarantee unlimited concurrency in a particular deployment.
Real-world performance must be tested.
The Bigger Picture
For years, live streaming architecture has involved compromises between latency, scalability, and compatibility.
MoQ introduces a different way of thinking about that problem.
Instead of treating real-time media distribution exclusively as a collection of peer connections, it enables a publish/subscribe model designed around relays.
And implementations such as the MoQ plugin in Ant Media Server allow developers to experiment with this model while retaining media-server functionality.
The most interesting question isn't whether MoQ will immediately replace WebRTC.
It's whether future streaming applications will use both, choosing different delivery paths according to the experience they need to provide.
If you're building a real-time streaming application, would you prioritize the lowest possible latency, or accept a little additional processing for features like recording, transcoding, and adaptive quality?
I'd be interested in hearing how other developers approach this tradeoff.
Top comments (0)