moq-cli is a command-line tool for publishing media to Media over QUIC relays from various sources and formats.
Overview
moq-cli makes it easy to:- Publish media files to MoQ relays
- Stream from cameras and microphones
- Convert existing media formats (fMP4, HLS) to MoQ
- Test and debug MoQ broadcasts
Installation
moq (not moq-cli).
Quick Start
Publish a video file to a relay:Commands
publish
Publish media to a relay:Relay URL including the broadcast pathExamples:
https://localhost:4443/anon/my-streamhttps://cdn.moq.dev/anon/test
Input source (file path, URL, or device)Examples:
video.mp4- Local filehttp://example.com/video.mp4- HTTP URLhttps://example.com/playlist.m3u8- HLS stream-- Stdin
Options
Input format overrideSupported formats:
mp4- MP4/fMP4 filehls- HLS playlistauto(default) - Auto-detect from extension
JWT authentication tokenExample:
--insecure
Skip TLS certificate verification (development only)
QUIC backend to useOptions:
quinn(default)quicheiroh
Examples
Publish Local MP4 File
Publish from HTTP URL
Publish HLS Stream
Publish with Authentication
Generate a token and publish:Publish to Localhost (Development)
Publish via Iroh P2P
Publish from Stdin
Pipe media from another process:Input Formats
moq-cli supports various input formats through the moq-mux library:MP4 / fMP4
Fragmented MP4 files are recommended for streaming:HLS
Publish from HLS playlists (live or VOD):- Download the playlist
- Parse segments
- Convert to MoQ format
- Publish to relay
Raw Streams
For custom formats, pipe through stdin:Configuration
moq-cli uses the same configuration as moq-native:RUST_LOG- Set log level (debug,info,warn,error)MOQ_BACKEND- Default QUIC backend
Features
moq-cli supports different QUIC backends:Scripting
Use moq-cli in shell scripts:Error Handling
moq-cli returns appropriate exit codes:0- Success1- General error2- Connection error3- Authentication error
Troubleshooting
Connection Refused
Certificate Verification Failed
Authentication Failed
Format Not Supported
Resources
- Source Code - GitHub repository
- moq-mux - Media muxer/demuxer library
- moq-native - Native client library
Next Steps
moq-mux
Learn about media format conversion
moq-relay
Set up your own relay
moq-token
Generate authentication tokens
Authentication
Learn about JWT tokens