Expand description
SRT gateway for MoQ, both directions.
Runs an SRT
listener and routes each connection by its stream-id m= mode against a
moq_net::origin::Producer:
m=publish(the default): demux the MPEG-TS the connection carries withmoq_muxand publish it into the origin as an ordinary broadcast. The contribution-ingest analogue ofmoq-cli import ... hlsandmoq-rtc’s WHIP.m=request: re-mux a broadcast from the origin back to MPEG-TS and stream it to the caller, so a plain SRT player (VLC, ffmpeg) can watch it.
Two entry points, depending on how much control you need over each request:
run: the unauthenticated convenience. Build aConfigand hand it plus an origin torun; it accepts every publisher and subscriber and routes by prefix + resource name. A relay embeds this withrun(cluster.origin.clone(), config).Server/Request: bring your own auth. Loop onServer::accept, inspectRequest::resource/Request::stream_id(treat the stream id as a token if you like), then match on theRequest: accept aPublishinto an origin, or accept aSubscribeout of one, at a path of your choosing (or reject it). This is how an embedder (e.g. a relay verifying a JWT and scoping the origin per token) plugs its policy in. It mirrorsmoq-native’sServer/Request.
Beyond the listener, the dial module is the dial-out (client) role:
connect to a remote SRT listener as a caller and either dial::publish a MoQ
broadcast to it (restream MoQ out to a remote SRT ingest) or dial::pull a
remote stream into an origin (ingest a remote SRT source). It reuses the same
MPEG-TS <-> moq bridge; only the SRT caller transport is new.
A command-line interface is provided by the moq-cli binary, on top of this
library.
Pure Rust: SRT is provided by srt-tokio, with no libsrt or ffmpeg
dependency.
Modules§
- dial
- SRT client (dial-out): connect to a remote SRT listener and bridge it to MoQ.
Structs§
- Config
- SRT gateway configuration.
- Publish
- A pending SRT publish (contribution), waiting on the caller to authorize it.
- Server
- An SRT server that yields each incoming connection’s pending request as a
Request. - Subscribe
- A pending SRT subscribe (egress), waiting on the caller to authorize it.
Enums§
- Error
- Errors produced while ingesting SRT into MoQ.
- Request
- What an accepted SRT connection wants: to contribute media (
Publish) or to view it (Subscribe).
Functions§
- run
- Run the SRT gateway until it fails, publishing
m=publishconnections intooriginand servingm=requestconnections out of it.
Type Aliases§
- Result
- Result alias for the SRT ingest gateway.