Skip to main content

Cast a screen to WLED

Project description

A cross platform python application for capturing an area of your screen and streaming it to any WLED device over UDP using the DDP realtime protocol. Here it is casting to a 32x32 LED matrix.

https://github.com/user-attachments/assets/ef07709c-d612-429a-a3a2-28bfc5f7d2c7

Maybe I just wasn't looking very hard, but I didn't find a simple tool already existing that does this.

This was mostly created with the idea of casting to an LED matrix in mind, but there's no reason you couldn't use it to cast to a strip or an alien covered in strips. You'd just need to use your imagination a bit more to work out what mapped where.

Looks great displaying a visualiser from whichever audio player you choose.

There are loads of cool visualisations/VJ set etc on youtube etc that look great too.

Issues and PRs are welcomed. This is still alpha at the moment. In my testing it is working on Windows 11 and Ubuntu 20.04 and 22.04. In my limited testing on MacOS, some accessibility features need to be enabled, but it did cast the screen to the LED matrix. The UI, however, was not really working. If someone needs to use it on MacOS, create an Issue, I'll see if I can borrow a mac for testing and spend a little time sorting it out.

Features

  • Autodiscovers WLED devices on your network. Choose which to cast to.
  • Pick a window to cast
  • The aspect ratio of the wled configuration is autodiscovered and applied to the casting area
  • Filters for saturation, contrast, brightness, sharpness and rgb balance are included. The values can be edited in the console menu on the fly while casting. Scale r, g, b down (ie less than 1) if you need sp you as not to have values overflow and clip. The default values work well for the 16x16 matrices from Aliexoress I have, but experiment as there is no doubt variation
  • The area being cast is clearly displayed with a red border
  • Move and scale the capture area with the keyboard (Ctrl + arrows to move, Alt+arrows to scale). Alternatively left click on the red border to drag it around, right click and move up/down to scale.
  • Decent performance - I get around 60-65fps with all filters enabled with the fps limiter off. This is really a little too fast for WS2812bs if you have a quite a few on a pin, so the fps is limited to 25 by default

Options (none required)

Option Desctription
--host HOST Skip network discovery and cast to this IP address
--title TITLE Cast the window whose title contains TITLE
--monitor [NUMBER] Cast a monitor rather than a window. Optionally pass the monitor number, else you'll be asked
--output-resolution Skip resolution discovery from WLED and use this (format 64x32)
--live-preview Show the output in a preview pane on the computer
--fps FPS Limit fps to FPS. 500 LEDS per GPIO is stable up to around 40Hz on and ESP32-WROOM for me but YMMV. Default 30
--search-timeout TIMEOUT Timeout for WLED network discovery, defaults to 3s. Increase if your latency is higher and devices are not found.
--workers [NUM] Number of workers capturing and sending data. Only increase if necessary to meet framerate.
--debug Enable debug logs

To implement:

Installation


Requires Python >=3.10. uv is recommended for managing Python versions and virtual environments:

uv python install 3.11   # if needed

With uv (recommended)

uv tool install wledcast
wledcast

Or run without installing:

uvx wledcast

With pip

pip install wledcast
wledcast

From source (developers/contributors)

Clone the repo, install the package (editable):

git clone https://github.com/ppamment/wledcast.git
cd wledcast
uv sync
uv run wledcast

Or with pip:

git clone https://github.com/ppamment/wledcast.git
cd wledcast
pip install -e .
wledcast

Additional requirements


Windows - ImportError: DLL load failed

You probably need to install the Visual C++ 2015 runtime. You can find it here:

https://www.microsoft.com/en-us/download/details.aspx?id=53840

Linux - cannot build wxpython wheel

Install the GTK+ development package. On Ubuntu 22.04 it is available from apt:

sudo apt install libgtkmm-3.0-dev

You can also find wheels for various linux distros here: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ Copy the url and install it with pip, then retry installing wledcast.

Licence


GPLv3, See the LICENCE file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wledcast-0.5.0.tar.gz (53.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wledcast-0.5.0-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file wledcast-0.5.0.tar.gz.

File metadata

  • Download URL: wledcast-0.5.0.tar.gz
  • Upload date:
  • Size: 53.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for wledcast-0.5.0.tar.gz
Algorithm Hash digest
SHA256 9385792d622ffd3d2d8dd6e19eaf0d3181b34416e82c49cc3a4f0a8cf2f14b7c
MD5 221d366ef1abbfb4b0d61db85b58641d
BLAKE2b-256 db7dde357b4456c5c510f455775fb5826de0248503cba6116da9943183a0478e

See more details on using hashes here.

File details

Details for the file wledcast-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: wledcast-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 43.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for wledcast-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c02326cd10273f88750ba4b384d3430304d16be05bcc8911a29573a4f4f2a1f
MD5 2a5f3cede06c4f641b3d6d07f0704290
BLAKE2b-256 0f76908ad1f47b4c92950a03b61eb5885a3dbe53fc547a62fa51d3797b06539d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page