A command-line tool for publishing and subscribing to media over MoQ. It works with FFmpeg for encoding and decoding.
cargo install moq-clidocker pull moqdev/moq-cliMulti-arch images (linux/amd64 and linux/arm64) are published to Docker Hub.
moq-cli routes endpoints onto a shared MoQ Origin: moq <MoQ side> <import|export> <endpoint>. The MoQ side (before the verb) is either --client-connect <url> (dial a relay) or --server-bind <addr> (self-host). import moves media into MoQ, export moves it out. The endpoint is a container format (fmp4, ts, flv, ... read from stdin / written to stdout), or a gateway (hls, rtmp, srt, rtc). A build with the play feature can also render a broadcast locally with moq <MoQ side> play.
Separate additional stages with -- to bridge several broadcasts (or both directions) over one connection, each naming its own --broadcast:
moq --client-connect https://relay.example.com/anon \
import --broadcast cam1.hang rtmp --listen 0.0.0.0:1935 \
-- import --broadcast cam2.hang rtmp --listen 0.0.0.0:1936ffmpeg -i input.mp4 -f mp4 -movflags cmaf - | \
moq --client-connect https://relay.example.com --broadcast my-stream.hang import fmp4moq --client-connect https://relay.example.com --broadcast my-stream.hang export fmp4 | \
ffplay -Play the broadcast in a native window and speaker (requires --features play when building):
moq --client-connect https://relay.example.com --broadcast my-stream.hang playHosts a MoQ server and publishes a single broadcast read from stdin into it. Useful for local testing without a separate relay process.
ffmpeg -i input.mp4 -f mp4 -movflags cmaf - | \
moq --server-bind '[::]:4443' --tls-generate localhost --broadcast my-stream.hang import fmp4Hosts a MoQ server and writes an incoming broadcast's media to stdout. The inverse of the above.
moq --server-bind '[::]:4443' --tls-generate localhost --broadcast my-stream.hang export fmp4 | ffplay -avc3raw H.264 Annex-B from stdinfmp4fragmented MP4 from stdin