Rust library for Media over QUIC
Go to file
kixelated c88f0b045a
Migrate to quinn and async Rust (#21)
I miss quiche, but it was a pain to do anything asynchronous. MoQ is a
pub/sub protocol so it's very important to support subscribers
joining/leaving/stalling. The API is also just significantly better
since quinn doesn't restrict itself to C bindings, which I'm sure will
come back to haunt me when we want OBS support.
2023-06-08 00:01:34 -07:00
.github/workflows Split the web player into it's own repo. 2023-05-24 13:29:18 -07:00
cert Serve the certificate fingerprint over HTTP (#20) 2023-05-24 17:20:44 -07:00
media Split the web player into it's own repo. 2023-05-24 13:29:18 -07:00
src Migrate to quinn and async Rust (#21) 2023-06-08 00:01:34 -07:00
.editorconfig Tabs not spaces u nerds. (#18) 2023-05-23 12:04:27 -07:00
.gitignore Split the web player into it's own repo. 2023-05-24 13:29:18 -07:00
.rustfmt.toml Serve the certificate fingerprint over HTTP (#20) 2023-05-24 17:20:44 -07:00
Cargo.lock Migrate to quinn and async Rust (#21) 2023-06-08 00:01:34 -07:00
Cargo.toml Migrate to quinn and async Rust (#21) 2023-06-08 00:01:34 -07:00
LICENSE Initial public release. 2022-06-29 09:17:02 -07:00
NOTICE Initial public release. 2022-06-29 09:17:02 -07:00
README.md Serve the certificate fingerprint over HTTP (#20) 2023-05-24 17:20:44 -07:00

README.md

Media over QUIC

Media over QUIC (MoQ) is a live media delivery protocol utilizing QUIC streams. See the Warp draft.

This repository is a Rust server that supports both contribution (ingest) and distribution (playback). It requires a client, such as moq-js.

Setup

Media

This demo simulates a live stream by reading a file from disk and sleeping based on media timestamps. Obviously you should hook this up to a real live stream to do anything useful.

Download your favorite media file and convert it to fragmented MP4. This requires ffmpeg

wget http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 -O media/source.mp4
./media/generate

Certificates

Unfortunately, QUIC mandates TLS and makes local development difficult. If you have a valid certificate you can use it instead of self-signing.

Use mkcert to generate a self-signed certificate. Unfortunately, this currently requires Go in order to fork the tool.

./cert/generate

Unfortunately, WebTransport in Chrome currently (May 2023) doesn't verify certificates using the root CA. The workaround is to use the serverFingerprints options, which requires the certificate MUST be only valid for at most 14 days. This is also why we're using a fork of mkcert, because it generates certificates valid for years by default. This limitation will be removed once Chrome uses the system CA for WebTransport.

Usage

Run the server:

cargo run

This listens for WebTransport connections on https://localhost:4443 by default. Use a MoQ client to connect to the server.