Yes. In fact, since it'll probably be a while until I get around to "cleaning it up" for a proper release as OctoWS2811 version 1.2, I'm going to just dump all the raw, ugly Maker Faire code right here, right now!
This is for a demo to be shown in Freescale's booth. A few weeks ago they contacted me and wanted some way to showcase stuff people have made with their chips. I offered to build them a LED display if they covered the costs. So when you see references to stuff about Freescale, that's why.
First, here's the Teensy hardware. It's just the OctoWS2811 adaptor and WIZ820+SD adaptor we sell, soldered together with long pins.
View attachment 1970
Actually, what you can't see is pin 4 is cut between the Teensy and WIZ820+SD, and between the WIZ820+SD and Octo board, pins 3 and 4 are shorted together. This routes the SD card's CS signal to pin 3. You can see SD.begin(3) in the code, but I want to be clear this tiny hack is needed. You can't use pin 4, because it's reserved for OctoWS2811.
I should also mention, this is using a work-in-progress version of OctoWS2811, which you can get from github.
https://github.com/PaulStoffregen/OctoWS2811
Version 1.1 can't work together with the audio library, so you must use this newer code which fixes that issue.
On the Teensy, the code you need is Freescale_Demo_3.ino ...and no, I'm not releasing the earlier 1 and 2 versions....
Then all you need to do is get "DEMO.BIN" onto your SD card. This part is requires several steps.
First, you run Processing with movie2sdcard.pde. This is similar to movie2serial.pde for live playing, except it writes the data to a file. The filenames and other stuff are hard coded. Pay attention to the frame rate. You MUST edit the Processing code with the exact frame rate. The processing code emits headers into the data with elapsed microseconds, which need to be correct for audio to stay in sync. In other words, if your video is 30 frames/sec, the code will emit 33333, 33333, 33334, 33333, etc, so over the long run those one with 1 extra microsecond cause the overall frame rate to be correct.
Unfortunately, the Processing code plays the video at 1X speed. If anyone knows a way to get processing to just run as fast as possible, please let me know?
The .BIN file from the Processing code can play (if renamed to "DEMO.BIN"), but there's no audio. Adding the audio requires 3 steps.
First, extract the audio from the original video using ffmpeg. For example:
./ffmpeg -i Freescale1.mov -vn -f wav Freescale1.wav
Then use sox to convert from WAV to raw data, and adjust the sample rate. Teensy actually uses 48e6/1088 as its sample rate, which is slightly faster than 44100. Getting it exactly matched will keep your audio in sync. Here's the command:
./sox Freescale1.wav -c 1 -b 16 -r 44117.647 Freescale1.raw
After this, run the "addaudio" command. Source code is below. This reads the original .BIN file from Processing and the .RAW file with the audio and writes a new .BIN file with both streams.
As with everything else, this is an extremely ugly hack (in fact, I wrote all this code within the last 12 hours) with file names and other important stuff hard coded. Hopefully everything you need to edit is near the top of each file. Expect to have to do some fiddling. The addaudio program has only been tested on Mac OSX 10.7. It will probably work on Linux. Windows is less likely to be good.
Once you get the DEMO.BIN from addaudio, just copy it onto the SD card and Freescale_Demo_3.ino ought to be able to play it.