Skip to main content

WhipPyWeb

WhipPyWeb is a Python tool that allows you to stream your desktop to a web browser using WebRTC. It is designed with OBS in mind.

Installation

You can install WhipPyWeb using pipx:

pipx install whippyweb
whippyweb run

or using Docker:

docker run -p 8080:8080 whippyweb

Features

  • Stream from OBS to a (single) web browser
  • Very low latency between OBS and web browser
  • You only need the Python server to establish the connection, audio and video are streamed directly from OBS to the web browser - there's no overhead of any Python processing (which can be slow).

How it works

sequenceDiagram
    participant OBS as OBS
    participant WPW as WhipPyWeb
    participant BRS as Web Browser

    BRS->>WPW: Create websocket connection
    activate BRS
    activate WPW
    Note over OBS,BRS: Stream start
    OBS->>WPW: WebRTC offer
    activate WPW
    WPW->>BRS: WebRTC offer (over websocket)
    BRS->>BRS: Create WebRTC Answer
    BRS->>WPW: WebRTC answer (over websocket)
    WPW->>OBS: WebRTC answer
    deactivate WPW

    OBS->>BRS: Video and audio stream
    Note over OBS,BRS: Stream stop

    OBS->>WPW: WebRTC close
    activate WPW
    WPW->>BRS: WebRTC close (over websocket)
    BRS->>BRS: Close WebRTC connection
    deactivate BRS
    WPW->>OBS: OK
    deactivate WPW
    deactivate WPW

How I got here

I wanted to improve the experience of an event I'm hosting. I wanted to stream my desktop to a web browser, to share the screen with my audience both in the same room (Projector with a Chromecast) and remotely (Google Meet sharescreen).

Tried RTMP, HLS but the latency was too much - imagine talking about a slide that is 3-12 seconds away from being visible on the screen...

Eventually stumbled upon this Medium article which pointed me to Broadcast-box. Broadcast-box in turn, directed me to OBS2Browser.

Since I wanted to make some changes and I never written a line of code in GO, I decided to write a Python version of OBS2Browser. WhipPyWeb is the result.

Now I can stream from OBS to a web browser, with very low latency.

flowchart LR
    gl(Guest Laptop) --HDMI-to-USB-C--> ml(My Laptop with OBS)
    ml --With WhipPyWeb--> br(Web Browser)
    br --WiFi--> cc(Chromecast) --HDMI--> pr(Projector)
    br --> gm(Google Meet)

Usage

Once whippyweb is running, you can access the player at http://localhost:8080/player. There you will see instructions on how to configure your OBS instance.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Release files for WhipPyWeb 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WhipPyWeb 1.0.0
File Size Uploaded
whippyweb-1.0.0.tar.gz 296.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for WhipPyWeb 1.0.0
File Interpreter ABI Platform
whippyweb-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 593.1 kB

Release files / whippyweb-1.0.0.tar.gz

Download URL whippyweb-1.0.0.tar.gz
Size 296.7 kB
Tags Source
SHA-256 checksum
How to use checksums
122fdb783c846f44d7bdfd9c4f186e4141d8432adec243ece7bbf00b14d853b8
BLAKE2b-256 checksum
How to use checksums
1ffad0768aa9ea64d50af220e1f7f4423106935756f7e812d652bb5b5f0fea54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / whippyweb-1.0.0-py3-none-any.whl

Download URL whippyweb-1.0.0-py3-none-any.whl
Size 296.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88850e5131c807dbfe507c452879e8b3a488c1d3bf1b784deba11e8c9aad03ae
BLAKE2b-256 checksum
How to use checksums
afaf64301608770311b81f87cc6da11c3c95835a2de21433126d0f0fd04cf249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page