Chapter 12. Raspberry Pi Media Center

I am a huge set-top box fan. Not the rubbish one your cable company gave you, but the ones that let you connect to virtually every streaming service under the sun. In fact, if it weren’t for my wife and daughter, I would have gotten rid of digital cable service years ago and devoted myself entirely to streaming media services such as Netflix and Hulu. The only way that somebody will take my Apple TVs away from me is from my cold, dead hands!

One of the biggest attractions of the Raspberry Pi is its utility as a media center platform. Recall that the combination of the Broadcom VideoCore IV GPU and the HDMI output means that you have the capability of sending 1080p High Definition to your monitor or HD television.

As it always happens in open source development, several software options exist for building a Raspberry PI media center. Some of the most popular choices include

Image Raspbmc: http://is.gd/OX7dMY

Image RasPlex: http://is.gd/HfEIIi

Image OpenELEC: http://is.gd/drMs1E

Image Xbian: http://is.gd/7LUXtc

Three of these software/OS packages are derivatives of XBMC Media Center (http://is.gd/xwVddv), the gold standard in open source media player software. You can see a screen shot of the XBMC interface in Figure 12.1.

Image

FIGURE 12.1 XBMC is the gold standard in open source media center software.

Note that because I wanted the highest-quality screen shots for this book, the XBMC interface images I give you in this chapter are from the Windows version rather than from Raspbmc. The good news is that XBMC 12.2 “Frodo” looks and behaves exactly the same regardless of its host hardware—hence the great beauty of platform-independent, open source software.

A Bit o’ History

The name XBMC originally stood for Xbox Media Center because the software was intended to run only on modified (“modded”) Xbox consoles. These days, of course, XBMC runs on almost every desktop or mobile platform, and to that end, uses the backronym “XBMC Media Center.”


Note: XBMC and Raspbian

For those who are more experimentally minded, you can actually install XBMC directly on top of Raspbian. Check out the Raspbian XBMC project page (http://is.gd/vxKwGJ) for more details.


I like to describe XBMC as a Swiss Army knife media application that can play just about any media file you can throw at it. Here is a run-down of some of the best features of XBMC:

Image Plugins: You can easily extend XBMC functionality by installing add-ons that (for instance) display local weather, pull Internet Movie Database (IMDB) metadata for your currently loaded media, and so forth.

Image Media Scrapers: XBMC can scan any media you load and automatically detect everything there is to know about the item. For instance, the scraper can detect an MP3 audio file’s album track listing, song lyrics, and so on.

Image Apps: You can launch applications that enable XBMC to tie into streaming media services such as Netflix.

Image Codec Richness: Compressor–Decompressors (Codecs) allow media player software to recognize, decode, and play various media. Not only does XBMC ship with a ton of media codecs, you can manually install additional codecs to ensure that your custom media is playable from within XBMC.

For a more comprehensive listing of XBMC features, read the associated Wikipedia article at http://is.gd/yZmSK8.

But Will It Blend?

If you haven’t yet seen the Blendtec’s “Will It Blend?” viral marketing videos, then do yourself a favor and check them out on YouTube at http://is.gd/8gWfN9.

“Will It Blend?” reminds me of a question that is more cogent to us as Raspberry Pi enthusiasts—namely, “But does the Raspberry Pi have enough processing power to run XBMC appropriately?”

Ah yes, the eternal question. First things first: The Model A board simply will not do as a media player. Number one, there is the limited memory issue. Number two, you’ll need a hardwire Ethernet connection to get appreciable network speeds, and the Model A has no RJ-45 port.

Yes, yes—I know what you are thinking: “Couldn’t I add an RJ-45 wired Ethernet port to my Model A Pi by using USB?” This is true enough, but I nonetheless submit that the latency you’ll experience in not employing wired Ethernet that is built into the Pi’s circuitry (like we have with the Model B) makes the process barely worthwhile.

As in all things, though, your mileage may vary.

The primary differentiator among the various Raspberry Pi XBMC ports is how completely they take over the host operating system. Remember that with a device as hardware-constrained as the Pi, the fewer software layers you have between XBMC and the underlying hardware, the better.

There is vociferous debate online as to who makes the best XBMC player for the Pi. However, in this book we install Raspbmc because it is (generally) considered to be the most stable and mature XBMC port.

Introducing Raspbmc

As you probably guessed, Raspbmc (http://is.gd/OX7dMY) is a portmanteau of Raspbian and XBMC. Thus, Raspbmc replaces the operating system on your Raspberry Pi instead of serving as a third-party app that you install on an existing Raspbian installation.

Raspbmc is the brainchild of Sam Nazarko of London and achieved final 1.0 release status in February 2013. For in-depth coverage of all things Raspbmc-related, see Sam’s book Raspberry Pi Media Center, by Packt Publishing (http://is.gd/GDTsVR).

Basically, Sam stripped Raspbian down to almost bare metal and wove XBMC on top of it. To that point, don’t expect to get anything more than Terminal access to your Raspbmc system. Because X11 is not present, you’ll never get VNC remote connections to work.

You need the following components to get Raspbmc up and running on your Raspberry Pi Model B:

Image HDMI connection: You need a monitor or television (remember, no VNC support in Raspbmc).

Image A decent-sized SD card: Go for a 16–32GB, Class 10 card unless you are absolutely committed to storing your media on a USB thumb drive.

Image Keyboard and mouse: These peripherals are necessary due to the “no VNC” rule mentioned previously.

Image Wired Ethernet connection with DHCP: Although you can get Wi-Fi going easily enough after Raspbmc is installed on your Pi, your best bet—at least during the installation phase—is to plug in a physical Ethernet cable and let the Pi pick up an IP address from your local DHCP server.

Configuring Raspbmc

Flashing your SD card by using the Raspbmc installer does not actually fully set up your environment; instead, the installer formats your SD card, creates one big partition, and installs the barest layer of Raspbian on the card.

Upon first bootup the Raspbmc installer takes over the system, downloading and applying Raspbian to your Pi. You can see this in action in Figure 12.4.

Image

FIGURE 12.4 Raspbmc automatically installs the latest version of the software during the Pi’s first startup.

After installation completes, you see the XBMC interface and are asked to choose a default language. You need to navigate to System, Settings, Appearance, International to verify and set your localization settings for

Image Region

Image Character Set

Image Timezone country

Image Timezone

You’ll find that XBMC navigation is pretty intuitive by using the keyboard and mouse. As shown in Figure 12.5, each configuration window can be closed individually by clicking the “X” in the upper-right corner of each window. Also the navigation buttons in the lower-right of each screen take you back one screen or jet you to the Home screen, respectively.

Image

FIGURE 12.5 The XBMC user interface can be navigated easily with a keyboard, mouse, or infrared (IR) remote.

Getting Your Remote Control Working

What is a set-top box worth if you can’t control it with your favorite remote control? Nothing, in my estimation. Your first order of business is to study the list of Raspbmc-compliant remotes at the Raspbmc website (http://is.gd/5Sw23o).

Second, you need to decide whether you want to control your Raspbmc box via Internet Protocol (IP) or Infrared (IR). An example of an IP-powered remote control is an iOS or Android app that enables you to control your Raspbmc media center.

IR is a line-of-site remote control protocol that has been around seemingly forever; I’m sure that you use IR remotes to control your television sets right now.

If you decide to go the IP remote control route, then you should investigate mobile apps designed to control XBMC over your local IP network:

Image Official XBMC Remote (Android): http://is.gd/k4UeWY

Image Official XBMC Remote (iOS): http://is.gd/qZkt3l

Just for grins, let me show you how to set up your iOS-based XBMC Remote app to connect to your Raspbmc system.

Rather than give you a couple pages of Linux terminal commands, I will simply refer you to the “Using an IR Remote with a Raspberry Pi Media Center” tutorial at Adafruit (http://is.gd/97RvGt).

For instructions and/or advice on getting your own personal IR remote working with Raspbmc, I suggest you turn to the trusty eLinux.org website at http://is.gd/yaJOSw. This site contains a constantly updated list of peripheral devices that have been verified to work with the Raspberry Pi.

Transferring Content to Your Pi

You can upload media files (movies, TV shows, home videos, music, pictures...the list goes on) to your Raspberry Pi using File Transfer Protocol (FTP). I recommend the freeware Filezilla to Windows and Mac users because it is a stable, straightforward FTP client that looks and behaves the same on either OS platform.

You already know the IP address of our Raspbmc box, so you can get right to work.


Note: USB Is Allowed

If your Raspbmc SD card isn’t as large as necessary to store all your stuff, note that you can use a USB thumb drive as a media source. Simply populate the USB stick with your media, plug it into the powered USB hub that is connected to your Pi, and specify the USB location when you configure media detection.


Scraping Your Media

As I mentioned earlier in this chapter, a media scraper is a program that can detect, analyze, and report upon a media file that is present to XBMC. For instance, you can upload a season of The Big Bang Theory and let the built-in media scrapers fill in metadata such as plot summary, cast, original air date, and so forth.

The types of media that scrapers can detect are as follows:

Image Video games

Image Music

Image Movies

Image TV shows

Image Internet-based videos

Although the media scrapers available in XBMC are excellent, I advise you to name your media files as descriptively as possible (and without spaces) to help them to more efficiently and accurately do their work.

Take a look at Figure 12.12 to see an example of media file naming best practices.

Image

FIGURE 12.12 In order to ensure that media scraping works correctly, individual show files inside my s06 (season 6) folder should be named Big.Bang.Theory.s06e01, Big.Bang.Theory.s06e02, and so on.

The XBMC Wiki has an outstanding article on video library management and file naming best practices that needs to be on your required study list. You can find it at http://is.gd/RTkODz.

Now that you have your media uploaded and named appropriately, let’s configure media detection.


Note: A Desktop Scraper for Anyone

Windows users can download the free Media Companion (http://is.gd/qemjHg) to prepare media file metadata from your personal computer. Then when you transfer the media to your XBMC, the files are prescraped!


When you click OK the selected scraper performs a full scan on your content source. If all goes well, you can go back to the Home screen, click TV shows, and access your library to see all sorts of new artwork and bling to accompany your detected media.

For instance, try right-clicking a television show media file and selecting Episode information from the shortcut menu. The results of selecting information for one of my recorded shows is shown in Figure 12.14.

Image

FIGURE 12.14 The ability to provide rich metadata is one of the biggest strengths of XBMC (beyond its ability to play the media, of course!)

Playing Your Content

Let’s finish this chapter with a brief tour of the player controls in XBMC. Using Figure 12.15 as your guide, let me explain some of the controls on the XBMC player’s onscreen display (OSD):

Image

FIGURE 12.15 You can use your remote control to access the XBMC onscreen display (OSD).

1: These playback controls should be self-explanatory to anybody who has operated a DVD player remote.

2: This control enables you to manage subtitles. For more information on how to use subtitle files with XBMC, see http://is.gd/PmFob0.

3: Here you can tweak video settings, including aspect ratio, black bar cropping, and brightness/contrast.

4: Here you can customize audio settings, including delay, subtitles, and so on.

5: Here you can set, go to, and delete bookmarks. This is one of my favorite features!

Installing Add-Ons

XBMC/Raspbmc add-ons are small apps that extend the functionality of your media player software. You’ll find an impressive variety of tools here, giving you the ability to interact with all sorts of cool media, including, but not limited to, the following:

Image Apple iTunes podcasts

Image Break.com and CollegeHumor prank videos

Image Weather and webcams from all around the world

Image News headlines from all around the world

Image Streaming video from a variety of online sources

To install an add-on, navigate to the home page in Raspbmc and hover your mouse over Pictures, Videos, TV Shows, or Music. One of the submenu options is Add-ons; click that.

In the resulting Add-ons window that appears, click Get More.... As shown in Figure 12.16, you’ll be presented with an alphabetical assortment of add-on apps that are related to your selected media type.

Image

FIGURE 12.16 Add-ons can greatly expand the functionality of your XBMC-based media player system.

Once you’ve found an add-on that you like, double-click it in the list and then click Install.

To use your new add-on, return to the Add-ons window we saw earlier. Instead of being empty, you should see your new app in the list; double-click it to get started!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset