Skip to content
moq-devPublic

About

Media over QUIC: Real-time latency at massive scale

Topics

Resources

Contributing

Security policy

Stars

1.6k stars

Watchers

18 watching

Forks

Latest commit

 

History

8,915 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Media over QUIC

License Discord Crates.io npm

Media over QUIC

Media over QUIC (MoQ) is an open-source live media and real-time data stack built on QUIC and WebTransport. One protocol replaces WebRTC, HLS/DASH, RTMP/SRT, and custom WebSocket fan-out, with sub-second latency at CDN scale.

  • Sub-second, no buffering spinners: every group of frames rides its own QUIC stream. Under congestion, old video gets skipped while audio and fresh frames sail through.
  • CDN scale, not SFU pain: relays cache and fan out to millions of viewers without parsing media. No SDP, no ICE, no TURN; just dial a URL.
  • Pull, not push: nothing leaves a publisher until someone subscribes. Have 1,000 cameras? Only upload the ones anyone is actually watching, and with moq import capture --video demand, only encode them too.
  • Per-viewer latency budgets: 100 ms for a live call or remote operator, 10 s for bad Wi-Fi, or a pristine archive recording, all from the same broadcast and relay.
  • Media plus any live data: video, audio, chat, AI transcripts, game inputs, and telemetry share one connection with explicit priorities.
  • Every platform, migrate one piece at a time: Rust core, from-scratch TypeScript for browsers (WebTransport + WebCodecs with automatic WebSocket fallback), 7 native language bindings, and drop-in gateways for WebRTC, HLS/DASH, RTMP, SRT, and RTSP.

Standards & CDNs: This repo implements moq-lite and hang with compatibility for the IETF moq-transport drafts. Self-host moq-relay anywhere, use a managed CDN like moq.pro or Cloudflare, or mix both on the same broadcast.

Try It Live

All of the hosted demos at moq.dev/demo run on the open-source code in this repository:

  • Voice AI: talk to a Pipecat voice agent over MoQ with faster-than-real-time TTS bursts, instant barge-in, and live transcripts (no WebRTC).
  • CARLA Teleoperation: steer simulated trucks in real time with on-demand cameras, vehicle controls, and telemetry on one connection.
  • MoQ Boy: crowd-controlled Game Boy (video down, button inputs up, sleeps when nobody is watching).
  • hang.live: multi-party video conferencing with spatial audio and chat, built without WebRTC.
  • Watch & Publish: browser playback (<moq-watch>) and webcam publishing (<moq-publish>).

Want a real-world story? See how autonomous boats run MoQ over cellular and Starlink, or read the blog (Replacing WebRTC, Replacing HLS/DASH, On a Boat).

Quick Start

Full documentation lives at doc.moq.dev.

Install the moq CLI on macOS (Apple Silicon) or Linux (x86_64, aarch64, armv7; glibc 2.34+):

curl -fsSL https://moq.sh | sh

Also available via Homebrew, apt, dnf, winget, Docker, Cargo, and Nix; see the install guide.

Or run the full local demo stack (relay, test stream, and web UI) from this checkout using Nix with flakes:

nix develop -c just

It opens the watch, publish, and stats pages in your browser (or visit http://localhost:5173/watch.html). No Nix? See the quick start guide.

What You Can Build

Pick your use case to jump straight to the docs, tools, and source folders:

Use case Replaces Tools & libraries in this repo Docs
Conferencing & rooms WebRTC, SFUs @moq/room, @moq/publish, @moq/watch, moq-webrtc, moq-relay vs WebRTC
Voice & video AI WebRTC, WebSockets Python moq-rs, @moq/watch, @moq/publish, @moq/json MoQ for AI
Live streaming & distribution HLS, DASH moq-relay, @moq/watch, moq-hls, moq-transcode, moq-archive vs HLS/DASH
Contribution & ingest RTMP, SRT, RTSP, WHIP OBS plugin, GStreamer, moq-cli, moq-rtmp, moq-srt, moq-rtsp vs RTMP/SRT
Robotics & teleoperation WebRTC, raw RTP moq-net, moq-video, moq-audio, moq-json, C++, Python Concepts
Interactive & real-time data WebSockets, DataChannels moq-net, @moq/net, moq-json, @moq/json moq-lite

What's in This Repository

Applications, Plugins & Gateways

Ready-to-run binaries and plugins (docs):

Libraries & Bindings

Two primary implementations (Rust and TypeScript) plus 7 native bindings, all speaking the same wire protocol (library guide):

Layer Rust (rs/, docs) TypeScript (js/, docs)
Live pub/sub moq-net, moq-tokio @moq/net
Media catalog & containers hang, moq-mux @moq/hang
Capture, codecs & playback moq-video, moq-audio, moq-transcode @moq/publish, @moq/watch
Rooms, JSON state & archives moq-json, moq-archive @moq/room, @moq/json
Authorization moq-auth @moq/auth

Native language bindings (wrapping rs/moq-ffi via UniFFI, plus a plain C ABI; see Layers): Swift (docs) · Kotlin (docs) · Python (docs) · Go (docs) · Dart (docs) · C++ (docs) · C (libmoq) (docs)

Architecture

MoQ is a small stack of independent layers.

Rule 1: the relay MUST NOT know anything about your application, media codecs, or even the available tracks. Everything can be end-to-end encrypted and the CDN will not care. No business logic in the relay.

Instead, moq-relay routes generic live pub/sub (moq-lite) made of broadcasts, tracks, groups, and frames. Media logic lives above it in hang, which only clients and media servers understand. Extend it or replace it entirely with your own tracks.

Think of hang like HLS/DASH, and moq-lite like HTTP.

┌─────────────────┐
│   Application   │   Your business logic
│                 │    - rooms, auth, AI, telemetry, game inputs
├─────────────────┤
│      hang       │   Media catalog & frame containers
│                 │    - codecs, timestamps, captions, JSON tracks
├─────────────────┤
│    moq-lite     │   Generic live pub/sub transport
│                 │    - broadcasts, tracks, groups, frames, datagrams
├─────────────────┤
│  WebTransport   │   Browser-compatible QUIC (with WebSocket fallback)
│      QUIC       │    - streams, prioritization, partial reliability
└─────────────────┘

Read Concepts for the full walkthrough, or browse the Internet-Drafts (drafts/) for wire specifications.

For LLMs & Coding Agents

Building an app with MoQ using Claude Code, Cursor, Codex, or another coding agent? Paste this prompt to install the MoQ skill:

Follow the instructions at https://doc.moq.dev/setup/agent/prompt.md

Or install it from your terminal:

npx -y skills add moq-dev/moq --yes

Direct links for agents & automated retrieval:

Resource Link What it is
Docs index (Markdown) doc.moq.dev/llms.txt Concise index of every documentation page
Full docs bundle doc.moq.dev/llms-full.txt All guides, concepts, app, and library pages in one file
Single doc page as Markdown https://doc.moq.dev/<path>.md Append .md to any doc URL (e.g. https://doc.moq.dev/lib/js/watch.md)
Agent setup guide doc.moq.dev/setup/agent App-building skill and repo workflow details
Repository instructions AGENTS.md Root rules and cross-package sync requirements (check nested AGENTS.md files too)
Repository map doc/setup/repository.md Maps every feature to its crates, packages, tests, and docs
Runnable examples doc/setup/examples.md, demo/ Working code to inspect instead of guessing APIs
Wire specifications drafts/ Editable Internet-Draft sources for moq-lite, hang, and extensions

Stability & Development

Stability: release is the stable branch that gets published; main is the development trunk where breaking API changes land between releases. Every package follows semver (a breaking API change bumps the first nonzero version number, e.g. 1.2.0 to 2.0.0 or 0.3.1 to 0.4.0), and breaking wire changes are rare. See Upgrade for migration guides.

Contributing: Contributions are welcome, and AI-assisted issues, pull requests, reviews, and comments are encouraged; see CONTRIBUTING.md. Run commands inside nix develop so tool versions match CI:

just --list      # see all available commands
just             # start the local relay, demo media, and web server
just check       # lint, compile, and test what your branch changed
just fix         # auto-fix formatting and lints (same scope)
just ci          # run the merge queue's gate locally before pushing

See the development guide, troubleshooting, and justfile for full-repo checks (--all, just gate), cross-language interop tests, and Windows setup.

License

Licensed under either:

Exception: the OBS plugin under cpp/obs/ is licensed under GPL-2.0-or-later (see cpp/obs/LICENSE), because it links OBS Studio's libobs, which is GPL-2.0. This is a separately-distributable work; per GPLv2 its presence in this repository is mere aggregation and does not affect the MIT/Apache licensing of the rest of the project. libmoq and the other moq crates remain MIT/Apache.

About

Media over QUIC: Real-time latency at massive scale

Topics

Resources

Contributing

Security policy

Stars

1.6k stars

Watchers

18 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages