Linux Multimedia

by Sander van Vugt

One of the greatest challenges, if you are working with Linux, is to fulfill all your multimedia needs. In this article we explore some of the available possibilities, using Red Hat version 7.2. Only the first two CDs were installed because the third CD only contains commercial software, and we don't want to use anything commercial, only openly available software.

Music

Generally, there are two kinds of music one can listen to on a computer. There's the CD you buy in a store, and there's the MP3, which can be downloaded from the Net. Let's start with the first and put a CD by the woman who is also known as "la guitara" in the drive. You would think you could put the CD in the drive, activate the CD player from the "Multimedia" menu item and it would work, but it isn't always that easy. On our first try, the system was mute. In such cases one should use the Red Hat-based tool sndconfig. This tool tries to find out which kind of sound card you are using. Alas, we had a card from Avance Logic with an ALS4000 audio chipset, which isn't supported. In this case, you could go out and buy a different card or try another Linux distribution. So, we tried SuSE Linux. SuSE has a very nice graphical tool to configure the sound card included in its YaST2 configuration tool, and yes, this time it worked. The card was recognized without any problem. Before you can listen to a CD with SuSE Linux, you need to open the Sound Mixer and switch on the CD as a sound source (which is not done automatically). Once that's done, you can use the CD player to listen to music. No big deal.

Listening to some MP3s is not a big challenge. All you have to do is find some MP3s on the Net and launch the KDE Media Player. In the media player, activate the File menu, select Open and play the MP3; that's all.

Video

Now that we've got sound working, which isn't very complicated if you use the right distribution, let's go on to the next step: the movies. Generally, there are three different kinds of movie files available. First, there are MPEG-1 files. There should not be any problem playing these because there is no proprietary compression program/decoder (codec) needed. This means you can just play the file on any player.

Besides these generally available MPEG files, there are AVI files. Most of the time, these are files that are coded and compressed by means of a proprietary codec. This means that if you want to play them, you need the right proprietary codec. This can be a real challenge because these codecs almost always are developed for the Microsoft Windows platform and not for Linux. So in fact, there are two problems if you wish to play any of these files. First you have to get the right codec, and second, you need a Linux program that is able to handle the codecs, which are developed for the Microsoft platform.

Apart from this, there's also a legal issue. Many of these files are compressed and encoded by means of the MPEG layer 4 codec, which is illegally ripped and used anyway. This codec is also known as the DivX codec, and the problem with it is that it isn't even legal to have it on your PC. Most PC users don't really care about that, but it does mean that it can be hard to find the right codec for a DivX-encoded file. If you try to watch these kind of files with the KDE Media Player we mentioned before, you won't see anything if you try to open it.

Figure 1. AVI is not among supported files in many players.

So, we have to try something else. One of the best things you can try in these cases, is Xine, which can be downloaded from xine.sourceforge.net. You will need two parts to be able to use Xine. One is the file with the necessary libraries in it and the other is a file that contains the binaries. The right procedure is to download the libraries first, compile them and once you've done that, go over to the ui-files. After downloading the files, compile and install them. Then go to the source directory, which was created while extracting the files, and give the following commands:

./configure
make
make install
make clean

First do this for the Xine libraries, then download the Xine ui-files and perform the same procedure on them. Chances are that you will get a nice error message while trying to configure the Xine ui. This could be because the installer couldn't find the Xine libraries. This is no problem. Just open /etc/ld.so.conf, add the location of your newly installed libraries (of course you didn't install them in /root/xine-lib-n.n.n did you?), save the file and run ldconfig to let your system know about this location. After that, you shouldn't have any more trouble running ./configure on the Xine ui-files.

Now that everything is configured and compiled, start it up by running the command xine. This starts a window and a panel like that of a CD player.

Figure 2. The Not-So-Intuitive Xine Panel

Now, in the Xine panel, click on the button with "://" on it in order to browse your filesystem. Browse to the file you want to play and when you find it, click on it once and select the Play button. The system should start playing your movie file now.

Figure 3. Playing an AVI File in Xine

Now the big question is, how does it work? Because most codecs are written to run on Windows exclusively, Xine looks for them in the directory /usr/lib/win32. So if you ever get a new Windows codec, put it there and you also will be able to use it in Xine.

DVDs

The last type of movie media you might want to enjoy is the DVD. However, the Hollywood movie industry didn't want to make it too easy to make copies of DVDs, so all their movies on DVD are encrypted by some kind of encoding mechanism. To perform this goal, the Content Scrambling System (CSS) was used. The software needed to decode these encrypted DVDs was sold to vendors of DVD players, for quite a lot of money. In the world of open source, no one wants to pay a lot of money to watch encoded DVDs. There are three possible solutions in the Linux world. The first solution is the software DVD player that only plays unencrypted DVDs. This is a perfectly legal solution, but the problem is that only a very small number of DVDs are not encoded, so not many people are really interested in this level of functionality. The second solution is the DVD player that uses illegally obtained software to decode the DVDs. It doesn't take a scientific degree to find out that this option has its own specific problems. The last solution is to wait for one of the big commercial manufacturers of DVD players to come out with a Linux DVD player.

So, the best way to test what kind of player Xine is, is to put in my homemade holiday-movie DVD and play it. Does it work? No problem at all. The next step is to try to play my favorite movie, Entrapment. Alas, in the background a message appears:

input_dvd: Sorry, Xine doesn't play encrypted DVDs. The legal status of CSS decryption is unclear and we will not provide such code.

Xine could do it, but due to legal restrictions, the makers of Xine are not willing to do it, which seems to make the use of any open-source DVD player in Linux very limited. What about the commercial DVD players? There is LinDVD from InterVideo, Inc. (www.intervideo.com), but this player is only available to manufacturers for evaluation and integration, so that's not an option. The same goes for CyberLink's PowerDVD, which exists but is only available to IA developers. So even commercial DVD players do not offer a solution.

The last options are the initiatives to provide a plugin for open-source software like Xine. As mentioned before, the big problem with this option is that it's illegal. At this time, the DVD-Copy Control Association and movie studio members of the MPAA have filed lawsuits to stop the development of independent players for DVDs. They say that decrypting the Content Scrambling System (CSS) encryption without a DVD-CCA licensed player violates their trade secrets and the Digital Millennium Copyright Act, so you might have a hard time finding a player that plays CSS-encrypted DVDs on Linux. To do it anyway, you need a plugin like the libdvdcss plugin and a player that can work with it. From our experience, it seems that such players don't work on SuSE, but they do work on Red Hat. At gape.ist.utl.pt/ment00/linuxdvd.html we found a tarball named complete_xine_0.4.3.tar.gz, which contains a complete version of our favorite player Xine--complete in this case meaning including the CSS snapin. So we tried; we configured; we made and we made installed and guess what? It works on Red Hat but not on SuSE. We quickly destroyed all the files from our system after we proved that it worked. We don't want to do anything illegal now do we? Let's be honest, isn't it fair to the producers of the DVD if you legally buy a DVD and legally buy a DVD player, that you can choose the operating system you like the most to watch it?

Figure 4. Watching CSS-encoded DVDs: also in Linux

Sander van Vugt lives in the Netherlands. He works for Azlan Training as a Linux, Novell and Nortel technical trainer and has written several books and articles about Linux.

Load Disqus comments