This project allows you to build an LED animation by editing video.
You need to have python3 (should come included on most Linuxes and recent macOS) and ffmpeg installed on your machine, e.g.
sudo apt-get install ffmpegIn your Python environment¹ install
pip3 install numpy ffmpeg-python rshellThe desktop/main.py expects a 1920×1080 video named video.mp4. This can be changed in the script.
Running the script generates the file pico/frames.py.²
It should be enough to execute process-and-upload.sh.
To generate and upload the data manually, follow the steps in the script.
python3 -m venv venv
source venv/bin/activateSome MicroPython IDEs, such as the beginner-friendly Thonny, don't play well with non-Python files on the microcontroller.
Therefore, the file is named frames.py despite containing no meaningful Python code and – importantly – being read
as a plaintext data file by the script, not executed or loaded as Python.
The first and the last line only exist to create a syntactically valid Python file and are skipped when parsed.
All other lines represent one frame. There is no representation of frame rates, the frame rate for replay is set in
pico/main.py and should, but is not forced to, match the frame rate of the video.
Within one line the pixels of the frame are concatenated by | and are represented by comma-seperated 0-255 int RGB values.
The pixels are stored in their wiring order as defined in desktop/main.py's PIXEL_COORDINATES.
Things to consider:
- Are all LEDs properly connected to ground?
- Is the voltage at reasonable levels across the LEDs in question? Consider feeding your input voltage into your LEDs
physically at multiple points. - Check if the artifacts are in your input video by replaying it frame by frame (use VLC and hit
Eto advance one frame at a time)