Quick Start
We've got a few demos to show off MoQ in action. Everything runs on localhost in development, but in production of course you'll run these components across multiple hosts.
Start by cloning the repo:
git clone https://github.com/moq-dev/moq
cd moqThen pick your poison: Nix or not.
Option 1: Using Nix (Recommended)
The recommended approach is to use Nix. It's like Docker but without the VM; all dependencies are pinned to specific versions.
Install the following:
- Nix
- Nix Flakes
- (optional) Nix Direnv
Then run the demo:
# Runs the demo using pinned dependencies
nix develop -c justIf you install direnv, then the Nix shell will be loaded whenever you cd into the repo:
# Run the demo... in 9 keystrokes
justOption 2: Manual Installation
If you don't like Nix or enjoy suffering with Windows, then you can manually install the dependencies:
Some workspace crates have additional system dependencies and are excluded from the default build:
- moq-gst — requires GStreamer development libraries
- libmoq — requires a C toolchain
- moq-ffi — requires Python and maturin
These are all included in the Nix dev shell. To build them manually, install the deps and use cargo build -p <crate>.
Then run:
# Install additional dependencies, usually linters
just install
# Run the demo
justWhen in doubt, check the Nix Flake for the full list of dependencies.
What's Happening?
The just command starts three components:
- moq-relay: A server that routes live data between publishers and subscribers.
- moq-cli: A CLI that publishes video content piped from
ffmpeg. - demo: A web page with various demos.
Once everything compiles, it should open localhost:5173 in your browser.
WARNING
The demo uses an insecure HTTP fetch for local development only. In production, you'll need a proper domain and TLS certificate via LetsEncrypt or similar.
More Demos
- Web Demo — watch and publish live streams from a browser
- MoQ Boy — crowd-controlled Game Boy Color streaming with live video, audio, and anarchy-mode input
Check out the full development guide for more commands, or try publishing to the public relay: