How to install and configure mplayer locally

Source: Internet
Author: User
How to install and configure mplayer locally-general Linux technology-Linux technology and application information. For details, refer to the following section. [I = s] This post was last edited by cstn

I don't have a good network connection, and the Internet access is dial-up by CMWAP on the mobile phone. Therefore, yum is temporarily unavailable to me. I basically install it locally.
This is how I install mplayer locally under Fedora12. For more information, see
In addition to fedora, other systems such as ubuntu and opensuse can also be tried. They are all source code installation. It should be similar.

Download from the mplayer website
Main Program src: MPlayer-1.0rc2.tar.bz2
Decoder codecs: essential-20071007.tar.bz2
Skin: standard-1.9.tar.bz2 (the official website provides a lot of skin, I choose the standard skin, you can also choose other)

Install (use the su command to switch to the root user ):

1. Install the decoder first
# Mkdir/usr/local/lib/codecs/
# Bzip2-cd essential-20071007.tar.bz2 | tar xvf-
# Cp essential-20071007/*/usr/local/lib/codecs/

2. Install the mplayer main program
# Bzip2-cd MPlayer-1.0rc2.tar.bz2 | tar xvf-
Cd into the extracted Mplayer-1.0rc2 folder, and ensure that your system is installed with gtk +, gtk + devel, glib, glib devel the four components, anyway, after the Fedora12-DVD installation system is built-in, CD installation is unclear.
#./Configure -- enable-gui -- enable-largefiles -- enable-menu -- prefix =/usr -- confdir =/etc/mplayer -- cc = gcc32
(Description: The parameters and mplayer configuration file settings are followed by configure. The -- cc = gcc32 parameter must be used to compile the program by calling gcc3.2, because I am looking for online tutorials may be older, specifically said that the mplayer-1.0pre7 does not support gcc4.0 compilation, to use 3.2 of the line, anyway, I am using this parameter compiled successfully, gcc4.0 or above I did not try, but my system Fedora12-DVD version installed, comes with gcc4.4.2, add this parameter in the end has no function, in the end the mplayer-1.0rc2 does not support gcc4.0 or above compilation, I do not know, I am also a cainiao. You can also use the gcc of a later version to give it a try. If this step is successful, it will be more stable in the future .)
# Make
# Make install
Now mplayer has been installed in your system, but don't worry.

3. Install skin
# Bzip2-cd standard-1.9.tar.bz2 | tar xvf-C/usr/share/mplayer/Skin/
# Mv/usr/share/mplayer/Skin/standard/usr/share/mplayer/Skin/default/
In fact, the extracted skin file is put in the skin folder of mplayer, because the mplayer main program just installed does not contain any skin files. The default skin folder is the default skin. If you want to add more skins later, directly put the skin folder, such as the skin named abc, decompress the package and put it under/usr/share/mplayer/Skin/. Then, you can change it in the settings of the mplayer graphic interface. Now you have the default and abc skins.

4. Start mplayer
After completing the above steps, you should have a shortcut of "MPlayer Media Player" under "audio and video" in the Application menu. You can click it to start it.

To start mplayer in the command line, follow these steps:
Run the cd command to enter the folder where you want to store videos or songs.
$ Mplayer xxx. avi
Or
$ Gmplayer xxx. avi
Mplayer is used to start a player without a graphic interface control panel.
Gmplayer is used to start a player with a graphic control panel.
Run the man mplayer command to view the command line usage.

You can also create a desktop starter:
Right-click the desktop and choose "create initiator" from the shortcut menu. The name is MPlayer or self-developed. The command is/usr/bin/gmplayer or/usr/bin/mplayer (the difference is the same as above ), mplayer default icon in/usr/share/pixmaps/mplayer-desktop.xpm

5. Other problems and solutions

The mplayer-unable-to-find-pcm0 error prompt:
Select the audio tab in the Preferences setting option of mplayer, and try the driver one by one to enable your mplayer pronunciation. I can use sdl -- SDLlib audio output, and then select the configure driver button, in Device, I chose alsa. If you cannot, try another one. Click OK to complete the settings.

The following error occurs during playback of some avi files:
One method I collected
Original article: I was having the same problem with some. avi files when it came to the "frame sync error ".
I fixed it by changing the audio codec family from FFmpeg/libavcodec audio decoders to AAC (MPEG2/4 Advanced Audio Coding ).
Try that and see how it works (Preferences-> Audio codec family)
I am too lazy to translate English
However, my problem is that this method is not completely solved. Normal playback is okay. This prompt is still displayed after fast forward and fast return. No matter what, now I will use the command line mplayer to play the video, make this error prompt appear in the command line, so that it will not disturb my viewing, HOHO.

Solutions for garbled Chinese subtitles:
First, install an available Chinese font. The fedora system also comes with it. You can also download one. I downloaded it from. ttf font, and put it in $ HOME /. mplayer/folder (Description: $ HOME is your current user's variable directory. cd $ HOME /. mplayer), and then use the mv command to name the TTF font subfont. ttf
Use the following playback commands in the command line mplayer to display Chinese characters.
$ Mplayer xxx. avi-sub xxx. srt-font $ HOME/. mplayer/subfont. ttf-utf8
(If you use the utf8 encoding format for srt Subtitles, use the-utf8 parameter. Generally, the online srt Subtitles are edited by netizens in windows, therefore, most of the time is gbk encoding. The parameter-subcp GB is used for gb encoding, and the parameter-subcp GB2312 is used for gb2312 encoding. The parameter-utf8 is used for utf8 encoding, my current practice is to directly open the downloaded srt Subtitles in the gedit and other file editors, and save them as a copy in utf8 encoding format to replace the original srt Subtitles, I will use the-utf8 parameter in the future, so I am too lazy to determine the encoding. Haha.
As for how to display subtitles in command line playback when subtitle files contain multi-track Subtitles such as simplified, traditional, and English, I have not struggled with it yet.
I have not successfully solved the problem of displaying Chinese subtitles in gmplayer graphics.

6. Uninstall mplayer
Cd command to enter the MPlayer-1.0rc2 that you use make and make install to install, execute
# Make uninstall
You can delete it. Therefore, it is easier to keep the original installation directory after mplayer is installed. However, if you delete this directory, it does not matter. Simply delete the mplayer installation directory. linux does not have a windows Registry. You can delete it with confidence ~ The deletion is clean.



I have edited this post for more than two hours. One is to help the same small-white users as me (every time I see someone asking me how to install it, I think of my lucky attempts, I can't help myself.) Second, I also made a summary of my own installation method and forgot it on the red link.
Installing mplayer is a common problem. I am also a cainiao. For the above content, if the old birds think it can be improved or there are different methods, please yell at it and let me wait for the cainiao to make improvements.
In addition, I have mentioned that I have not solved the problem. Please help me ~

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.