Installation of MPlayer under Linux __linux

Source: Internet
Author: User
Tags bz2 gtk unsupported

MPlayer is one of the most media-enabled players with the fastest playback speed (correctly installed graphics drivers), and it can play almost all of the win media files. The following describes how it is installed:

Installation premise:
To compile the software, verify that your system has the appropriate xfree86-devel, and if you want to compile the GUI operator interface
(./configure--enable-gui), please also confirm that your system has LIBPNG,LIBPNG-DEVEL,GTK and Gtk-devel (requires version greater than 1.2) These four software, The corresponding RPM packages can be found at www.rpmfind.net (these packages are available by installing the GNOME desktop)
1, download the latest version of the MPlayer and install the required package package

2, upgrade GCC: (necessary, recommended GCC version for 2.9.5 and 3.2.x)
Check your GCC version, run gcc-v to see what the output is, if it is below 3.0, it is recommended to install gcc3.0 above (according to MPlayer's official instructions, GCC under 3.0 can be used./configre--disable-gcc-checking The parameter compiles, but may be unstable), installs the Gcc3 method is: Enters the GCC3 directory, runs the RPM-IVH *.rpm--nodeps, all hundred cent installs, opens a terminal window, runs the MV/USR/BIN/GCC/USR/BIN/GCC2 and the mv/usr/ BIN/GCC3/USR/BIN/GCC, then run gcc-v to see if the output is 3.0.2, if yes, OK, no, then check the installation steps.

3, compile and install MPlayer:
Tar vxf mplayer-****.tar,cd mplayer-****,./configure (if you want the GUI's operating interface, swap this command./configrue--enable-gui, but it seems that this version of the GUI compiles wrong , I and LINUXCN can not succeed, Pre4 version is no problem), Make,make install, have successfully run the MPlayer (this is to allow it to build in the home directory. MPlayer this configuration directory (. MPlayer is a hidden directory, with LS- A command can be seen, CD ~/.mplayer instructions can be entered), so that the next step.

./configure--prefix=/usr/local--enable-gui--enable-live--enable-menu--enable-freetype- Enable-win32--enable-dshow--enable-real--enable-divx4linux--enable-xvid--disable-arts-- Enable-dynamic-plugins--with-codecsdir=/usr/local/lib/codecs--with-win32libdir=/usr/local/lib/codecs-- With-reallibdir=/usr/local/lib/codecs--with-livelibdir=/usr/local/lib/live--with-freetype-config=/usr/bin/ Freetype-config
Important Parameter Description:
--prefix= installation path is/usr/local
--enable-gui uses the graphical interface, MPlayer has the command line and the graphical interface two kinds of operation Way
--enable-live using streaming media support
--enable-freetype subtitles fonts can be used TTF fonts
--enable-win32 can use a decoder in Win32. dll format
--enable-real Support Real format
The format of the--LANGUAGE=ZH_CN MPlayer interface is Chinese
--with-codecsdir=/usr/local/lib/codecs Specify decoder search Path
--with-win32libdir=/usr/local/lib/codecs Specify Win32 Decoder search path
--with-reallibdir=/usr/local/lib/codecs Specify real Decoder search path
--with-livelibdir=/usr/local/lib/live Specifies the live decoder search path

Now use
Make
Automatically compile the software, you can go to eat, come back to see

Make Install//installation

Run MPlayer
./mplayer

4, copy the configuration file: (Note: The following this etc directory is extracted from the previous step of the mplayer-*** directory, not/etc)
CP etc/codecs.conf ~/.mplayer
CP etc/example.conf ~/.mplayer/config

5, install Font and skin: (If you choose./configure--enable-gui that only need skin, otherwise skin do not install) into their own home directory, show hidden files, Enter the. MPlayer folder, create 2 folders: Font and skin. Download the font file (MPlayer on the official website) and copy it into the font, copying the Simsun.ttf into the ~/.mplayer directory, and copy the Blue skin directory to the/usr/local/share/mplayer/skins directory.

6. Operation mode
Two kinds: (1) MPlayer/path/media file name to be played, (2) Gmplayer (only if the command compiled with the./configure--enable-gui is valid) you can now run MPlayer and Gmplayer. However, there is a problem with the gmplayer caption, which indicates that the marquee font file cannot be found. Follow the prompts to copy Simsun.ttf (other font files can also) into the ~/.mplayer directory (change file name).

7, about the ~/.mplayer/config file some configuration instructions
VO=XV (choose the default playback mode, XV mode is to support the graphics hard acceleration function of the mode, the CPU is very small, recommended; more display modes can be viewed with commands Mplayer-vo help, where the VESA mode can be played without starting the Xwin interface. A bit like the Golden Hill shadow PA under DOS
Ao=oss (choose sound playback mode, OSS is the most compatible playback mode, recommended; You can also try SDL mode)
Fs=yes (full screen mode, yes if the default is full screen playback, no or preceded by the # number annotation out of this line is the default 1:1 playback mode)
Zoom=yes (immediately change the size of the movie screen, yes, you can use the mouse to play the screen at will pull small, no words can not)
GUI = yes (the default is a graphical operation interface, which requires you to compile it previously with the./configure--enable-gui, otherwise, even if yes, there is no GUI operator interface)
Skin = Default (set skin, replace the value to the right of the equal sign skin the directory you want to set the desired skin as default, this parameter is valid with GUI interface)
Cache = 8192 (the default playback cache size, if the machine memory is large enough, it will be increased a little, if not very large, such as 128 below, or with the default to forget)
Framedrop = yes (allow to jump frames, if your machine CPU speed is very very slow, please put this yes, the default is no or preceded by the # number to prohibit this line; for machines above 366MHZ, it is recommended to set no or front plus #) Other settings are done by default.

Here is the compilation and installation method of Mplayer1.0pre3. However, most of these steps should apply to other versions. My system is RH9, the kernel is 2.4.20-8, development Baoqianxian.

Another method:
Step 1 downloading

Go to the official site (http://www.mplayerhq.hu/homepage/design6/dload.html) to download the required packages, including:
Mplayer-1.0pre3
Codecs Package (two of the official offers, if you want to see RM)
Default Skin Package

Download the font packs you need for subtitles in the Linux commune to see DVDRip. Download address (registration is required to download):
http://www.linuxfans.org/nuke/modules.php?name=Site_Downloads&op=geninfo&did=192

Step 2 Coping Files

Extract each package using the TAR command, and then copy the downloaded decoder, font, and skin file to the appropriate directory:
I copied the fonts and skin files to the/usr/share/mplayer directory, the decoder was copied to/usr/local/lib/codecs, and the real decoder was copied to/USR/LOCAL/LIB/CODECS/RP. Of course, you can copy them to any directory, but note that the font directory and skin directory in the same directory, font directory name to Font,skin directory name for skin (case note), and the interface required for the picture file under Skin/default, Otherwise, you will be prompted to not find skin when you start the MPlayer graphical interface.

Step 3 modifing

Sometimes "not audio/video stream or unsupported!" appears when you open an RM file , but click OK after the normal playback, in order to remove this annoying dialog box, we modify the source file (open source Advantage, hehe).

Open the Demux_real.c file in the MPlayer source directory with either text editor (such as Kedit,gedit):
Mplayer-1.0pre3/libmpdemux/demux_real.c

Add//To comment out this line of code before line 1298th. (Note: Corresponds to the mplayer1.0pre3 version.) Other versions may have different lines, but basic information is the same. Exit after saving. The details of the code are as follows:
Mp_msg (Msgt_demux, Msgl_err, "not audio/video stream or unsupported!/n");

Step 4 Configuration & Make

And then we can start configure. In terminal mode, run the following command under the source code directory: (More options please run./configure--help to view)

$./configure--enable-gui--enable-real--datadir=/usr/share/mplayer--libdir=/usr/local/lib/codecs--language=en-- WITH-REALLIBDIR=/USR/LOCAL/LIB/CODECS/RP--with-win32libdir=/usr/local/lib/codecs/win32

The following explains the meaning of each option:

--enable-gui: Enables MPlayer to use the graphical interface
--datadir=/usr/share/mplayer: Set the font and skin directory, depending on the directory you just copied
--libdir=/usr/local/lib/codecs: Set the directory where the decoder resides
--language=en: Set MPlayer interface language for English, also can be set to en to display Chinese.
--WITH-REALLIBDIR=/USR/LOCAL/LIB/CODECS/RP: Set the real file decoder directory
--WITH-WIN32LIBDIR=/USR/LOCAL/LIB/CODECS/WIN32: Sets the Win32 decoder directory. Note that the Win32 decoder is not required, but it is necessary to set this directory, otherwise if you set the Libdir, but do not set the Win32 directory, mplayer in the Configure will be prompted an error.

When the Configure is over, the following is simple, direct make (this step takes a bit longer), then make install. So the MPlayer is installed in the system.

Step 5 Run MPlayer

You can run MPlayer or Gmplayer commands at the terminal or "Start"-"Run Programs". Where Gmplayer is the boot with the graphical interface of the MPlayer, of course, you have to configure when the Enable-gui option enabled and your skin installed correctly. The first step after the first run is to set the font, which is used to display dvdrip Chinese subtitles. Right-click on the MPlayer main window, select Settings (Preferences), and fill in the location of the Font.desc in your font file directory on the font (font) tab. For example, mine is/usr/share/mplayer/font/font.desc. Then select "Unicode subtitles" in the subtitle/osd (subtitles/osd) tab. Other options you can set according to your needs. If you add the parameter-forceidx after the MPlayer or Gmplayer command, you can drag the RM file, but you cannot use the progress bar on the interface, you must use shortcut keys, such as the top and bottom direction keys, also very convenient.

Installation MPlayer requires three packages of installation: Main program, Skin, codecs. Can be downloaded from the official website of MPlayer: www.mplayerhq.hu
src:mplayer-1.0rc1.tar.bz2
skin:blue-1.4.tar.bz2
Codecs:  ALL-20061022.TAR.BZ2
put it under the/usr/software/mplayer directory.
Install the code package first, the MPlayer code package must be installed in/usr/lib/codecs/or/usr/local/lib/win32.
[root@localhost/]# cd/usr/software/mplayer
[root@localhost mplayer]# tar vjxf all-20061022.tar.bz2
[root @localhost MPlayer] #cd all-20061022
      [root@localhost all-20061022] #cp */usr/lib/ Codecs

to begin installing MPlayer main program
[root@localhost mplayer]# tar vjxf mplayer-1.0rc1.tar.bz2
[root@localhost mplayer]# CD MPLAYER-1.0RC1
[root@localhost mplayer-1.0rc1]#./configure--enable-gui

[root@localhost mplayer-1.0rc1]# made
[root@localhost mplayer-1.0rc1]# make install
If all the previous settings are correct, there will be no more errors here. 。 Now that the MPlayer has been installed in your Linux, the following is to install the skin is the graphical interface. Then go back to the original directory.
[root@localhost mplayer-1.0rc1]# cd ...
[root@localhost mplayer]# bzip2-cd blue-1.4.tar.bz2 tar xvf--c/usr/share/mplayer/skin/
[root@localhost MPLA yer]# mv/usr/share/mplayer/skin/blue//usr/share/mplayer/skin/default/
Here installs the Blue skin just now and sets it to the default, After installation you can also find a variety of mplayer skin, without decompression directly into the/usr/share/mplayer/skin/under the MPlayer interface can modify the skin. After the

is installed, we start mplayer, and there may be errors like the following:
New_face faild. Maybe the font path is wrong. Please supply the text font file. (~/.mplayer/subfont.ttf). "
This is where we use the system's own fonts instead.
[root@localhost mplayer]# cd/usr/share/fonts/zh_cn/truetype/
to find one of the font files copied to the current user directory in the. mplayer/Directory MPlayer play rmvb , RM has no images, only sound sets the SELinux.
chcon-t textrel_shlib_t/usr/lib/codecs/drvc.so
chcon-t textrel_shlib_t/usr/lib/ codecs/drv4.so.6.0

Play RM, RMVB, Eject: Error: Cannot open the required DirectShow codec: drvc.so, but can put, in order to eliminate this nasty stuff you can perform as follows:

cd/usr/lib/codecs/
LDD drvc.so
Output results:
Linux-gate.so.1 => (0xffffe000)
Libstdc++.so.5 => not found
Libc.so.6 =>/lib/libc.so.6 (0xb7dd1000)
/lib/ld-linux.so.2 (0x80000000)
You have to search the Internet or from other systems CP libstdc++.so.5.0.6 to/usr/lib

And then Ln-s libstdc++.so.5.0.6 libstdc++.so.5 to execute ldconfig.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.