Play DVD disks on Raspberry Pi

In August the Raspberry Pi Foundation started selling MPEG2 codec licenses for the popular Raspberry Pi.

With this installed, the Pi can decode MPEG2 directly on its GPU chip, with very little CPU usage. The ARM CPU used in the Pi isn’t really powerful enough to decode MPEG2 on its own.

Since DVDs use MPEG2, this is a very welcome addition as it means hardware accelerated playback for DVDs.

Unfortunately due to the legal position on decrypting the CSS encryption on DVD disks, many distributions don’t include the relevent files.

You can get around this by compiling it yourself on the Pi, and here’s how:

Download and extract the libdvdcss source code:

wget http://www.videolan.org/pub/libdvdcss/1.2.12/libdvdcss-1.2.12.tar.bz2
sudo apt-get install -y bzip2
tar -xvjpf libdvdcss-1.2.12.tar.bz2

Compile it (only takes a few minutes):

cd libdvdcss-1.2.12
./configure
make
sudo make install

All done, now copy the libraries over:

sudo cp /usr/local/lib/libdvdcss* /lib

Now we can play a DVD direct from the disk:

mkfifo /tmp/dvdpipe
mplayer dvd://1 -dumpstream -dumpfile /tmp/dvdpipe 1>/dev/null 2>/dev/null &
omxplayer -r /tmp/dvdpipe

This may come to XBMC eventually, but current XBMC DVD code doesn’t allow for hardware acceleration.