This repository contains a script to stream
camera/webcam video to an iDotMatrix
LED display over Bluetooth Low Energy (BLE). The code uses the idotmatrix Python client plus OpenCV for
camera capture and Pillow for image processing.
Tested with:
- Python 3.12.4 on macOS
Python packages:
idotmatrixopencv-pythonPillownumpy
Create a virtual environment and install requirements:
python -m venv venv
source venv/bin/activate
pip install -r ./requirements.txtstream_camera.py streams frames from a camera (e.g. webcam) to the
iDotMatrix display.
From the repo root:
python stream_camera.py --address auto --adaptiveArguments:
-
--address ADDRESS
Bluetooth address of the device, orauto/ empty to scan. -
--size SIZE
Physical pixel size of the square display. -
--logical-size LOGICAL
Internal render size before upscaling tosize. -
--fps FPS
Target frames per second to send to the display. -
--device-index INDEX
OpenCV camera index (0 for the default webcam). -
--max-colors N
Maximum number of colors after quantization (palette size). Lower values → fewer bytes and more banding. -
--adaptive
Enable adaptive multi-scale smoothing on the logical frame before upscaling. This flattens low-variance regions (e.g. sky, walls), improving compression. -
--debug
Enable debug logging, including a rolling average of the effective bitrate.
- At default settings, the screen still freezes every now and then. This has been traced to pure bandwidth limitations. Even with smoothing this issue is not solved, unless you lower bandwidth drastically (e.g.
--max-colors 8and--logical-size 16).