moq-rs: The Rust Implementation Leading MOQ Development
Luke Curley's moq-rs has become the reference implementation for MOQ Transport, driving both protocol development and real-world testing.
What is moq-rs?
moq-rs is an open-source Rust implementation of the MOQ Transport protocol, created and maintained by Luke Curley, a software engineer at Twitch. It has become one of the most actively developed MOQ implementations and serves as a de facto reference for the protocol.
Key Features
Full Protocol Support
moq-rs implements the core moq-transport protocol including:
- Publishing and subscribing to tracks
- Relay functionality with fan-out
- WebTransport support for browser-based clients
- Catalog handling for track discovery
Relay Server
The project includes a fully functional relay server (moq-relay) that can:
- Accept connections from publishers and subscribers
- Fan out media to multiple subscribers
- Handle subscription filtering (latest group, specific ranges)
- Cascade to other relays
CLI Tools
moq-rs ships with command-line tools for testing:
moq-pub: Publish media from a file or pipemoq-sub: Subscribe and output media to a file or pipe- Integration with FFmpeg for encoding/decoding
Architecture
The codebase is well-structured into several Rust crates:
moq-rs/
├── moq-transport/ # Core protocol implementation
├── moq-relay/ # Relay server
├── moq-pub/ # Publishing CLI
├── moq-sub/ # Subscribing CLI
├── moq-web/ # Browser demo (WebTransport)
└── moq-api/ # Control plane API
Getting Started
# Clone the repository
git clone https://github.com/kixelated/moq-rs
cd moq-rs
# Run the relay
cargo run --bin moq-relay
# In another terminal, publish a video
ffmpeg -i input.mp4 -f mp4 - | cargo run --bin moq-pub
Impact on the Standard
moq-rs has played a crucial role in validating protocol design decisions. Issues discovered during implementation have directly influenced revisions to the moq-transport draft. This tight feedback loop between specification and implementation is one of the strengths of the MOQ standardization process.
What's Next
The project continues to evolve alongside the draft. Current focus areas include improving relay-to-relay cascading, optimizing memory usage for high-throughput scenarios, and enhancing the web demo for browser-based testing.