This is a simple guide to installing MPlayer (movie player for linux ... http://www.mplayerhq.hu/) on Redhat Fedora. The current release of Fedora Core is 3 (FC3). Most information should also apply to Redhat 7.3, 8.0 and 9.0, Fedora Core 1, and Fedora Core 2 - although there are differences. Most are explicitly stated. Required skills are basic command line knowledge.
MPlayer and most of the below applications are provided as easy to install binary RPM files. However compiling software on your own will provide greater customization and a significant performance increase. It will provide valuable experience in the standard Linux/GNU software installation process.
Note: I am sure there are inaccuracies or errors in these instructions. I've spent a great deal of time making sure everything is correct. Please let me know if I've missed something.
|
1. Introduction
This document is intended for new linux users. Hence most command line input and output has been presented. Recommended experience is basic command line file management, decompression with bzip2, gzip and tar, and basic familiarity with compiling with make and gcc.
This is for a basic install of Fedora. If you custom installed you may not have some basic libraries that MPlayer requires or utilizes. If necessary examine your configure output below.
2. Basic Dependencies
MPlayer handles many file formats internally, however the following applications will add to the file formats that MPlayer can both decode and encode.
2.1. DivX
DivX is the MPEG-4 codec provided by DivXNetworks, Inc.
Current Version: 5.0.5
Current Date: 20030428
Download: http://www.divx.com/divx/linux/
Previous Version: 5.0.1
Previous Date: 20020418
Download: divx4linux501-20020418.tgz
Note: The MPlayer 1.0pre1 release supports the Divx 5.0.5. For MPlayer releases prior please use Divx 5.0.1.
Installation: Decompress and run the install script. The same procedure works for both versions.
[root@myhost mm]# gunzip -c divx4linux-std-20030428.tar.gz | tar xvf - [root@myhost mm]# cd divx4linux-20030428 [root@myhost divx4linux-20030428]# ./install.sh
2.2. Lame
Lame is an open source MP3 encoder. MPlayer uses lame for compressing audio into MP3 audio when encoding files from MPEG or other sources. Lame is not required to decode MP3 audio.
Current Version: 3.96.1
Release Date: 2004-07-24
Download: http://lame.sourceforge.net/download/download.html
Installation: Decompress the source, configure it, compile it and install.
[root@myhost mm]# gunzip -c lame-3.96.1.tar.gz | tar xvf - [root@myhost mm]# cd lame-3.96.1 [root@myhost lame-3.96.1]# ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu -- LOTS OF CHECKS... -- config.status: creating mac/Makefile config.status: creating config.h config.status: executing default-1 commands [root@myhost lame-3.96.1]# make -- COMPILING... -- [root@myhost lame-3.96.1]# make install
Note: The current MPlayer release may not properly link to the Lame libraries in their default install location. Please use the following fix to allow for MPlayer to detect Lame.
[root@myhost mm]# ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
2.3. XviD
XviD is an ISO MPEG-4 compliant video codec. MPlayer can encode movie files formats into the XviD format.
Current Stable Version: 1.0.3
Release Date: December 20, 2004
Download: http://www.xvid.org/downloads.html
FC3 Binary RPM: http://heidelberg.freshrpms.net/rpm.html?id=419
FC2 Binary RPM: http://tettnang.freshrpms.net/rpm.html?id=414
FC1 Binary RPM: http://yarrow.freshrpms.net/rpm.html?id=1168
Installation: Decompress the source, configure it, compile it and install.
[root@myhost mm]# bzip2 -cd xvidcore-1.0.3.tar.bz2 | tar xvf - [root@myhost mm]# cd xvidcore-1.0.3/build/generic/ [root@myhost generic]# ./configure ... Configuring ... [root@myhost generic]# make ... Compiling ... [root@myhost generic]# make install
Note: In some instances, the source code may not compile. If you encounter the problem, please use binary RPM(s) to install XviD. If the binary RPM comes with a devel RPM, make sure to install it also. Make sure to use the correct RPM - the following example is for XviD 1.0.1 on FC2:
[root@myhost mm]# rpm -ivh xvidcore-1.0.1-1.1.fc2.fr.i386.rpm [root@myhost mm]# rpm -ivh xvidcore-devel-1.0.1-1.1.fc2.fr.i386.rpm
2.4. RealPlayer
RealPlayer is a streaming audio/video/flash/pix/text player with protocols to watch/listen to content on the internet. Provided by RealNetworks, Inc.
Note: You do NOT need RealPlayer installed to use MPlayer or to watch RealMedia in MPlayer. MPlayer will play older Real formats and media up to Real 9.0 if you have the codecs properly set up below. It will currently not play Real 10.0 formats.
RealPlayer 10 will play all Real media including 10.0 formats perfectly. It should work on RH9, and FC1/2 perfectly, however I do not know about older RH releases.
Instructions to install RealPlayer 10.0 can be found on my Fedora Core 3 page. While the older instructions for RealPlayer 8.0 + 9.0 codecs are still available on my Fedora Core 1 page.
3. MPlayer
Current Version: 1.0pre6
Current Date: 2004.12.15
Download: http://www.mplayerhq.hu/homepage/dload.html
Codecs: http://www.mplayerhq.hu/homepage/design7/codecs.html
3.1. MPlayer Files
Obtain the following files for installation. Please use an appropriate mirror location to download the files. You need the MPlayer source and some additional codecs. you can either grab all codecs (note MPlayer decodes many natively) or you can grab just the required files. Make sure to select the correct font for your location. The skins are strictly optional, however if you want to have a GUI for MPlayer you should have at least one skin. You only need one font set.
src: MPlayer-1.0pre6.tar.bz2 skin: Blue-1.4.tar.bz2 (pick ANY) font: font-arial-iso-8859-1.tar.bz2 codecs: all-20041107.tar.bz2
3.2. Installing Additional Codecs
These essential codecs are to read formats that do not have an Open Source decoder available. These include Windows win32 codecs such as Windows Media, Quicktime, Real and multiple others.
Installation: All of MPlayer's codecs codecs must be installed in /usr/local/lib/codecs/.
[root@myhost mm]# mkdir /usr/local/lib/codecs/ [root@myhost mm]# [root@myhost mm]# bzip2 -cd all-20041107.tar.bz2 | tar xvf - [root@myhost mm]# cp all-20041107/* /usr/local/lib/codecs/
Note: Previously win32 codecs were placed in /usr/lib/win32. Applications like Xine use that directory for the same purpose. If you would like you can either keep both directories or make one linked to the other. If both directories exist you cannot link them.
All files are in /usr/local/lib/codecs and /usr/lib/win32 is a link: [root@myhost mm]# ln -s /usr/local/lib/codecs /usr/lib/win32 -OR- All files are in /usr/lib/win32 and /usr/local/lib/codecs is a link: [root@myhost mm]# ln -s /usr/lib/win32 /usr/local/lib/codecs
Note: Fedora Core users with prelinking enabled may have difficulties with running Windows Media (WMV, ASF) and other formats decoded by win32 codecs. Please see known issues below.
3.3. Setup MPlayer
MPlayer follows standard Linux application procedure of installing dependencies, configuring, compiling and installing. The above steps were to eliminate most common dependency problems.
First decompress the source files. There are quite a few.
[root@myhost mm]# bzip2 -cd MPlayer-1.0pre6.tar.bz2 | tar xvf - [root@myhost mm]# cd MPlayer-1.0pre6/
3.3.1. Configuring
Configuring allows to customize certain parameters before compiling.
To see all of MPlayer's configuring options run:
[root@myhost MPlayer-1.0pre6]# ./configure --help
Most users will find the default configuration options adequate. However I recommend the following options. The first option is required to install the GUI. The second option is to allow access to large files over 2GB. Useful to rip DVD's or record Digital Video. The third option is for menus in the OSD (On Screen Display).
[root@myhost MPlayer-1.0pre6]# ./configure --enable-gui --enable-largefiles --enable-menu
Note: Any linux using the GCC 2.96 compiler will get a warning. This specifically includes Redhat 7.0-7.3. You will need to add the following option to the configure: --disable-gcc-checking
GUI Requirements: The GUI requires both gtk+ 1.2 and glib 1.2 installed. Make sure you have the following RPMs: gtk+-1.2.10, gtk+-1.2.10-devel, glib-1.2.10, glib-1.2.10-devel. (These are for FC3, look on your Fedora CD's for these RPM's they are avaiable on all Fedora/Redhat distributions).
Once the configure script has been run a great deal of output is displayed on the console. The following is a sample output from the end of the configure on my machine. Your output can differ based on what additional hardware or software you have installed.
Config files successfully generated by ./configure ! Install prefix: /usr/local Data directory: /usr/local/share/mplayer Config direct.: /usr/local/etc/mplayer Byte order: little-endian Optimizing for: athlon-4 mmx mmx2 3dnow 3dnowex sse mtrr Languages: Messages/GUI: en Manual pages: en Enabled optional drivers: Input: ftp network edl tv matroska cdda mpdvdkit2 vcd smb Codecs: qtx divx5linux xvid libavcodec real xanim dshow/dmo win32 faad2(internal) libmpeg2 liba52 mp3lib libvorbis gif Audio output: alsa esd arts oss sdl mpegpes(file) Video output: xvidix cvidix sdl vesa gif89a md5sum pnm jpeg png mpegpes(file) opengl dga xv x11 xover tga Audio filters: Disabled optional drivers: Input: tv-v4l2 tv-v4l tv-bsdbt848 live.com dvdread dvb Codecs: divx4linux x264 libdv libdts libtheora toolame libmad liblzo Audio output: sgi sun jack polyp dxr2 nas dsound win32 macosx Video output: winvidix bl zr zr2 dxr3 dxr2 directx fbdev svga caca aa ggi xmga mga xvmc directfb tdfx_vid tdfxfb 3dfx quartz Audio filters: ladspa
3.3.2. Configuring (Again)
This step is optional. If everything worked correctly the first time you configured then continue to compiling. However there is a chance you do not have something correctly installed on your computer.
During configure there are tests done to check which software is already installed. Read over it carefully to see if there are any mistakes or if some library is not detected. For example: if the Lame libraries were detected, you would see:
Checking for libmp3lame (for mencoder) ... yes
If you add any additional codecs or wish to modify the configure settings you MUST RE-RUN the configure script.
Not all the codecs should be detected. In fact most will not. However the many that you have should be an adequate starting point for using MPlayer to decode and encode. Read over the MPlayer documention to find out how to enable additional codecs or input/output drivers.
The following explains the configure output.
- Input
These are input sources or devices. Most are self explanatory and should be standard. Example: cdda, mpdvdkit2 and vcd are for playing CD's, DVD's and VCD's. - Codecs
These are input and output codecs for media. Using this guide you must at least see: qtx, divx5linux, xvid, real, and win32. Some are internally built into MPlayer others are standard in Linux. - Audio output - VERY IMPORTANT
These are your output audio drivers. you must at least have one of the following: alsa, esd, arts, or oss. Without one of these you CANNOT hear audio.- ESounD: esd - (used in Gnome) requires: esound, esound-devel, audiofile and audiofile-devel RPM's.
- aRts - (used in KDE) requires: arts and arts-devel RPM's (as well as any other KDE components).
- ALSA - FC2 and newer include ALSA. FC1 and older do not. It must be installed separately. If you installed ALSA by RPM, then alsa-lib and alsa-lib-devel RPM's are required. This is NOT a problem is you installed ALSA from source.
- Video output - VERY IMPORTANT
These are you output video drivers. They include output to BOTH the screen/x-server and to file (png, jpeg). You should have xv and x11 to output to the x-server (ie. if you use Graphics in Linux). You will need the XFree86-libs and XFree86-devel RPM's. For FC2 (and newer) the 2 RPM's are named: xorg-x11-libs and xorg-x11-devel.
Note: RPM's - Whenever installing RPM's for detection by MPlayer or any program make sure to install any lib RPM's and devel RPM's only if necessary.
*** FINALLY *** - If you modified ANY of the above or install ANY new RPM's or programs. Then you MUST RE-RUN the configure script as stated above.
3.3.3. Installing
Once carefully completing the configure step, you can compile MPlayer. This step usually takes the longest.
[root@myhost MPlayer-1.0pre6]# make
If there is an error at this point you may have used an improper library or version of a dependency. Try to determine at which file the compile fails and post to help forums, newsgroups or mailing lists for assistance. Reading MPlayer documentions usually helps. Often the easiest solution is go to a previous version of a library or dependency application. For example: using the DivX 5.0.1 instead of 5.0.5. Another solution maybe to entirely disable that plugin. Running ./configure --help will list how to disable most plugins or detections that MPlayer uses.
If you need to fix something, you will have to re-do the Configure step from above. Otherwise continue:
[root@myhost MPlayer-1.0pre6]# make install
MPlayer will be installed and the last few lines of output indicate where we should install the skins and fonts.
*** Download skin(s) at http://www.mplayerhq.hu/homepage/dload.html *** for GUI, and extract to /usr/local/share/mplayer/Skin/
When MPlayer runs it can use a codec file. After compiling, install this globally:
[root@myhost MPlayer-1.0pre6]# cp etc/codecs.conf /usr/local/etc/mplayer/codecs.conf
To set local codecs.conf, place it in ~/.mplayer/codec.conf. Or link to the global file:
[user@myhost user]# ln -s /usr/local/etc/mplayer/codecs.conf ~/.mplayer/codecs.conf
Similar to the codecs, MPlayer can also use an input control file to map keyboard, joystick and other devices to functions in the program. For the global file:
[root@myhost MPlayer-1.0pre6]# cp etc/input.conf /usr/local/etc/mplayer/input.conf
To set local input.conf, place it in ~/.mplayer/input.conf. Or link to the global file:
[user@myhost user]# ln -s /usr/local/etc/mplayer/input.conf ~/.mplayer/input.conf
Note: In both cases the files in ~/.mplayer/ are your own personal settings. You are NOT required to link them, you can edit them and use your own settings. If you do not choose to set these files globally, the individual settings will only apply to the user who ran them, either root or any user on the machine (you). Please read the MPlayer official documentation from their website for more information.
3.3.4. OSD / Fonts
The OSD (On Screen Display) and Subtitles you need fonts properly installed. You should set this up regardless of whether or not you use the GUI. Make sure you use a proper font for your region/location ex: font-arial-iso-8859-1.tar.bz2.
[root@myhost mm]# bzip2 -cd font-arial-iso-8859-1.tar.bz2 | tar xvf - [root@myhost mm]# mkdir -p /usr/local/share/mplayer/font/ [root@myhost mm]# mv font-arial-iso-8859-1 /usr/local/share/mplayer/font/ [root@myhost mm]# ln -s /usr/local/share/mplayer/font/font-arial-iso-8859-1/font-arial-14-iso-8859-1/* /usr/local/share/mplayer/font
The 14 font size can be either 14, 18, 24 or 28. You can have a different individual font or you can link to the global fonts.
[user@myhost user]# mkdir ~/.mplayer [user@myhost user]# ln -s /usr/local/share/mplayer/font/ ~/.mplayer/font
If you use FreeType (all recent RH/Fedora releases have it by default). You should have the XFree86-truetype-fonts RPM in FC1, or xorg-x11-truetype-fonts RPM if FC2, or fonts-xorg-truetype RPM if FC3. You need msttcorefonts package for the second option.
[user@myhost user]# ln -s /usr/X11R6/lib/X11/fonts/TTF/luxisri.ttf ~/.mplayer/subfont.ttf -OR- [user@myhost user]# ln -s /usr/share/fonts/msttcorefonts/arial.ttf ~/.mplayer/subfont.ttf
3.3.5. GUI
The GUI for MPlayer is optional and does not install by default. You must select this option at the 'Configure' stage explained above.
To install a skin decompress it and copy or move it into the skins directory. You can have as many as you like, but one must be default. Go to the MPlayer homepage and examine some screen shots to find one you like. The ones I recommend are: Blue, hwswskin and proton.
[root@myhost mm]# bzip2 -cd Blue-1.4.tar.bz2 | tar xvf - [root@myhost mm]# mv Blue /usr/local/share/mplayer/Skin/ [root@myhost mm]# bzip2 -cd proton-1.2.tar.bz2 | tar xvf - [root@myhost mm]# mv proton /usr/local/share/mplayer/Skin/ [root@myhost mm]# bzip2 -cd hwswskin-1.1.tar.bz2 | tar xvf - [root@myhost mm]# mv hwswskin /usr/local/share/mplayer/Skin/ Set the default skin (I picked 'Blue'): [root@myhost mm]# cd /usr/local/share/mplayer/Skin/ [root@myhost Skin]# ln -s Blue default
Note: Some of these skin names/filenames may have changed. Please look at the MPlayer skins page for the latest versions.
3.4. Uninstalling
Uninstalling MPlayer can be done by:
[root@myhost MPlayer-1.0pre6]# make uninstall
To uninstall any other components listed above, the similar procedure works. Change directory to where the 'make install' was run and run 'make uninstall'.
If you did not install from source files and used binary rpms, you can use the rpm command or the Redhat Package Manager to uninstall rpms. Run 'man rpm' for more help, look at the '-e' flag. If you created a directory that no other program uses, you can also delete it.
Note: Use caution when uninstalling and deleting, you can do serious damage to your system when you are root.
Some notes:
- DivX: No uninstall method is provided.
- Lame: make uninstall is available in the source.
- XviD: No uninstall method is provided.
3.5. Upgrading
You may either upgrade dependencies or upgrade MPlayer itself. Both can potentially break functionality of MPlayer.
To upgrade a dependency repeat the steps listed above. Of course never upgrade a dependency unless comletely necessary. By doing so you may break compatibility with other programs. If everything works there is no need to upgrade.
This guide lists the latest dependencies and releases so as to stay up to date. In most cases using previous versions of software will work. Any exceptions are noted.
To upgrade MPlayer, obtain new source code, decompress, configure, compile and install.
- Check for new options in the configure script and enable any you may use. User the --help or read the Changelog included.
- Always preserve your previous MPlayer directory, in case the new one has problems. This happens often.
- Run a make uninstall from the (old) MPlayer version you are using before running make install from the (new) version you to which you are upgrading.
- You can always run make install even if you ran make uninstall from the same directory.
For example: After compiling MPlayer 0.91, I changed to the MPlayer 0.90 directory and ran make uninstall and then ran make install from inside the 0.91 directory.
4. Using MPlayer
MPlayer can be run by command line using mplayer or gui using gmplayer. You should use your movie file or music file in the line.
Example: [mirandam@charon media]$ mplayer ipod-vertigo_m480.mov [mirandam@charon media]$ gmplayer sarah_mclachlan-world_on_fire.mov
4.1. Install an Icon to Desktop
In Gnome follow these steps:
Right-Click on the Desktop
Select Create Launcher
Enter: "MPlayer" for Name
Enter: "/usr/local/bin/gmplayer" for Command
For Icon select /usr/local/share/pixmaps/mplayer-desktop.xpm
Similar instructions for KDE.
5. More Information
All of the information in this guide is available in the MPlayer documentation, man pages or FAQ. I strongly recommend you look there for help first. Use man mplayer for command line help in using mplayer/mencoder.
- MPlayer Documentation
- MPlayer F.A.Q.
- MPlayer Official Installation Documentation
- Beyond Beyond Linux From Scratch - MPlayer
- Getting the best out of MPlayer
- mplayerplug-in for Mozilla
6. Known Issues
These are the following known issues I've experienced with MPlayer or one of its many dependancies. This is not an exhaustive list, just some things I have personally seen.
Version/Compatibility Issues:
- MPlayer configure may not detect Lame correctly. Solution see above.
- MPlayer version 1.0pre1 (or newer) is required to use/detect DivX 5.0.5
- MPlayer version 1.0pre3 (or newer) is required to use/detect XviD 1.0.x versions.
- MPlayer version 1.0pre3 (or newer) is required to use/detect ALSA 1.0.x drivers and libraries. Version 1.0pre2 will not work. Either remain with ALSA 0.9.x or use MPlayer 1.0pre3.
- mjpegtools: When using libquicktime output with mjpegtools, MPlayer 1.0pre3 will decode the quicktime sound INCORRECTLY. MPlayer version 1.0pre2 decodes properly.
DVD Issues:
DVD navigation and menu support in MPlayer is very buggy and not supported. This does not prevent DVD playback. Xine is highly recommended if you wish to use these features (Note that Xine is a completely separate Media Player application).
Prelinking Issues:
Fedora Core users with prelinking may have problems with some win32 codecs. More information can be found on the mailing list and the MPlayer FAQ.
To see if prelinking is enabled on your machine:
[user@myhost user]# rpm -qa | grep prelink prelink-0.3.0-13 [user@myhost user]# cat /etc/sysconfig/prelink | grep PRELINKING PRELINKING=yes
To modify prelinking configuration (recommended):
Edit /etc/sysconfig/prelink Change PRELINK_OPTS=-mR to PRELINK_OPTS="-m --no-exec-shield" [root@myhost root]# prelink -u -a (undoes prelinking if enabled, takes a while) [root@myhost root]# prelink -a -m --no-exec-shield (fixes prelinking, takes a while)
To disable prelinking completely. Necessary if above does not work.
Edit /etc/sysconfig/prelink Change PRELINKING=yes to PRELINKING=no [root@myhost root]# /etc/cron.daily/prelink (this takes a while) [root@myhost root]# echo 0 > /proc/sys/kernel/exec-shield