Archive for September, 2007

Multimedia in Fedora 7: II – Totem

September 8, 2007

Some introduction words

In previous post we talked a little about the theory behind playing media, now we will finally do the first practical step – we will get multimedia to work in the default multimedia player – totem. Just remember that this how-to is meant primarily for Gnome users, KDE users will use different multimedia player and most likely different libraries.

Despite general opinion, totem can play nearly everything and even though it is meant mainly for playing movies, it can handle music pretty well too. However the default installation can play pretty nothing. Why? Short answer is software patents. The longer one is that due to existence of software patents in the U.S. and their appliance on the most used codecs it is nearly impossible to ship those legally with Fedora. There are pretty good alternatives to those codecs, but these are not so widely spread – vorbis (sometimes called ogg vorbis or, wrongly, ogg) for audio, theora for video and ogg and matroska containers. These work out of box in fedora, but not everything you have is encoded with those. So how get to work the rest?

Software patents?

There’s one question which needs to be answered first. Does your country recognises software patents, or is it software patents free? If it has software patents you are in quite a bad position. The only legal way for you is to buy the codecs from the fluendo company. Thanks to them you can legally use most of the codecs in Linux as well. You can buy them at their web shop. One good thing is, that mp3′s are free (as in beer). Somewhat questionable is libdvdcss library for playing DVDs encrypted with CSS (most of those you buy in a shop). If you are sure it’s legal for you to use it, you will find a description how to get it in some of the next paragraphs.

GStreamer solution

If you come from the lucky countries where software patents does not legally exist you have a choice of using free codecs (both as in beer and as in freedom). Totem’s default engine used for playing videos and music is gstreamer and it also provides plug-ins with which you can play nearly everything. They can be installed from the livna software repository. WARNING!!!! If you use freshrpms don’t mix it with livna, it causes a lot of problems. All the packages I’ll be talking about are available in freshrpms too, but their names might slightly differ.

To install the livna software repository, download the livna-release package and install it. You can do that in terminal via rpm (rpm -Uhv /path/to/livna-release-7.rpm), where the ‘/path/to’ stands for the location you downloaded the package to. Alternative solution is to open the package with ‘Software Installer’. It should be available as a choice if you right-click on the downloaded package in nautilus. Next thing is to install all the packages you might need. So first, we will need to install packages with codecs.

So, open terminal and do the following two commands:

su -
yum -y install gstreamer-plugins-ugly \
gstreamer-plugins-bad gstreamer-ffmpeg

It will install all the needed packages (note that you’ll need to be connected to internet in order to download and install them with this easy way) and you can start playing your favourite songs and movies in totem. You’ll find it at Applications -> Sound & Video -> Movie Player.

Xine-lib solution

An alternative solution is to use xine-lib as backend to totem. You’ll need to uninstall totem first:

yum remove totem totem-mozplugin totem-plparser \
totem-devel

Be sure to write down all the packages that will be uninstalled as a dependency so that you can install them back after you install the xine based totem. Next step is to install the xine library and plug-ins that enable its support for the patented codecs. You should also install the libraries for playing DVDs. You will do that with simple yum command (you’ll again need the livna repository):

su -
yum -y install xine-lib-extras-nonfree xine-lib-extras

Next step is to install the xine based totem:

su -
yum -y install totem-xine-plparser totem-xine

More support, similar for all solutions

In order to play DVD video you’ll need some more packages. You can install them with a simple yum command, but note that the legality of use of libdvdcss is somewhat questionable so if you are not sure it is legal in your country to use it, omit it from the list. Here are the commands:

su -
yum -y install libdvdplay libdvdnav libdvdread libdvdcss

Last, optional, step is to enable the plug-in for gecko based browsers that totem provides. If you installed the xine based version, substitute totem-xine-mozplugin instead of totem-mozplugin. So this is the yum command for gstreamer based totem:

su -
yum -y install totem-mozplugin

and for xine based totem:

su -
yum -y install totem-xine-mozplugin

Some ‘final’ words

And the only thing left is to enjoy the media :-)

Today we described how to play media with the Fedora default Gnome Media Player, next time we’ll focus on playing and organising music, with all the stuff we like – id3v2 tag, mp3, flac, ogg vorbis and Linux music players.


Follow

Get every new post delivered to your Inbox.