RHEL for the Clueless: Multimedia Capability (Updated)

RHEL (and clones) does not come with very much multimedia capability. It has to do with politics, copyrights, and philosophical debates. Even if we tried to outline all the issues here, chances are quite good you don’t care a whit. You want to play your music and videos, and there is no good reason you shouldn’t. There are plenty of Linux developers willing to join you in seeking to play what Windows can play, and a lot more besides, but Red Hat is being careful and sticking to their commitment to the corporate client base.

About the only thing which already works well is the audio CD player, Rhythmbox. So it’s up to you to connect your RHEL box with all the other Open Source multimedia capability. Some of those Linux developers have made it quite easy. There are several projects to provide all those goodies specifically in a form which hides from you the gory details, and there’s no reason we can’t take advantage of their work.

In the previous lesson we installed a package, software bundled into a format which could be installed as a single item. Specifically, it was an RPM, an abbreviation for “RedHat Package Management.” Other Linux distributions have begun using it over the years since Redhat developers came up with it, so we have to make sure we get the right RPMs. Then we have to make sure they were compiled specifically for the version of Red Hat operating system we are using, because critical parts of the underlying system progress like everything else.

These third party projects do just that, creating their packages to match your specific version of RHEL. Some of them even automate the whole system so you don’t even have to worry about matching the packages with all the various dependency libraries. We call this a “repository” or “repo.” We do have to be careful, though, because the repos vary in quality, and from one release to the next. In my series on RHEL 5, I promoted RPMForge. As long as you are running RHEL (or CentOS or SL) 5.x, it is still one of the best choices. However, for RHEL 6, it seems some of the same old versions of the software from RHEL 5 are being used for 6, and in many cases, that makes a big difference. That is, you may get something stable and reliable, but with reduced functionality. Either way, as of this writing, RPMForge had not quite gotten all their RHEL 6 packages ready.

There are several others. For example, EPEL, which is also not yet up to date on RHEL 6. Honestly, I’ve had some trouble with a few of their packages on RHEL 5. I don’t trust them quite yet. There’s RPMFusion, but they don’t have any RHEL 6 packages yet. And there are more I don’t know about, but the one which seems ready and reliable right now is ATrpms. If you need a full range of media player capability right now, that’s where I would start.

First, you have to learn something about that commandline business. In your Application menu, go down to System Tools and select “Terminal”. It should open a window, probably with a white background and flashing cursor with a commandline prompt. You need to turn this into a root terminal, with administrator credentials. So type in the following command:

su root

and hit ENTER. It should come back waiting for you to enter the root password. Type it blindly, because it won’t show. That’s a standard security measure you should recognize already. You really should learn how to type the root password blindly. Once you have it, hit ENTER and wait for it to change the prompt to something different, indicating you have taken on the identity of root.

Then type this command… wait. It would be a whole lot simpler if you learned to use the Unix mouse paste method (Linux is a type of Unix). Drag your mouse across the text of the following command. You don’t have to do anything else, just drag your mouse across it until the text of the command by itself is highlighted. Don’t worry about the line breaks, your browser will tell the mouse it’s all one line:

rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms

Then move your mouse to the Terminal window where root is logged in. Place the mouse pointer inside the background space of this window, and press the middle mouse button. If you have some ancient two-button mouse, then try to push those two simultaneously (works with trackpads, too). Either way, it should simply paste that text onto the commandline. Hit the enter key and watch it work. Okay, it usually comes back without saying anything. In typical Unix fashion, no news is good news — it executed the command with no errors.

Now, in your browser, I want you go to this page. It’s a list of packages available for RHEL 6, but you need to scan down the alphabetical list for the one labeled “atrpms-repo”. Click the link and download the package. As with BleachBit yesterday, install that package from the download list in Firefox by double-clicking. You’ll need to use your root credentials as always.

Next, go back to your Terminal window and type or copy-n-paste the following command:

yum update

That package installed some instructions for Yum. That’s a cutesy name for yet another part of the package management system. You may recall I mentioned in a previous lesson how, if you didn’t get an update reminder shortly after installing RHEL, we need to wake it up. It’s rare you’ll need to do that, but that command you just entered should do that — scan for updated packages — as well as tell Yum to scan the packages listed at ATrpms, too. If it comes back with a long list of stuff it wants to install, his “y” and wait until it’s finished. If all is working as it should, you’ll see it come back with no error reports, though it may offer a bit of information indicating what it did above that. If you see anything about a warning you need to reboot, do that and come back here to finish this.

Now we need to add that multimedia capability. We need a media player, and some software which allows us to play DVDs and other media formats. We could discuss all day which one is best, but I’m going to tell you, right now the one which works best from ATrpms is called Xine. I tried the famous MPlayer, and it has a bug which won’t let it open properly the GUI controls on some systems. It works, but you can only do it from the commandline. You probably aren’t ready for that yet. (Update: This had been fixed, and Mplayer is probably easier to use, so go with that.) Here is what I want you to run as your next command to get Xine and some other goodies we will learn how to use later, so mouse paste this as one command:

yum install ffmpeg libdvdcss libdvdread libdvdnav libdvdplay lsdvd mplayer xine-ui

Almost certainly Yum will analyze this command and wind up installing a bunch of other stuff, but that’s part of Yum’s job — taking care of dependencies. It will ask you if you are sure, and you’ll need to hit “y” and ENTER. Watch Yum do it’s work, and eventually it should come back without complaint, announcing enthusiastically the job is done. At least, you should try to imagine what you see as enthusiasm, insofar as you can get it on the commandline.

In a few moments, you’ll have some changes in your Applications menu, with Xine showing up under “Sound and Video” (Mplayer shows up as “Movie Player” with the Mplayer icon). I admit it not as slick as Windows Media Player, but it works on more stuff and there is no digital rights management to get in your way. But not yet. We need one more package from yet another source: codecs.

Go here. The good folks at MPlayer HQ in Hungary have developed a collection of codecs designed to handle just about anything Windows can handle, since Xine already handles stuff WMP can’t. On that page, listed near the top, is a selection of links to packages named “all-xxxxxx” with some numbers indicating the date they were bundled together; the format is yyyymmdd. That’s four digits for the year, two for the month, and two for the day of that month. Get the latest date you can find, with the file name ending in “bz2”.

You can’t install this the way you did before, because it’s not an RPM. Rather, when you double-click, you’ll get the Archive Manager, which acts like a lot of zip managers. You’ll see a window open showing the name of what is inside the zipped file, in this case a folder with the name all-xxxxxxx. Click the “Extract” button and it will ask you where you want it, by default right where it is inside another folder. It will show you a view of your “Downloads” directory in your user account Home file system. Just click the “Extract” button on the lower right side. It will work on this for a moment, then give you back the first window. No news is good news. Now you have this big folder of stuff in your Downloads, and only root can put it where it belongs.

This is the toughest part of the whole thing. There are no easy tools for using root credentials with your graphical file manager window. The only way I know to do this in your current situation is using that Terminal window. First, we create the folder for where the codecs go:

mkdir /usr/lib/codecs

(Unix uses forward slashes, the original standard before there was DOS. Microsoft just had to change to backward slashes.)

Then we need to move root down into that collection of codecs you just unzipped. Chances are, root has been working from your user account Home directory. Just to make sure, type the command pwd — an abbreviation for “print working directory.” It should come back with something like: /home/username, though I doubt your use account is named “username”. Just substitute your username. From here on out, just remember to do that. And if you don’t see anything like that, try cd /home/username.

Also, you don’t have to type out every last letter in the name of something in your file system, any more than you would in Windows when using the Command Prompt window. Just type the first few characters, enough to distinguish from everything else there, and hit the TAB key. The system can guess it from there. So type this:

cd Downloads/all-

and hit the TAB key. It should finish it out so you can hit the ENTER key. Now, type the command ls (same as “dir” in DOS) and see a list in several columns, which starts with this:

acelpdec.ax
alf2cd.acm
aslcodec_dshow.dll

You are in the right place. We need to move all these to their proper location, so do this:

mv ./* /usr/lib/codecs/

If you type ls again, you should see nothing listed. If you type ls /usr/lib/codecs you should see that long list of files again. Tada! You now have codecs in the right place. Purists will tell us we left out a few details, but I’m betting for now it will be okay, and Xine will play your stuff. We can fix the nitpicking later. Just open Xine from the menu. If you have a video CD or DVD in the tray, just select what’s appropriate from the control module; you’ll find it in the context menu by right-clicking. If it’s a file on one of your drives you wish to play, it’s in the same context menu. (Mplayer handles all this from the right-click context menu.)

But we aren’t done. You still want Flashplayer? There is an Open Source version and it still stinks. Maybe some day… But right now you will have to get it from the owners, Adobe. Not long ago, Adobe realized how nice it would be if they got competitive before that Open Source flashplayer got useful, so they have created a repo for RHEL. In your browser, go here and select from the drop-down “yum for Linux”. Install this from your download window as before. Then run that “yum update” again and you should see an indicator of adding Adobe. Then run this:

yum search flash

That’s to show you how to ask Yum if it knows about a certain kind of package, either by name or by something in the basic description, such as what the package does or provides. If you had typed the longer “flashplayer” it might not find anything useful. Yum is limited. In this case, you should see a listing which includes this:

flash-plugin.i386 : Adobe Flash Player 10.1

That’s the one you want. But it won’t work to give Yum all that information. Just use this:

yum install flash-plugin

Notice what part of the package title I used. It should install without any hitch. And if you really must have the official Adobe Acrobat Reader, you can get that, too. Ask Yum to search for “pdf” — the file format used by Acrobat — and you’ll get a long list of software names. In fact, you should already have a PDF viewer, called Evince. It’s a lot faster, and doesn’t phone home like Adobe’s Reader. It is also lacking a few fancy features. I don’t like Acrobat, but if you like it and need it, you now have some idea how to get it.

Whatever you choose, you’ll need to restart Firefox for it register the presence of Flashplayer and/or Adobe Reader. Also, remember to log out of your root session in the Terminal, using the simple command exit.

Update: March, 2012 — Recent issue with updating ffmpeg from ATrpms. When you try to update via Yum, or via the Update Manager (that bright orange icon in the notification area), you’ll get an error something like this:

Error: Package: libavcodec53-0.10-54.el6.i686 (atrpms)
Requires: libvpx.so.1()
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

Here is the simplest and quickest solution; just copy and paste as a single line into any terminal window:

yum update libvpx - --enablerepo=atrpms-testing --disableplugin=*

Yes, this will change one of the core libraries from the upstream provider (RHEL). It shouldn’t break anything, but it could. You be the judge; it’s part of the risk of using any external Yum repo.

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.