
Next-generation live media protocol delivering WebRTC-like real-time latency at massive scale via QUIC. Features prioritization, partial reliability, pub/sub fan-out relays, WebTransport/WebCodecs integration.
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.
moq import capture --video demand, only encode them too.Standards & CDNs: This repo implements moq-lite and hang with compatibility for the IETF moq-transport drafts. Self-host
moq-relayanywhere, use a managed CDN like moq.pro or Cloudflare, or mix both on the same broadcast.
All of the hosted demos at moq.dev/demo run on the open-source code in this repository:
<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).
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 | shAlso 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 justIt opens the watch, publish, and stats pages in your browser (or visit http://localhost:5173/watch.html). No Nix? See the quick start guide.
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 |
Ready-to-run binaries and plugins (docs):
moq-relay (docs): scalable relay server with RAM caching, JWT auth, multi-region clustering, HTTP/metrics, and zero-downtime upgrades.moq-cli (moq, docs): all-in-one CLI media router to pipe FFmpeg, capture cameras and screens natively, play in a window, transcode ABR ladders on demand, record to S3/MP4, and inspect relays. Capture, windowed playback, and transcoding are off by default: build with the capture, play, and transcode Cargo features (see rs/moq-cli/Cargo.toml).moq import / moq export or embed the Rust crates directly: WebRTC (WHIP/WHEP) (docs), HLS/DASH (docs), RTMP/E-RTMP (docs), SRT (docs), RTSP, and MPEG-TS (docs).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)
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.
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 --yesDirect 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: 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 pushingSee the development guide, troubleshooting, and justfile for full-repo checks (--all, just gate), cross-language interop tests, and Windows setup.
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.
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.
moq import capture --video demand, only encode them too.Standards & CDNs: This repo implements moq-lite and hang with compatibility for the IETF moq-transport drafts. Self-host
moq-relayanywhere, use a managed CDN like moq.pro or Cloudflare, or mix both on the same broadcast.
All of the hosted demos at moq.dev/demo run on the open-source code in this repository:
<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).
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 | shAlso 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 justIt opens the watch, publish, and stats pages in your browser (or visit http://localhost:5173/watch.html). No Nix? See the quick start guide.
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 |
Ready-to-run binaries and plugins (docs):
moq-relay (docs): scalable relay server with RAM caching, JWT auth, multi-region clustering, HTTP/metrics, and zero-downtime upgrades.moq-cli (moq, docs): all-in-one CLI media router to pipe FFmpeg, capture cameras and screens natively, play in a window, transcode ABR ladders on demand, record to S3/MP4, and inspect relays. Capture, windowed playback, and transcoding are off by default: build with the capture, play, and transcode Cargo features (see rs/moq-cli/Cargo.toml).moq import / moq export or embed the Rust crates directly: WebRTC (WHIP/WHEP) (docs), HLS/DASH (docs), RTMP/E-RTMP (docs), SRT (docs), RTSP, and MPEG-TS (docs).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)
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.
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 --yesDirect 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: 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 pushingSee the development guide, troubleshooting, and justfile for full-repo checks (--all, just gate), cross-language interop tests, and Windows setup.
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.