Video playback on Gameduino
With the launch of Gameduino 3X, I have had some questions about using it for video playback. The FT81x chips have a video playback engine that can decompress high-resolution video at a rock-steady 30 fps, directly from an AVI file. That is, it's rock-steady if your MCU can stream the AVI file into the 81x chip fast enough. More on this below.
One small detail is that the 81x chips cannot just play any AVI file. It has to be encoded with the mjpeg codec, which is a standard codec supported by the Open Source avconv tool available on Linux. I'm sure it's also possible to do this on Mac and Windows, but I'll focus on Linux this week.
Starting with a short test video, like this one from Pixabay:
With the script video-convert2 in gd2-asset, you can transcode it into an AVI file suitable for playback by GD3 and GD3X. There are some prerequisite packages to install - they are listed in the comment at the start of the script. After installing them you can convert the video by running it like this:
$ ./video-convert2 Fun_Fair_-_40.mp4After some grinding, it writes the final result into out.avi. If you copy this file to GD3X's microSD card, you can play it with a short sketch:
#include <EEPROM.h>
#include <SPI.h>
#include <GD2.h>
void setup()
{
GD.begin();
}
void loop()
{
MoviePlayer mp;
mp.begin("out.avi");
mp.play();
}
You can also use the video2 demo included with the GD3X to play it - video2 shows a menu of all the AVI files present on the microSD card:

Here is the converted video, uploaded YouTube to show the quality:
https://www.youtube.com/watch?v=KlEpfGkIJOk
The bitrate in the script is hard-coded to 1500 bps, which is suitable for the Arduino. Of course a faster MCU will be able to move more data from microSD to the EVE, so you can increase the bitrate accordingly. With enough MCU throughput, FT81x can achieve quite high-quality video, particularly on the higher-resolution screen of the 7" GD3X.
That's all for this week. Something new is coming next week. Thanks for reading.