Compiled video player with an example VDO:
VideoPlayer.zip (5.2 MB)
Online Converter
You can convert your own MP4 videos into VDOs by dragging-and-dropping them into the online converter:
https://felipemanga.github.io/ViDeO/
FemtoIDE project with sourcecode and encoder:
Video.zip (53.7 KB)
It is possible to run the encoder from inside the IDE, but it’s much slower than using the online converter. Just use that instead.
How It Works
Encoder:
The encoder goes through each frame and breaks it into 22 chunks of 8 rows each. Each chunk is compressed with LZ4.
Every frame includes 512 bytes of audio data. Audio is played back at 9216hz, resulting in 18 FPS.
Every fourth frame includes a 256-color palette. Calculating the ideal palette and reducing the amount of colors in each frame is the painfully slow part of the conversion process.
Player:
The video player puts the sound buffers in SRAM1, freeing up SRAM2.
Chunks of image data are read into memory using the new File
API, then decompressed into SRAM2 and flushLine
sends it all to the LCD.
With this memory configuration it is possible to use video in games.
MegaRace, anyone?