Multi-site video · WebRTC · SRT · AWS EC2

Campus Connect:
One Platform, Two Live Media Paths

A remote site needs to do two different things: join a conversation, then receive the final program. Campus Connect gives each job its own media path, with a shared operator interface to keep the experience understandable.

A source-led walkthrough of the application, Rust Capture Bridge and Docker Compose infrastructure, including the documented AWS setup and rehearsal workflow.

One EC2 hostDocumented Compose topology
WebRTCInteractive site greetings
SRT → LL-HLSFinal-program distribution
Next.jsRoles, mode and branding
Rust bridgeCapture planning and handoff

The design problem

A conversation and a program
are not the same workload.

Greeting mode is interactive: the primary site and two remote sites publish their cameras and microphones into a shared room. Program mode distributes a finished feed from the primary site to remote screens. Trying to treat both as the same browser call would blur who publishes, who listens and where the final mix comes from.

The implementation separates these concerns. LiveKit handles the RTC rooms, OvenMediaEngine accepts the program feed and serves adaptive playback, and the Next.js app handles role logins, operator-selected mode, receiver pages and customer labels. [S1]

Infrastructure map · Archify

One host.
Several deliberately separate services.

The repository’s deployment target is Ubuntu on an EC2 instance with an Elastic IP. nginx fronts the web, signaling and playback endpoints; the RTC media and TURN services also require their own network paths.

Reading the map: browsers enter through nginx for HTTP and signaling. The control app stores mode and branding in its own volume; the RTC stack uses Redis. The external program encoder sends SRT directly to the stream relay. Monitoring runs alongside these services.

Explore the infrastructure Expand / collapse

Use the pan buttons, swipe the frame, or focus it and press ← / →. Home / End reach either edge; viewer controls are on the right.

Six decisions

Keep the operator’s job simple.
Make the engineering boundaries explicit.

The useful unit of explanation is not the container count. It is who controls the session, which path carries the video, and what has to remain predictable during an event.

01

A shared control surface

Let roles decide the available actions.

The app supports five role logins: admin, operator, primary site and two remote sites. Role passwords are checked against bcrypt hashes, and a signed session cookie carries the role. The mode endpoint accepts changes only from an admin or operator; the media-token endpoint checks the session, requested room and role before issuing access. [S2]

Branding is a separate concern. Customer setup stores the platform, organization, site and mode labels without changing internal role identifiers or room names. Operators can use meaningful names while the routing and permissions stay stable.

02

Interactive greeting rooms

Publish for conversation; receive for the display.

In greeting mode, all three site roles may publish and subscribe in campus-greeting. Receiver pages provide either a single site feed or a three-site grid for the computer driving a display or video mixer. The browser obtains a room-scoped token and connects to LiveKit rather than sending camera media through the Next.js process. [S1]

The implementation requests a 1080p30 camera target with an 8 Mbps video ceiling and enables simulcast, adaptive stream and dynacast. These are publishing and subscription settings, not a measured link-speed result. Camera and microphone selections are stored locally and can be reapplied from the console.

03

A separate program feed

Distribute the finished mix, not another meeting.

The primary site’s final output reaches OvenMediaEngine over SRT on UDP 9999; RTMP is also configured as an input. The relay passes through the source rendition and adds a 720p H.264 rendition at 2.5 Mbps and a 480p rendition at 1 Mbps. Remote players consume the LL-HLS playlist through nginx. [S3]

The player checks whether a playlist exists before attaching playback. It uses hls.js with low-latency mode where supported, falls back to native HLS, and defaults to automatic quality selection. Program mode also has a separate RTC room for monitoring and requested returns; remote camera and microphone start off in that mode.

04

Capture at the edge

Keep hardware capture near the hardware.

The Rust Capture Bridge runs on a capture machine, not inside the web app. Its shared core resolves profiles, checks formats and generates FFmpeg or GStreamer command plans. A CLI, headless daemon and Tauri/Leptos desktop interface use that core. The runner launches the selected process and reports a non-success exit. [S4]

The concrete FFmpeg input paths cover AVFoundation on macOS, v4l2 on Linux, DeckLink-capable builds and a synthetic test pattern. Hardware-specific SDK and tool availability remain part of choosing a capture backend. The important handoff is explicit: the bridge prepares and launches an encoder pipeline, and SRT carries the resulting program to the relay.

05

Explicit network paths

A working web page is not proof of a working media path.

nginx terminates HTTPS for the app, RTC signaling, playback and monitoring hostnames. LiveKit and coturn use host networking, while the web container and relay have different exposed or published ports. The browser’s media connection therefore depends on reachable ICE candidates and the security group, not only on a successful request to port 443. [S5]

coturn provides a relay option when a direct path cannot be established. The production preflight also checks a less visible boundary: the web container must call the host-network RTC API through the host gateway, not its own loopback address. That distinction prevents an apparently sensible localhost URL from pointing at the wrong process.

06

Persistent operating state

Keep mode and branding outside the container image.

The selected mode and customer labels are written to JSON files on the app-data volume. Redis persists separately for the RTC services. Certificates, Grafana, Prometheus and Uptime Kuma also have their own storage volumes. Rebuilding the web image does not need to redefine the customer’s site names. [S6]

Clients poll the mode endpoint every five seconds. An operator’s change updates shared application state and the browser chooses the appropriate room and publishing defaults. It does not start the external encoder: program distribution still depends on a real feed reaching the relay.

Media-path map · Archify

Two modes.
Two different routes to the screen.

The greeting path prioritizes interaction. The program path prioritizes distribution of the final mix with an adaptive playback ladder. Keeping them separate also makes troubleshooting more precise.

Reading the map: the upper path connects site browsers to the RTC room and receiver views, with coturn as the fallback relay. The lower path sends the final program through an encoder and OvenMediaEngine to the remote LL-HLS player.

Explore the media paths Expand / collapse

Use the buttons or ← / → when the frame is focused. Home / End reach either edge; the full viewer provides more room.

Greeting trouble starts at the endpoint.

Check camera permission, the selected input devices and the advertised RTC address before assuming the app is broken. Separate browser profiles are needed when testing multiple roles because ordinary tabs share the same session cookie.

Program trouble starts at ingest.

A successful login cannot create a program stream. Check the encoder, SRT destination and stream name first, then the playlist and player. This separates “no input is arriving” from a browser playback error.

AWS infrastructure setup

Make the deployment repeatable
before putting it in front of operators.

The deployment guide specifies a single Ubuntu 24.04 EC2 host, starting with c7i.2xlarge, an Elastic IP and at least 100 GB of gp3 storage. This is the documented starting configuration; the operating workflow uses rehearsal observations to decide whether to move to c7i.4xlarge. [S7]

  1. Prepare the host, DNS and security group.

    Install the repository’s host prerequisites and point the app, RTC, TURN, stream and monitoring hostnames at the Elastic IP. Restrict SSH to an administrative or VPN address, ingest ports to the encoder networks, and monitoring to the intended office/VPN CIDR. Browser media ports need rules that match the participating networks.

  2. Configure role credentials and service endpoints.

    Create the environment file from the example, generate role password hashes and separate service secrets, and select versioned media images. Production preflight rejects missing placeholders, unquoted bcrypt hashes, latest media tags, insecure app/signaling URL schemes and an unrestricted monitoring CIDR.

    cp .env.example .env
    # Fill deployment values and generated secrets before continuing.
    ./scripts/preflight.sh
  3. Issue TLS certificates for the deployment names.

    The supplied runbook uses Certbot and shares the certificate volume with nginx and the media services. Initial standalone issuance needs the challenge ports available; the guide treats it as a bootstrap or maintenance-window action. Certificate renewal is an operating task, not something to assume from a container being present.

  4. Render configuration, then deploy.

    Use the deployment script rather than skipping straight to Compose. It runs preflight, renders the RTC and relay files into runtime/, and starts the services. The relay rendering substitutes only the public-IP variable so OvenMediaEngine’s own stream-name placeholder survives.

    ./scripts/deploy.sh
    ./scripts/healthcheck.sh
    docker compose ps
Network groups to verify against the deployment
PathPortsWhy it exists
Public web and signalingTCP 80 / 443ACME, HTTPS, WSS and playback
RTC mediaTCP 7881; UDP 50000–60000Browser real-time media paths
TURNUDP/TCP 3478; TCP 5349Connectivity relay and TURN/TLS
Encoder ingestUDP 9999; TCP 1935 / 1936; UDP 7885SRT, separate RTMP inputs and WHIP
Relay WebRTC, when usedTCP 10000; UDP 10000–10003Relay ICE paths, separate from LL-HLS

Operate, rehearse, recover

Watch the signal,
not just the container status.

The repository provides a progression from web-only checks, to a real local media stack, to production configuration validation. The synthetic 1080p program source exercises ingest and playback without depending on a camera being available. A full rehearsal then brings the intended endpoint machines and network conditions into the picture. [S8]

Observe the workload that is actually expensive.

Prometheus scrapes the app, RTC services, host and containers. Grafana provides operating views; Uptime Kuma is included for availability checks. The app’s metrics expose its health indicator, uptime and selected mode, while media troubleshooting also needs participant state, relay logs and network-quality observations.

The source rendition bypasses re-encoding, but the 720p and 480p outputs use CPU. The runbook therefore ties instance sizing to sustained rehearsal load rather than treating a larger instance as a substitute for checking endpoints and uplinks.

Back up the configuration as well as the state.

The backup script packages Compose and configuration files, the environment file and the selected persistent data volumes. That captures the inputs needed to reconstruct the system, not just an image tag. Because it includes secrets, the archive is private operational material.

The restore guide rebuilds volumes and runs the normal deployment entry point. A useful recovery exercise is to prove that mode, customer labels, certificates and operating data come back together—then repeat the media rehearsal.

Separate control from transport.

The operator app chooses behavior. LiveKit and the relay carry media. Troubleshoot the boundary that failed.

Keep deployment inputs explicit.

Host addresses, TLS names, image versions and media ports belong in reviewed configuration, not operator guesswork.

Keep the program handoff visible.

A mode label is not a live feed. The encoder, ingest stream and player each have their own job.

Sources

Follow the implementation.

This article follows the Campus Connect source at revision 61c89eb45b04. The infrastructure figures are diagrams of that configuration; media-quality numbers are settings or deployment targets, not new benchmark results.

Source notes
  • [S1] Modes and browser media. docs/SIGNAL_FLOW.md, components/CampusConsole.tsx:13–45,73–104, components/MediaStage.tsx:40–79,425–505 and lib/media.ts:15–65, under campus-connect-web/ for application paths.
  • [S2] Roles and control. campus-connect-web/lib/auth.ts, app/api/mode/route.ts, app/api/media/token/route.ts and lib/tenant-store.ts.
  • [S3] Program distribution. config/streaming/Server.xml:80–173, docker-compose.yml:91–107 and campus-connect-web/components/OvenPlayerClient.tsx:18–191.
  • [S4] Capture Bridge. docs/CAPTURE_BRIDGE.md, capture-bridge/crates/capture-core/src/pipeline.rs:6–71,74–119 and runner.rs:6–22.
  • [S5] Network boundaries. config/nginx/templates/default.conf.template, rtc.yaml, docker-compose.yml, scripts/preflight.sh:76–84 and docs/SECURITY_GROUPS.md.
  • [S6] Persistent mode and labels. campus-connect-web/lib/mode-store.ts, lib/tenant-store.ts, components/ModeBadge.tsx:15–41 and the volumes in docker-compose.yml.
  • [S7] AWS setup. docs/AWS_DEPLOYMENT.md, scripts/deploy.sh, scripts/preflight.sh and scripts/render-configs.sh.
  • [S8] Operations. docs/LOCAL_TESTING.md, docs/MONITORING.md, docs/BACKUP_RESTORE.md, monitoring/prometheus.yml, scripts/backup.sh and campus-connect-web/app/api/metrics/route.ts.

Implementation detail: the current browser code enables adaptive stream and dynacast. That code, rather than the older contrary sentence in the media-quality guide, is the basis for the greeting-mode description here.

Media relay licensing: the wrapper is MIT licensed; the OvenMediaEngine relay has its own upstream AGPLv3 terms, documented in docs/STREAM_RELAY_AGPL_NOTICE.md.

The takeaway

One interface for the people.
Clear boundaries for the engineering.

Campus Connect’s central idea is not to force every feed through the same protocol. It gives greetings an interactive RTC path, gives the finished program a distribution path, and wraps both in an operator workflow with explicit deployment and recovery inputs.

Back to the beginning ↑