Ever since I started playing around with the Raspberry Pi, I wanted to push its limits further by experimenting with more demanding projects. The latest project I worked on was to build a fully featured home theater/media center using a Raspberry Pi. I had the following goals in mind when I started working on this project.
- Be able to play movies and TV shows in most common video formats.
- Show movie information such as name, year, genre, tagline, synopsis, cast and rating.
- Keep track of movies I have already watched.
- Make suggestions on new/upcoming movies based on my preferences.
- Standard IR remote control for interaction.
- Access to online streaming services such as Youtube.
- Support for plugins and extensions to add additional functionality.
I decided to use XBMC for this project since it is a free and open source media center software which meets all of the above requirements. XBMC has a number of distributions targeted for the Raspberry Pi. Most prominent ones are given below.
Out of the above 3, OpenELEC was chosen due to its rich feature set, simplicity and active development.
Given below are the hardware I used together with their respective prices at the time of writing.
|Raspberry Pi B+ Kit||$49.95|
|Raspberry Pi Clear Acrylic Case for Model B+||$12.99|
|MicroSD Card (8 GB, Class 10)||$6.99|
|Media Center Remote||$14.59|
|External Hard Drive (3 TB)||$142.00|
|Micro USB Cable||$4.79|
Note – Raspberry Pi is not capable of powering the external hard drive through the USB port. Therefore please make sure to get a hard drive with an external power supply, or use a flash drive with sufficient capacity for storage.
After getting the required hardware components, follow the instructions below to install and configure OpenELEC.
- Download the latest stable build of OpenELEC for Raspberry Pi from here (download the disk image, not the update file).
- Extract the downloaded archive file to find the disk image.
- Use Win32 Disk Imager to write the extracted disk image to your MicroSD card.
- Store your movies and TV shows in the external hard drive. XBMC uses the file and folder name to identify name and year in the case of a movie, or name, season and episode number in the case of a TV show. It supports file naming conventions used by most movies and TV shows available for download. You can read more about supported file naming conventions for movies and TV shows in the official documentation.
- Connect IR receiver of the remote, WIFI dongle and the external hard drive to the Raspberry Pi using USB.
- Connect the Raspberry Pi to your TV using HDMI.
- Power up the external hard drive and the Raspberry Pi using their respective power supplies.
If everything went smoothly, XBMC should now boot up and end up showing the home screen as shown below. Also it should respond to standard navigation buttons on the remote control out of the box.
The final step is to set content types and scan the hard drive for movies and TV shows. This can be done by following the instructions available here.
Once everything is set up, it will organize and show all your movies and TV shows in an easy to use user interface. We can also download subtitles for movies and TV shows while they are being played. Some screenshots of my setup are shown below:
One challenge I had to overcome while working on this project was to decide on the best way to power the Raspberry Pi. When it was powered using the external power supply, I was able to successfully power it down using the power button on the remote control. However, after powering down, it can no longer be powered on using the power button again. This is because the OS has already shut down and no longer accepting commands through the USB port. To overcome this problem, i got rid of the external power supply and used a micro USB cable to power the Raspberry Pi from the USB port in the TV. So the Raspberry Pi boots up when the TV is turned on, and shuts down when it is turned off.
The results exceeded my expectations by a significant amount. It was able to play even the most demanding full HD videos without any lag. Being able to maintain my movie and TV show library in an organized manner, keep track of the ones i have already watched, ability to download subtitles on the fly and the support for installing plugins/add-ons were all much desired features. Also the standard IR remote control gave the feeling of a premium home theater system at the fraction of its cost.