LDP/LDP/howto/docbook/Fedora-Multimedia-Installat...

620 lines
25 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY howto "http://tldp.org/HOWTO/">
<!ENTITY mini-howto "http://tldp.org/HOWTO/mini/">
<!ENTITY home "http://www.catb.org/~esr/">
<!ENTITY fcv "3">
]>
<article id="index">
<articleinfo>
<title>Fedora Multimedia Installation HOWTO</title>
<author>
<firstname>Eric</firstname>
<othername>Steven</othername>
<surname>Raymond</surname>
<affiliation>
<orgname><ulink url="&home;">Thyrsus Enterprises</ulink></orgname>
</affiliation>
</author>
<revhistory id="revhistory">
<revision>
<revnumber>5.1</revnumber>
<date>2006-03-25</date>
<authorinitials>esr</authorinitials>
<revremark>
Simplified and corrected some FC5 instructions.
</revremark>
</revision>
<revision>
<revnumber>5.0</revnumber>
<date>2006-03-21</date>
<authorinitials>esr</authorinitials>
<revremark>
Update for Fedora Core 5. On the one hand, we can get almost
everything from livna now, which simplifies life. On the other
hand, Totem and Xine are both completely broken.
</revremark>
</revision>
<revision>
<revnumber>4.0</revnumber>
<date>2005-10-09</date>
<authorinitials>esr</authorinitials>
<revremark>
Update for Fedora Core 4. The fedora.us repositories have become
Fedora Extras. Adobe Acrobat plugin no longer seems to be
necessary, xpdf and evince must have gotten better.
</revremark>
</revision>
<revision>
<revnumber>3.0</revnumber>
<date>2004-11-07</date>
<authorinitials>esr</authorinitials>
<revremark>
Update for Fedora Core 3.
</revremark>
</revision>
<revision>
<revnumber>2.2</revnumber>
<date>2004-09-07</date>
<authorinitials>esr</authorinitials>
<revremark>
Corrections for 2.6.8 kernel and Mozilla 1.7.
</revremark>
</revision>
<revision>
<revnumber>2.1</revnumber>
<date>2004-08-03</date>
<authorinitials>esr</authorinitials>
<revremark>
RealPlayer 10 is out in open source. This changes some things.
</revremark>
</revision>
<revision>
<revnumber>2.0</revnumber>
<date>2004-07-14</date>
<authorinitials>esr</authorinitials>
<revremark>
Updated for FC2. Removed up2date methods, as FC2 update seems
to be broken.
</revremark>
</revision>
<revision>
<revnumber>1.2</revnumber>
<date>2004-02-03</date>
<authorinitials>esr</authorinitials>
<revremark>
Typo fixes.
</revremark>
</revision>
<revision>
<revnumber>1.1</revnumber>
<date>2004-01-31</date>
<authorinitials>esr</authorinitials>
<revremark>
Dag Wieers's repository is yum-enabled, so drop apt-get out
of the picture. Add mozilla-acroread installation. Add some
attack-lawyer repellant.
</revremark>
</revision>
<revision>
<revnumber>1.0</revnumber>
<date>2004-01-30</date>
<authorinitials>esr</authorinitials>
<revremark>
Initial release.
</revremark>
</revision>
</revhistory>
<abstract>
<para>How to get various proprietary and restricted multimedia Damned
Things (AVI, Flash, Java, MP3, MPEG, QuickTime, RealMedia,
Windows Media) working under Fedora Core using your normal package-management
tools. Includes Firefox-plugin instructions. Now with coverage of both
32- and 64-bit Intel-architecture systems.</para>
<para>Unfortunately, the news in FC5 is almost all bad. Totem and Xine
are both completely broken.</para>
</abstract>
</articleinfo>
<sect1 id="introduction"><title>Introduction</title>
<para>There are some Damned Things like enabling Java and Flash in Mozilla,
playing MP3 files, playing Quicktime/AVI/RealMedia/Windows Media streams,
and playing encrypted DVDs that the Fedora distro folks won't tell you how
to do, either because they're afraid of being sued under the DMCA or for
various other esthetic and political reasons.</para>
<para>This HOWTO collects the relevant information in one place. It is not
a general multimedia-on-Linux HOWTO; if it were, there are hundreds of
nifty tools and packages it would list (starting with the GIMP and all its
kindred and forks and symbiotes). The packages we'll cover here are just the
legal and political hot potatoes, the stuff that threatens monopolies and
worries lawyers.</para>
<para>Good background information on souping up your Fedora system can also
be found at the <ulink url="http://fedoranews.org/">FedoraNEWS</ulink>
website and the <ulink url='http://www.fedorafaq.org/'>Unofficial Fedora
FAQ</ulink>. One assumption that distinguishes this document from these
other sources is that you are as lazy as I am &mdash; you want to install
your Damned Things (and, later, update them) with your normal
package-management toolswith an absolute minimum of going to special sites,
download source tarballs, or executing unique build procedures.</para>
<para>Legal note: No source code or locations of source code of any
software alleged to be covered by the DMCA is disclosed on this page, you
will have to look on my personal website for that. The DMCA is a bad law
rammed down our throats by fools and villains and the use of it to
suppress free speech about software is a disgrace, but in order to ensure that
this HOWTO gets maximum distribution I have remained in compliance with it
here.</para>
<para>One reason I am doing this is that I believe I'm a harder target for
the attack lawyers than most hackers; public fame and a reputation for
truth-telling are helpful here. If you are an attack lawyer, be warned
that I invariably respond to attempts at intimidation by fighting back,
that I am legally savvy and <emphasis>very</emphasis> good at working the
press, and that I <emphasis>will</emphasis> exert all my considerable
ability to make your and your client's name a public disgrace if you try to
suppress my speech. You have been warned.</para>
<sect2 id="newversions"><title>New versions of this document</title>
<para>You can also view the latest version of this HOWTO on the World Wide
Web via the URL <ulink url="&howto;Fedora-Multimedia-Installation-HOWTO/">
&howto;Fedora-Multimedia-Installation-HOWTO.html</ulink>.</para>
<para>Feel free to mail any comments about this HOWTO, or additions or bug
fixes, to Eric S. Raymond, <email>esr@snark.thyrsus.com</email>. But please
don't ask me to troubleshoot your multimedia or plugin configuration
problems; if you do, I'll just ignore you. Everything I know about this
subject is already here.</para>
</sect2>
</sect1>
<sect1><title>Packages, Tools and Repositories</title>
<para>Modern Linuxes are rapidly moving towards a world in which physical
media are used for OS installation only, with updates being fetched and
installed by tools querying Internet repositories. You'll need to know a
bit about some of these tools and the repositories they get binary packages
from.</para>
<para>Fedora packages are called RPMs. Each can be installed or uninstalled
as a unit, and provides some application together with any support files it
needs. Some packages depend on others &mdash; an application, for example,
may require specific support libraries. Part of the job a package
installation program does is to chase down those dependencies and install
them before installing the main package.</para>
<para>Unfortunately, RPMs can clash with each other &mdash; for example, by
wanting to put incompatible versions of a command or support file in place.
A repository maintainer's main job is to make sure that (a) the RPMs in his
collection don't clash with each other, and (b) all their dependencies are
resolved either within his repository or some 'base' repository that he
advertises depending on.</para>
<para>There is one base repository for Fedora Linux maintained by the
Fedora project itself, and about half a dozen extension repositories that
depend on that base. These extension or "third-party" repositories are
where you will get your Damned Things; they are run by volunteers
independent of the Fedora Project, often located in places outside the
U.S. where they will be less exposed to predatory lawyers.</para>
<para>The extension repositories form cliques defined by who is compatible
with who else. There is a lot of turbulence and politics around these
cliques which, as an end user, you can largely ignore. The only reason
for you to know about this at all is that you have to choose one clique
in order to avoid clashes. In early 2006 there are, essentially, three
cliques to choose from, as I'll describe later on.</para>
<para>First I need to introduce you to the tools you will need to fetch
your Damned Things:</para>
<variablelist>
<varlistentry>
<term>yum</term>
<listitem><para>yum (the Yellow Dog Updater, Modified), is a command-line
tool that comes installed
with Fedora Core. It will help you download updates from the Fedora
repository, and from other repositories that carry Damned Things that
Fedora won't.</para></listitem>
</varlistentry>
<varlistentry>
<term>pirut</term>
<listitem><para>This is a GUI wrapper around yum introduced in FC5. It's a
slightly kinder, gentler way to use yum.</para></listitem>
</varlistentry>
</variablelist>
<para>You also need to know about some repositories. Each is a collection
of RPMs, divided into subcollections called 'channels'. </para>
<variablelist>
<varlistentry>
<term><ulink url="http://fedora.redhat.com">fedora.redhat.com</ulink></term>
<listitem><para>This is the basic Fedora repository. The RPMs in the
'stable' and 'updates' channels of this repo are what go on a Fedora
CD-ROM. Historical note for readers of previous version of this document:
the Red Hat repo now includes, in its 'extras' part, equivalents of the
stuff that used to be at fedora.us.</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="http://rpmforge.net/">RPMForge</ulink></term>
<listitem><para>A clique formed by all the major third-party RPM sites
except livna and ATrpms. These packages are intended to extend the Fedora
Core and Extras repositories, and the maintainers are careful not to clash
with the Fedora repositories. The consortium includes freshrpms, Dag
Wieers's repository, the Dries repository, NewRPMs and PlanetCCRMA.
They're working towards merging their repositories, and already build with
common source RPMS. Unfortunately, the RPMForge collection is known to
have some serious clashes with livna and ATRPMs.</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="http://rpm.livna.org">rpm.livna.org</ulink></term>
<listitem><para>A site, located outside the U.S. and beyond the reach of
the DMCA, that specifically dedicated to providing Damned Things that
Fedora Core and Extras won't carry. There is no official connection, and
in fact the Fedora people won't mention livna in their web pages or
documentation for fear of being slammed with a speech-suppressing lawsuit
by the evil scumweasels at the DVDCCA, but the livna people track what
Fedora does very closely. The livna repositories depend on the Fedora
repositories. They clash with the RPMForge repositories.</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink
url="http://macromedia.mplug.org/">http://macromedia.mplug.org/</ulink></term>
<listitem><para>The main source for packaged versions of Macromedia
Flash. It's safe to use this RPM with any of the extension-repository
cliques.</para></listitem>
</varlistentry>
</variablelist>
<para>The three cliques I referred to earlier are RPMForge, livna (all by
itself) and ATrpms (all by itself). With FC5 you can get all the
multimedia support you theoretically need from livna, rather than using
RPMforge as I advised in previous versions of this FAQ. I say
'theoretically' because, in fact, almost none of the video stuff actually
works in FC5.</para>
<para>To enable access to livna, do this:</para>
<programlisting>
rpm -ivh http://rpm.livna.org/livna-release-5.rpm
</programlisting>
<para>This should drop a yum repo configuration file in
<filename>/etc/yum.repos.d/</filename></para>
</sect1>
<sect1><title>Security considerations and other risks</title>
<para>All the yum commands I give in this HOWTO have to be run from the
root prompt so the packages they fetch can be installed in your system
space. This means there is a risk that your system could be compromised by
a Trojan Horse RPM, either one inserted in one of the repositories you
query or one slipped to you by a man-in-the-middle attack getting between
you and a repository.</para>
<para>To control the latter risk, many repositories cryptographically sign
their RPMs. You need to have a local copy of each repository's public key
in order to integrity-check incoming packages; current versions of yum will
dowmload one for you. This could be defeated by a man-in-the-middle attack
spoofing the repo site and slipping you bogus keys as you set up your
configuration; while this possibility is extremely unlikely, you should be
aware of it.</para>
<para>A long-term risk that you accept by using the proprietary code
referenced in this HOWTO is that of becoming dependent on the whims of a
proprietary software vendor. It isn't necessary to have that old-time Free
Software religion to see that this is a problem. Some of the software
we'll cover here (the Sun Java JDK plugin is a good example) is
distributed as closed-source freeware &mdash; which is all very well, but
what happens if the vendor changes its mind in the future? You could be
stranded.</para>
<para>It's unsafe to be dependent on proprietary software and proprietary
formats. When you allow yourself to be dependent, you also harm others by
helping vendors maintain an unhealthy monopoly lock on their market
segment. So, if you must buy into these tools, please find some way to
support open-source replacements &mdash; donate coding time or cash, or
spend effort pressuring vendors to open up. Rip your CDs to Ogg Vorbis
rather than MP3. Write a letter to your legislator urging repeal of the
DMCA. The freedom you save <emphasis>will</emphasis> be your own.</para>
</sect1>
<sect1><title>Macromedia Flash</title>
<para>Fedora won't distribute from their site because Macromedia's license
doesn't permit it, but there are no other legal barriers to using the RPMs
at <ulink
url="http://macromedia.mplug.org/">http://macromedia.mplug.org/</ulink>.</para>
<para>Follow those directions, dropping the Macromedia repository
configuration in your <filename>/etc/yum.repos.d/</filename> directory.
It should look much like this:</para>
<programlisting>
[macromedia]
name=Macromedia for i386 Linux
baseurl=http://macromedia.mplug.org/rpm/
enabled=1
gpgcheck=1
gpgkey=http://macromedia.mplug.org/FEDORA-GPG-KEY
</programlisting>
<para>Then do the installation:</para>
<programlisting>
yum install flash-plugin
</programlisting>
<para>Installing this RPM should put the plugin in your Firefox
plugin directories (and Mozilla's as well).</para>
<para>You can test your flash support at the
<ulink url='http://www.macromedia.com/shockwave/welcome/'>official test
page</ulink>. Note that you may have to kill and restart your browser
after installing the plugin; I tried the Flash test immediately
and it crashed Firefox.</para>
<para>There's a gotcha: The Macromedia plugin works only for 32-bit Intel
boxes. It completely fails on an x86_64 running in 64-bit mode (in
general, 32-bit plugins won't work in a 64-bit browser). Currently
there are three projects addressung this problem:</para>
<itemizedlist>
<listitem>
<para><ulink url='http://gplflash.sourceforge.net/'>gplflash1</ulink> is the
orignal GPL Flash plugin. Only handles SWF up to level 4.</para>
</listitem>
<listitem>
<para><ulink url='http://gplflash.sourceforge.net/'>gplflash2</ulink>
half-works, with painful amounts of flicker, and frequently crashes
Firefox. This rewrite of gplflash has been abandoned in favor of
gnash.</para>
</listitem>
<listitem>
<para><ulink url='http://www.gnu.org/software/gnash/'>gnash</ulink>
promises full support for SWF up to level 7, but is still in early
development and surrounded by warnings.</para>
</listitem>
</itemizedlist>
<para>I think the right stopgap on 64-bit systems might be to build and
install gplflash1, but as of 21 Mar 2006 I can't because it needs
an X header file I cannot yet find the right RPM for. This may
change as the dust settles around FC5.</para>
</sect1>
<sect1><title>gstreamer and ffmpeg support</title>
<para>FC5 has adopted a project called gstreamer as a common back end for
handling video and audio files. Totem, the standalone multimedia player
shipped with FC5, uses gstreamer; so does your Firefox plugin,
mozplugger.</para>
<para>gstreamer itself uses plugins, one for each multimedia format
it supports. Plugins for open-source formats such as Ogg Vorbis
ship with FC5. Plugins for proprietary formats don't. To get these,
do this:</para>
<programlisting>
yum install gstreamer-plugins-ugly ffmpeg
</programlisting>
<para>This may also install mpeg2dec, libsidplay, libdvdread, faac, faad2,
imlib, and gsm.</para>
<para>The 'ugly' plugins enable gstreamer to handle MP3, MPEG2,
and SID formats. The SID format is a historical relic from the Commodore
64. MP3 is the most popular audio format. MPEG2 is an audio/video format
used in DVDs.</para>
<para>The ffmpeg library can encode or decode MPEG1 audio and video, MPEG4,
h263, ac3, asf, avi, real, mjpeg, and flash.</para>
</sect1>
<sect1><title>MP3</title>
<para>Fedora won't ship MP3-capable software because the Fraunhofer
Institute's patent license terms are not compatible with the GPL.</para>
<para>The default music player in FC5 is Rhythmbox. I struggled with
Rhythmbox for several hours, but despite its pretty face I found it
unusable. It ignores track numbers &mdash; or, at least, is not as smart
at parsing them out of filenames as xmms is, and doesn't document its
import rules anywhere. Trying to beat it into playing MP3s is a nightmare
so scarifying that at one point I thought I was going to have to reinstall
my entire Linux system just to get the ability to play Oggs back, because I
couldn't figure out what piece of undocumented application state had gotten
scrambled or how to clear it. The documentation is in general a bad joke
&mdash; glossy, superficial, and with no useful content about
troubleshooting problems. The xmms player may not be as featureful or as
nice-looking, but it works better.</para>
<para>To install xmms and make it MP3-capable, start by doing this:</para>
<programlisting>
yum install xmms xmms-mp3
</programlisting>
<para>To actually enable MP3 playing, you'll need to run xmms and change
its configuration. Select Options &rarr; Preferences &rarr; Audio I/O
Plugins from the menu; this will pop up a window listing plugins. Select
"MPEG Layer 1/2/3 Placeholder Plugin" and uncheck [ ] Enable Plugin. With
this placeholder gone, xmms will plug in xmms-mp3 automatically. Kill xmms
and restart.</para>
<para>On my x86_64 box I encountered the problem that xmms would only play
sound as root, exiting immediately when run from a non-root account.
There are a number of mundane causes for this; check the permissions on
your sound devices. There is one <ulink
url='http://lists.xmms.org/pipermail/xmms-devel/2000-January/001083.html'>exotic
problem</ulink> which I tripped over; you may have to tell your sound
module to grab low-memory DMA buffers and not let go of them.</para>
<para>To enable MP3 streaming through Firefox or Mozilla, install the
gstreamer-ugly plugin and ffmpeg as described below. MP3 streams will
play through xmms, podcasts through Totem.</para>
</sect1>
<sect1><title>Java</title>
<para>Java is downloadable and redistributable from Sun, but only for
personal and not-for-profit use. Sun's Java license is non-open-source,
so Fedora and most other Linux distributions won't carry it.</para>
<para>Fedora Core 5 includes an open-source Java implementation for
programmers called gcj. You only need to take special action if you want
to enable applets in your browser. The Unofficial Fedora FAQ has <ulink
url='http://www.fedorafaq.org/#java'>detailed instructions</ulink> on how
to do this.</para>
<para>You can test your Java plugin at Sun's <ulink
url="http://www.java.sun.com/applets/">Applets</ulink> page. Note that
some of these applets (Escher and Starfield, when I checked) appear to be
broken. BouncingHeads makes a good test.</para>
<para>You might also want to copy the RPMS you built out of
<filename>/usr/src/redhat/RPMS/</filename> so you'll have then handy for
reinstalls.</para>
</sect1>
<sect1><title>RealAudio and RealVideo</title>
<para>I don't known anywhere this is accessible via yum, so you'll have
to download and install it by hand. Do this first:</para>
<programlisting>
yum install compat-libstdc++-33
</programlisting>
<para>Then download the <ulink
url='http://www.real.com/R/RC.080204os_linux_1_2_2_1_9_2.ecomm...R/forms.real.com/real/player/download.html?f=unix/RealPlayer10GOLD.rpm&amp;product=playerplus&amp;system=linux&amp;&amp;src=080204os_linux_1_2_2_1_9_2'>RealPlayer10GOLD
RPM</ulink> and install it.</para>
<para>On 32-bit Fedora Core you may need to delete HelixPlayer with
<programlisting>
rpm -e HelixPlayer
</programlisting>
before the 10GOLD version will work. x86_64 FC5 does not
include HelixPlayer.</para>
</sect1>
<sect1><title>MPEG, QuickTime, AVI, and DVDs</title>
<para>MPEG (the format used on DVDs) represents itself as an open standard,
but most Linux distributions won't ship software that read it because of
blocking patents held by MPEGLA. AVI and Apple QuickTime have proprietary
codecs covered by patents, so most Linux distributions won't ship software
that decodes them, either.</para>
<para>FC5 ships the GNOME project's official video player, <ulink
url='http://www.gnome.org/projects/totem/'>totem</ulink>. Unfortunately,
it <ulink
url='http://www.redhat.com/archives/fedora-devel-list/2006-January/msg01239.html'>won't
play DVDs</ulink>. The symptom
is an error popup that says "Totem was not able to play this disc. No
reason", but the problem is actually a known bug in gstreamer-0.10.</para>
<para>Unfortunately, the alternate front end xine is even more broken.
It can be installed this way:</para>
<programlisting>
yum install xine xine-lib libdvdcss
</programlisting>
<para>Doing this will also install a number of support libraries, including
the libdvdcss plugin that the xine people won't talk about on their site
because they are too frightened of the DVDCCA's attack lawyers.</para>
<para>The 0.99.4 xine release displays an all-white window and does nothing
(at least on my plain-vanilla Opteron machine using a nVidia
GeForce2).</para>
</sect1>
<sect1><title>Test pages for Web streaming</title>
<para>Here are some test locations to try streaming audio and video clips
from: </para>
<itemizedlist>
<listitem><para>
<ulink url="http://codeccorner.com/">AVI</ulink>
</para></listitem>
<listitem><para>
<ulink url="http://www.apple.com/quicktime/troubleshooting/">QuickTime</ulink>
</para></listitem>
<listitem><para>
<ulink url="http://www.vdat.com/techsupport/windowstest.asp">Windows Media</ulink>
</para></listitem>
<listitem><para>
<ulink url="ftp://ftp.tek.com/tv/test/streams/Element/index.html">MPEG</ulink>
</para></listitem>
<listitem><para>
<ulink url="http://service.real.com/test/">RealPlayer</ulink>
</para></listitem>
</itemizedlist>
</sect1>
<sect1 id="resources"><title>Related Resources</title>
<para>There is a good walkthrough of a Fedora Core 5 installation procedure,
covering some of the same ground as this document, <ulink
url="http://stanton-finley.net/fedora_core_5_installation_notes.html">here</ulink>.</para>
<para>There is a useful
<ulink url='http://home.gagme.com/greg/linux/fc4-tips.php'>Fedora Core 4
Tips and Tricks</ulink> page.</para>
<para>There is a good tutotial on <ulink
url="http://www.yolinux.com/TUTORIALS/LinuxTutorialMozillaConfiguration.html">Firefox
multimedia plugins</ulink>.</para>
<!-- Also see http://www.linux-mag.com/content/view/2074/ for video codecs -->
</sect1>
<sect1 id="license"><title>License and Copyright</title>
<para>&copy; 2004, Eric S. Raymond.</para>
<para>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or any
later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the
license is located at <ulink
url="http://www.gnu.org/copyleft/fdl.html">www.gnu.org/copyleft/fdl.html</ulink>.</para>
</sect1>
<sect1 id="acknowledgements"><title>Acknowledgements</title>
<para>Miguel Freitas helped educate me about some of the techicalities of
video formats.</para>
</sect1>
</article>
<!--
The following sets edit modes for GNU EMACS
Local Variables:
fill-column:75
compile-command: "mail -s \"Fedora Multimedia Installation HOWTO update\" submit@en.tldp.org <Fedora-Multimedia-Installation-HOWTO.xml"
End:
-->
<!-- Use these:
http://www.mjmwired.net/resources/mjm-fedora-fc5.html
-->