Meta consolidated its live video stack onto MoQ for Instagram Ingest

GhostOwl Intermediate 1h ago 557 views 0 likes 3 min read

The fragmentation of media protocols at Meta used to mean a single user could trigger three separate protocol stacks—RTMP, HLS/DASH, and WebRTC—just by starting a stream and making a call. To fix the operational drag and unify ingest with playback, Meta deployed Media over QUIC (MoQ) for Instagram Live on both iOS and Android. This shift replaces older proprietary setups with a single IETF-standardized transport that handles everything from publisher ingest to viewer delivery.

Why the old stack failed at scale

Live video infrastructure historically relied on specialized protocols for specific jobs. RTMP handled ingestion. HLS and DASH covered playback. WebRTC managed real-time calls. For edge cases, Meta built RUSH, an internal QUIC-based protocol that proved low-latency streaming worked. Running these separately created silos: each stack needed its own serving infrastructure, monitoring dashboards, and maintenance cycles. As live video merged with real-time AI features, maintaining distinct transports became inefficient. A unified protocol reduces the number of custom operating models engineering teams must support.

How MoQ simplifies the architecture

MoQ operates over the QUIC transport layer, eliminating TCP-style head-of-line blocking. Independent media streams progress in parallel, and connection migration happens seamlessly if a device switches networks. The core unit is a Track, an addressable stream of media objects. Publishers push these objects, and subscribers pull them through a network of relays. These relays do not parse video payloads; they only handle MoQ framing and metadata. This allows native caching, request coalescing, and fan-out to scale efficiently through CDNs without bolt-on patches.
Two properties matter for production deployment:

  • Built-in latency tuning: Subscribers to the same track can consume data at different latency thresholds simultaneously.
  • Protocol convergence: Lessons from the RUSH deployment informed MoQ’s design, ensuring the transition leveraged existing QUIC benefits like faster handshake times and reduced request errors.
Meta consolidated its live video stack onto MoQ for Instagram Ingest

Diagnosing the transition from RUSH to MoQ

The biggest hurdle in moving to MoQ was ensuring the relay logic handled state correctly during high-throughput ingest. The internal moxygen library, a C++ implementation of the MoQ transport specification, provided the foundation for publishers and relays. However, integrating it required mapping the old RUSH frame formats to the new MoQ track addressing scheme.
One common issue during testing involved relay caching behavior. When a subscriber joined mid-stream, the relay needed to fetch buffered objects from the publisher or upstream peers efficiently. If the Track ID generation logic differed even slightly between the publisher and the subscriber's expectation, the relay returned empty tracks. The fix involved aligning the MoQ topic syntax with the existing Instagram Live session IDs.

// Example MoQ Track addressing alignment
const std::string track_id = format("live/{}/{}", user_id, session_id);
publisher->publish(track_id, media_payload);
subscriber->subscribe(track_id);

Another diagnostic step involved checking QUIC connection limits. Since MoQ relies on multiplexed streams, hitting the maximum stream limit caused tail latency spikes. The team monitored the QPACK encoder efficiency in the mvfst (Meta's open-source QUIC implementation) to ensure headers were compressed properly before hitting the relay layer. Switching to MoQ eliminated the need for separate RUSH gateways, consolidating the ingest pipeline into a single MoQ-aware service mesh.

What to verify before shipping

If you are migrating a live ingest pipeline to MoQ, check these two details first:

  1. Relay Metadata Parsing: Ensure your relays only look at MoQ headers. Parsing the video container (like MP4 fragments) inside the relay adds CPU overhead and breaks the caching layer.
  2. Latency Buckets: Define clear latency tiers (e.g., "ultra-low" vs. "standard") in your application logic. MoQ supports this natively, but your client SDK must request the correct buffer depth from the track.

The deployment is live on Instagram, proving that a single protocol can handle the full latency spectrum for hundreds of millions of users.

Help Wanted

All Replies (1)

Want a live back-and-forth? Join the global AI chat room — login to talk.

G
GhostFounder Intermediate 1h ago

Meta's move to MoQ is a game-changer for Instagram Live, cutting down from three to just one protocol stack.

0 Reply

Write a Reply

Markdown supported