Skip to content

Drive short looping gif-like videos with Raspberry Pi Pico microcontroller (RP2040) on small LCD displays.

License

Notifications You must be signed in to change notification settings

rpxpx/picovideo

Repository files navigation

picovideo

Drive short looping gif-like videos with the Raspberry Pi Pico microcontroller (RP2040) on small LCD displays.
Working on Nokia-like 1.8" (160x128 px) LCD screens.

Supply video frames at command-line as a set of .png images. Compiles frames into a binary that is dropped onto Pico flash. Contains a compression algorithm that finds the optimum weave of images into blocks for compression with zlib.

Frame images should be prepared standardized to a screen size and for a desired framerate.
Sample images are provided in the ./imgs directory.

img1 img1 img2 img3

Framerates up to 16.36 fps are possible.

Developed in collaboration with Footnote Centre for Image and Text, Belgrade.

Some example videos here.


Installation


Usage

$ ./makevideo <framerate> <compression mode> [<overclock mode>] [<images>]

Output appears in picovdeo as video.uf2. Copy this to Pico flash.

Compression modes:
0: Raw data. Largest binary size, highest framerate.
1: Single frame compression.
2: Blokweave compression. Highest possible compression. Smallest binary, lowest framerate.

Overclock modes:
0: Standard processor speed: 133 MHz [default]
1: Overclock processor: 225 MHz

If no images are supplied as arguments, the images in the folder specified in IMGS_DIR will be used. If that folder is empty, or does not exist, the images in ./imgs will be used.


Maximum binary size is ~4.2MB, limited by available flash memory. Video compilation will fail if binary size would exceed this. Try higher compression, and then a smaller image set. In compression mode 0, 50 160x128 px frames can be compiled into video.

Highest possible framerate is 16.36 fps, in compression mode 0, and with overclocking on. When started, Pico will make a first pass through the image set to determine the maximum framerate for the binary. That framerate, and image decompression and render times, will be printed to screen for a few seconds. Pico will then loop through the frames at the requested rate, or the highest achievable rate if lower.

If the achievable rate is too low, try switching on processor overclocking. Overclocking consumes more power, and will deplete batteries faster.

Max framerates (fps)

0: 133 MHz 1: 225 MHz
0: raw 15.30 16.36
1: single frame 12-13 13-14
2: blokweave 7-8 9-11

About

Drive short looping gif-like videos with Raspberry Pi Pico microcontroller (RP2040) on small LCD displays.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published