libavg development team has recently announced a beta port of their multimedia library to the Raspberry Pi. libavg is a high-level development platform for media-centric applications using Python as scripting language and written in C++. I came to know this platform as I tried Xibo Digital Signage, and I tested it on ARM platforms.
Up to know this would only work using software rendering/decoding, and everything was painfully slow on ARM, but libavg developers are now making use of OpenGL ES to boost graphics speed. More work is needed, and they intend to eventually support features such as hardware video decoding (OpenMAX possibly via gstreamer) and compressed textures.
Installing libavg on Raspberry Pi.
Pre-built packages are available for Raspberry, so installation is pretty straight forward:
sudo apt-get install libxml2 libpango1.0-0 librsvg2-2 libgdk-pixbuf2.0-0 \ libavcodec53 libavformat53 libswscale2 libboost-python1.49.0 \ libboost-thread1.49.0 libsdl1.2debian libxxf86vm1 wget https://www.libavg.de/site/attachments/download/190 -O libavg-raspberry.tar.bz2 sudo tar -C /usr/local -xjf libavg-raspberry.tar.bz2
Running Samples Apps
32 samples are located in /usr/local/lib/python2.7/dist-packages/libavg/samples/ directory, and they rely on X11, so first start LXDE:
Open a serial console (LXTerminal) and run one of the sample:
cd /usr/local/lib/python2.7/dist-packages/libavg/samples/ python sampleapp.py
This will show a smoothly spinning “Hello World” string. Press “esc” to stop the demo. Most of them seems to work including software video playback (small video with low resolution and 29 frames). However, the first time, I tried with composite video output, and the content is not properly centered in the window, most probably because of overscan compensation is enabled. Most applications are just used to test libavg functionalities, although they could be also used as “getting started” tutorials, but firebird, a python/libavg game, is a lot of more fun to play with. It will require 1280×720 (720p) resolution, so it won’t work with composite, and if you use 720p, you may also have to enable disable_overscan=1 in config.txt, located in the FAT partition of your SD card.
cd firebirds python firebirds.py
The game is generally smooth, but the audio may cut from time to time. Changes in libavg config file (avgrc) may improve it.
If you want to use the latest version of libavg (svn head), you’ll have to built it yourself using a chroot as shown on libavg Raspberry Pi page, and preferably a powerful build machine since libavg is currently cross-compiled via qemu.