DEV Community

Malti Thakur
Malti Thakur

Posted on

How to Get Sub-Second Latency from OBS Using WHIP on AWS published.

Disclosure: I work at Ant Media, and this walkthrough uses Ant Media Server. The same WHIP steps in OBS apply to any WHIP-compatible server.

OBS over RTMP usually puts viewers 2 to 5 seconds behind you. That's fine for a normal broadcast. It's a problem for auctions, live classes, remote camera control, or anything where a person has to respond to what they see.

WHIP (WebRTC-HTTP Ingestion Protocol, RFC 9725) is the fix. OBS has supported it since v30, so you don't need new software on the encoder side. You change the service and the URL, and glass-to-glass latency drops below 0.5 seconds.

Here's a setup on AWS, start to finish.

What you need

  • An AWS account
  • OBS 30 or newer
  • About ten minutes

1. Launch the server

Subscribe to Ant Media Server on AWS Marketplace (there's a 7-day free trial of the software; normal EC2 charges still apply):

  1. Open View purchase options, choose Usage based, and click Subscribe.
  2. Go to Launch your software and choose Launch from EC2 Console.
  3. Pick the latest version and a region, then name the instance and choose an instance type and key pair.
  4. Keep the default security group for now and launch.

Nothing needs installing because the software is already running on the instance.

2. Enable SSL

A fresh instance serves plain HTTP on port 5080. Log in at http://<server-ip>:5080 with the username JamesBond and your EC2 instance ID as the password.

Then go to Server Settings → TLS/SSL, pick the free antmedia.cloud subdomain (or use your own domain), click Configure SSL, and apply the restart. When it comes back you'll have HTTPS on port 5443.

3. Configure OBS

In Settings → Stream, set the service to WHIP and use this as the server URL:

https://<your-domain>:5443/live/whip/<streamId>
Enter fullscreen mode Exit fullscreen mode

live is the default application name, and streamId can be anything. The stream is created when OBS connects. Leave the bearer token empty unless you've turned on stream security, then hit Start Streaming.

4. Play it back

https://<your-domain>:5443/live/play.html?id=<streamId>
Enter fullscreen mode Exit fullscreen mode

That plays over WebRTC. Add &playOrder=hls to check the HLS output of the same stream.

If it doesn't work

Symptom Likely cause
OBS says "streaming", no video UDP 50000–60000 is blocked in the security group
Fails immediately on start Wrong endpoint URL
No WHIP option in OBS OBS is older than v30
404 App name in the URL doesn't match (it's case-sensitive)

The UDP one catches almost everyone. Signalling goes over HTTPS and succeeds, so OBS looks happy, but the media has no path through.

RTMP or WHIP?

Use RTMP if nobody needs to react to the video. It works with almost every encoder. Use WHIP when delay matters and you're okay requiring OBS 30+, FFmpeg or a browser as the publisher.

Full version with screenshots: antmedia.io/whip-server-aws. You can also try publishing from a browser first on the public WHIP test page.

Ready to try it? Start the 7-day free trial on AWS Marketplace.

Top comments (0)