Skip to content

Commit f78abb9

Browse files
kixelatedclaude
andcommitted
feat(moq-rtc): add WebRTC (WHIP/WHEP) gateway
Port the moq-rtc gateway from the dev branch. It bridges WebRTC and MoQ, speaking WHIP (publish) and WHEP (subscribe) in either HTTP role, so it can accept incoming peers (OBS, browsers) or dial out to a remote WebRTC server. All four paths work; ingest covers H.264/VP8/VP9/Opus and egress adds H.265/AV1, using str0m for ICE/DTLS/SRTP and a shared single-UDP-port mux. Adapted to main's current APIs: `Broadcast`/`Track` model, infallible `OriginConsumer::request_broadcast` + `OriginProducer::dynamic` (#1913), `BroadcastConsumer::subscribe_track`, `publish_broadcast` lifetime tied to the producer, moq-mux's in-place H.264 `Import` (avc3 mode), and moq-native's `with_publish`/`with_consume` client builder. Wires the crate into the workspace and documents it (doc/bin/rtc.md, index, sidebar, crate map). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent accb0a9 commit f78abb9

27 files changed

Lines changed: 3365 additions & 7 deletions

Cargo.lock

Lines changed: 198 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ members = [
1717
"rs/moq-native",
1818
"rs/moq-net",
1919
"rs/moq-relay",
20+
"rs/moq-rtc",
2021
"rs/moq-rtmp",
2122
"rs/moq-token",
2223
"rs/moq-token-cli",
@@ -40,6 +41,7 @@ default-members = [
4041
"rs/moq-mux",
4142
"rs/moq-native",
4243
"rs/moq-relay",
44+
"rs/moq-rtc",
4345
"rs/moq-rtmp",
4446
"rs/moq-token",
4547
"rs/moq-token-cli",

doc/.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export default defineConfig({
137137
],
138138
},
139139
{ text: "CLI", link: "/bin/cli" },
140+
{ text: "WebRTC", link: "/bin/rtc" },
140141
{ text: "RTMP", link: "/bin/rtmp" },
141142
{ text: "OBS", link: "/bin/obs" },
142143
{ text: "GStreamer", link: "/bin/gstreamer" },

doc/bin/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ Another tool does the encoding (ex. ffmpeg), making it easy to pipe any media in
2929
ffmpeg -f avfoundation -i "0" -f mpegts - | moq-cli publish --url https://relay.example.com/anon --broadcast my-stream ts
3030
```
3131

32+
## [moq-rtc](/bin/rtc)
33+
34+
A WebRTC <-> MoQ gateway. Speaks WHIP (publish) and WHEP (subscribe) in either
35+
HTTP role, so it can accept incoming peers (OBS, browsers) or dial out to a
36+
remote WebRTC server. Ingest and egress both work for H.264, VP8, VP9, and Opus.
37+
3238
## [moq-rtmp](/bin/rtmp)
3339

3440
An RTMP / enhanced-RTMP -> MoQ ingest gateway. Accepts RTMP from any encoder

0 commit comments

Comments
 (0)