Featured Posts

Play DVD disks in XBMC on Raspberry Pi

Posted by Mike Redrobe | Posted in Software | Posted on 20-09-2012

Tags: , ,


Here’s how to add DVD playback support into RaspBMC n your Raspberry Pi
(requires MPEG2 key installed on SD card – buy one here:

i.e. Playback commercial DVDs direct from attached USB DVD drive

While it works well, it only plays the film, no dvd menus.

SSH into the running RaspBMC

Download and compile libdvdcss

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

cd libdvdcss-1.2.12
sudo make install
sudo cp /usr/local/lib/libdvdcss* /lib

Install mplayer

sudo apt-get install -y mplayer

Make a directory to store the virtual file

sudo mkdir /dvd

Make the background script:

sudo nano /sbin/playdvd.sh

mkfifo /dvd/dvd.mpg
while :
        mplayer dvd://1 -dumpstream -dumpfile /dvd/dvd.mpg 1>null 2>null
        sleep 5

ctrl+X to save the file

Make it executable

sudo chmod a+x /sbin/playdvd.sh

Add it to startup:

sudo nano /etc/rc.local

add the line


before exit 0.

(ctrl+x to save and close)

In the XBMC GUI:

Add /dvd as a video folder in XBMC

When you want to play a dvd, play the dvd.mpg file

The script running in the background will take care of dvd changes.

Play DVD disks on Raspberry Pi

Posted by Mike Redrobe | Posted in Technology | Posted on 19-09-2012

Tags: ,


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
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.