OBS2Browser allows you to connect OBS directly to your web browser. Your audio/video goes directly into your browser via P2P. This will reduce your stream delay and save on bandwidth costs! On a properly configured local machine you can expect to see sub-100ms times.
To do this we use the newly added WHIP output in OBS. With WebRTC you can now have a low latency P2P broadcast in OBS.
If you want to do a 'one to many' broadcast Broadcast Box might be a better option. OBS2Browser can only support one viewer at a time, while Broadcast Box has no upper limit.
OBS2Browser
facilitates the handshake between your browser and OBS. It exists just to transport two text messages.
After this handshaking is done OBS2Browser
is never used. All of the media is exchanged directly between OBS and your browser.
To confirm this you can shut down OBS2Browser
after the session has started. Your browser will continue to play frames from OBS.
Execute go run github.com/sean-der/OBS2Browser@latest
by default it listens on port 80. You can change that by setting the environment variable HTTP_ADDR
.
You should see a log line for the HTTP Server starting
2023/08/15 14:51:24 Starting HTTP Server on :80
Open http://localhost and press the Connect
button.
You will see a log in OBS2Browser
that says the WebSocket has connected
2023/08/15 14:52:00 WebSocket connected
Next configure OBS to the following
- Service - WHIP
- Server - http://localhost/whip
- Bearer Token - (None)
Press Start Streaming