September 2nd, 2024

Show HN: OBS Live-streaming with 120ms latency

Broadcast Box is a video broadcasting tool using WebRTC for sub-second latency, supporting multiple streams and peer-to-peer connections. It integrates with OBS and GStreamer, and offers community support.

Read original articleLink Icon
CuriosityExcitementSkepticism
Show HN: OBS Live-streaming with 120ms latency

Broadcast Box is a tool designed for broadcasting video with sub-second latency, utilizing WebRTC technology for enhanced performance compared to traditional broadcasting methods like RTMP and HLS. The key features of Broadcast Box include its ability to achieve real-time broadcasting with sub-second latency, support for multiple simultaneous video streams, and peer-to-peer broadcasting capabilities that do not require a public IP. Users can upload videos at various quality levels for optimal server cost management. To set up broadcasting, users can utilize OBS (Open Broadcaster Software) or GStreamer, while viewers can access streams through a provided URL. Configuration is managed through environment variables and a `.env.production` file, and the project can be built from source using Go for the backend and React for the frontend, or deployed easily using Docker and Docker Compose. The project encourages community contributions and offers support through a dedicated Discord channel.

- Broadcast Box enables real-time video broadcasting with sub-second latency using WebRTC.

- It supports multiple simultaneous streams and peer-to-peer connections without needing a public IP.

- Users can configure settings and build the project using Go and React or deploy it via Docker.

- The tool is designed for easy integration with OBS and GStreamer for broadcasting.

- Community support is available through a Discord channel for users and contributors.

AI: What people are saying
The comments on Broadcast Box reveal various perspectives on its functionality and the broader context of live streaming technology.
  • Users express interest in low-latency streaming solutions, comparing Broadcast Box to alternatives like Cloudflare's service.
  • Some commenters highlight the benefits of low latency for interactive experiences, such as gaming and intimate broadcasts.
  • Concerns are raised about the challenges of WebRTC, particularly regarding NAT issues and the need for TURN servers.
  • Questions about scalability and the feasibility of using Broadcast Box for larger audiences or multiple sources are discussed.
  • Users seek clarity on practical applications and setup guidance for using Broadcast Box effectively.
Link Icon 18 comments
By @Sean-Der - 5 months
I created Broadcast Box originally as a reference server to test OBS against. It was way easier for people to test my WebRTC/WHIP PRs against. Seeing people use it I am seeing the benefits/excitement more.

* low latency means you have a relationship with your audience. These intimate broadcasts are a new medium.

* Simulcast means it is way cheaper to run a streaming site. No more running ffmpeg/generating transcodes server side.

* AV1/H265/Opus means users with lower bandwidth can now broadcast. Users with enough bandwidth can stream at quality levels they couldn’t before

* UDP gives us IRL/Roaming streams. No custom setup for re-connects.

* Multi-track lets you send multiple video feeds or languages at once

* E2E Encryption means that P2P distribution could be a thing

By @iod - 5 months
People interested in this project might also be interested in Cloudflare's webrtc streaming service¹ as a cloud hosted solution to this same problem. "Sub-second latency live streaming (using WHIP) and playback (using WHEP) to unlimited concurrent viewers." Using the same OBS WHIP plugin, you can just point to Cloudflare instead. Their target pricing model is $1 per 1000 minutes.² Which equates to $0.06 per hour streamed.

¹ https://developers.cloudflare.com/stream/webrtc-beta

² https://blog.cloudflare.com/webrtc-whip-whep-cloudflare-stre...

By @eqvinox - 5 months
> Sub-second Latency

> Broadcast Box uses WebRTC for broadcast and playback. By using WebRTC instead of RTMP and HLS you get the fastest experience possible.

Nothing in RTMP prevents you from achieving low latency; it's the software stack around it that determines latency for both RTMP and WebRTC. Only HLS does have some built-in deficiencies that cause extra latency.

By @mckirk - 5 months
If this does what it says it does I'll be a very happy user. Playing RPGs 'together' with somebody over the internet isn't that much fun if they are a second or more behind in what's going on. I've actually looked for a solution to this problem (low-latency P2P streaming) quite some time ago, and couldn't get it to work with just OBS because of strange bugs and other issues, so I really appreciate you including this use-case :)
By @freedomben - 5 months
Much more of a meta question, but why is live-streaming preferred by some people?

Live streaming just seems to have so many downsides to me:

1. Requires real-time presence

2. No editing (meaning less efficient use of time for the viewer)

3. No client-side speeding up/skipping irrelevant parts

4. No possibility of index or table of contents

What are some use cases where live streaming is better?

By @filleokus - 5 months
What's the state of the art in distributing WebRTC to 100k+ clients?

When I was more into the low latency streaming space a few years ago, it felt like WebRTC was there when it came to << 1 second latency, but the infrastructure to actually distribute it was not really. I think Cloudflare (and maybe some other vendors) were working on creating some standard, has it landed? Can I run my own horizontally scalable WebRTC broadcaster (are there open source implementations)?

Something like Low-Latency HLS or CMAF was at like < 5 second latency, but was on the other hand stupidly easy to distribute widely (just static files on a plain old CDN / http server).

By @kragen - 5 months
you know, almost every time i try to talk with my family on jitsi, there's some kind of glitch. they can't see my screen, or i can't see theirs, or they can see it but only in super low resolution, or they have the camera turned on but i can't see it, or we all get kicked off, or something. can broadcast box allow us to use obs studio (or some other free, open-source software) to stream to each other, without relying on a proprietary server? i don't need 100k+ clients, i'd be satisfied with reliable connectivity between 2–4 clients! and i could run a server outside of nat

i'm not going to get 120ms latency though. i'm in argentina, they're mostly in the usa, and i have 200+ milliseconds of latency over the internet to anything in the usa

if broadcast box isn't what i'm looking for, is there something else? i already know about zoom, google, and teams, but those all make us vulnerable to proprietary servers

By @gkhartman - 5 months
As someone unfamiliar with video broadcasting latencies, how does this compare to alternatives? Also, what are the hardware specs used to achieve the 120ms measurement?
By @Laesx - 5 months
I've been using OvenMediaEngine for years which seems to be the same thing as this, but this looks pretty promising I'll give it a shot
By @monocularvision - 5 months
I see the following statement in the README:

“You could also use P2P to pull other broadcasters into your stream. No special configuration or servers required anymore to get sub-second co-streams.”

I currently have this setup for doing a co-stream with a friend and it is terrible:

1. Friend is running OBS to capture his gameplay. 2. Friend has OBS streaming to a Raspberry Pi I have running at my house. 3. The Raspberry Pi is running nginx configured to accept the RTMP stream. 4. I run OBS on another machine to capture my gameplay, add overlays, etc. 5. My OBS has an input source using VLC to capture the stream from the Raspberry Pi.

The setup is awful. Video is pretty delayed and it often just stops working. I would love to look into this project but after reading through the README, I am unclear how I would use this for my setup. Any pointers?

By @nubinetwork - 5 months
So can I use this to record multiple streamers, add commentary and tracker overlays, to stream it back to twitch? I've been wanting to make something like this for a while...
By @ranger_danger - 5 months
IMO This has the same problems inherent to WebRTC itself, which is that a large percentage of users in the world are behind symmetric or CG NAT and so TURN relay servers are needed, but never actually defined by the application, because there are no good free ones. Personally I've never been able to use any WebRTC-enabled service for this reason, nor anyone else I know.
By @svpcom - 5 months
https://github.com/svpcom/wfb-ng (and cheap CCTV cameras with OpenIPC firmware) allow to broadcast video with < 50ms glass-to-glass latency. https://www.youtube.com/watch?v=4tlPJSQA6HA
By @piyushtechsavy - 5 months
Broadcasting over WebRTC can be if the source is single. But in case of a scenario of multiple source, like take a conference of 100 people as example, will it be smooth?
By @thih9 - 5 months
Assuming I run this on a vps, what would be the bandwidth cost?
By @Anunayj - 5 months
Why is low latency livestream so hard, while at the same time Cloud Gaming Tech like Nvidia Gamestream and such can have such a flawless experience?

I've used Moonlight + Nvidia Gamestream with ~40ms RTT and couldn't feel a difference in competitive shooters, so total latency must be pretty low.

Does it have something to do with the bandwidth requirements? (1 stream v/s potentially hundreds)