Stream from OBS to a browser with WHIP on AWS
DEV Community

Stream from OBS to a browser with WHIP on AWS

In a live auction or remote workshop, a few seconds of video delay can make an audience response arrive after the moment has passed. This walkthrough sends an OBS feed to Ant Media Server on Amazon EC2 and plays it back in a browser over WebRTC. A simple stopwatch test shows how much delay viewers actually see.

WHIP, the WebRTC-HTTP Ingestion Protocol, handles the OBS-to-server connection. OBS sends a session offer over HTTPS, then sends the audio and video over WebRTC. The browser opens its own playback connection to the server. That gives you three places to check when a stream stalls: HTTPS signaling, media transport, and browser playback. WHIP specification (RFC 9725)

Deploy Ant Media Server on EC2

Launch the Ant Media Server Enterprise Edition AMI from AWS Marketplace. This walkthrough uses a single instance and OBS Studio 30.0 or later. Ant Media's WHIP support requires Enterprise Edition 2.10 or later, and browser playback over WebRTC also requires Enterprise Edition. AWS Marketplace listing ยท WHIP setup ยท WebRTC playback requirements

Check the EC2 security group and any host firewall for these inbound rules.

Port Purpose
TCP 5080 Initial dashboard access. Restrict it to your admin IP.
TCP 80 Certificate validation for the standard TLS setup.
TCP 5443 HTTPS for the WHIP endpoint and browser player.
UDP 50000-60000 Ant Media's default WebRTC media port range.

Open http://YOUR_EC2_PUBLIC_IP:5080 and sign in using the Marketplace image's setup instructions. In the web panel, go to Server Settings โ†’ TLS/SSL and configure an antmedia.cloud subdomain or your own domain. Apply the change, let the service restart, and confirm the panel loads at https://YOUR_HOST:5443. Server ports ยท TLS setup

Publish a test feed from OBS

In OBS, open Settings โ†’ Stream and select WHIP as the service. Paste this into Server.

https://YOUR_HOST:5443/live/whip/latency-test

Here, live is the Ant Media application and latency-test is the stream ID. Keep both values handy for the playback URL. If your application requires a publish token, enter it in Bearer Token.

Click Start Streaming and look for latency-test with a Broadcasting status in the Ant Media dashboard. OBS configuration

Force WebRTC playback and measure the delay

Open this URL in a browser while OBS is streaming.

https://YOUR_HOST:5443/live/play.html?id=latency-test&playOrder=webrtc

The embedded player normally tries WebRTC first and can fall back to HLS. Setting playOrder=webrtc limits this test to WebRTC, so a working video confirms which playback protocol you're measuring. Embedded player options

Point the OBS camera at a running stopwatch. Then use another camera to capture the physical stopwatch and the browser playback side by side in a single photo. Subtract the time visible in the player from the time on the physical stopwatch. For example, 12.80 s โˆ’ 12.42 s = 380 ms. Repeat a few times from the network your viewers will use. This measures the full camera-to-screen delay, including encoding, transport, and playback.

If HLS is enabled in your application, change the parameter to playOrder=hls and repeat the test with the same OBS feed. That keeps ingest fixed while you compare the two playback paths. HLS playback

If the player stays blank

  • OBS fails as soon as you start streaming. Open the HTTPS dashboard to verify the hostname, port, and certificate. Then check the application name, the /whip/ path, and the publish token if required. WHIP setup
  • The player loads with no video. First confirm the dashboard shows the same stream ID as Broadcasting. Then check whether UDP 50000-60000 is reachable through the EC2 security group and host firewall. A reachable HTTPS page only confirms that the HTTPS connection works. On a network that blocks outbound UDP, try from another network to isolate the issue. WebRTC playback troubleshooting ยท WebRTC on restricted networks
Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.