How to install and set Mplayer in linux (and how to load and display Chinese subtitles)

Source: Internet
Author: User
Download

Various software required by mplayer
(Share an FTP resource http://www.mplayerhq.hu/MPlayer/ related to mplayer)

(1) download the mplayer source code installation package
MPlayer-1.0rc2.tar.bz2
PointHereDownload

(2) download your favorite skin
Example you download Abyss-1.6.tar.bz2
PointHereDownload

(3) download the required code
All-20071007.tar.bz2
PointHereDownload
Windows-all-20071007.zip
PointHereDownload

Install

(1) install the main program source code package (CODE)
Mkdir/usr/lib/codecs
Mkdir/usr/lib/wincodecs
Tar jxvf all-20071007.tar.bz2
MV all-20060611/*/usr/lib/codecs
Unzip windows-all-20071007.zip
Music videos for Windows-all-20071007/*/usr/lib/wincode

(2) install mplayer
Tar jxvf MPlayer-1.0rc2.tar.bz2
CD MPlayer-1.0rc2
. /Configure -- prefix =/usr/local/mplayer -- enable-gui -- enable-freetype -- codecsdir =/usr/lib/codecs/-- win32codecsdir =/usr/lib/wincodecs /-- language = zh_CN

Note:
-- Prefix =/usr/local/mplayer is the installation path
-- Enable-gui installation graphical user interface
-- Enable-freetype adjust the font
-- Codecsdir =/usr/lib/codecs/
-- Win32codecsdir =/usr/lib/wincodecs specify the decoding location
-- Language = zh_CN Chinese

Next
Make
Make install

(3) install skin
Tar jxvf Abyss-1.6.tar.bz2
Mv Abyss/usr/local/mplayer/share/mplayer/skins/
Cd/usr/local/mplayer/share/mplayer/skins/
Mv Abyss default

(4) debugging
Cd/usr/local/mplaer/bin/
./Mplaer
Open a file and play it back.
See if some formats can be inserted.

Appendix 1:
Solutions to Garbled text when loading subtitles and displaying Chinese subtitles

Solution 1: Configuration File
Open ~ /. Mplayer/config, add the following configuration
Font =/usr/share/fonts/simsun. ttc
Ubfont-encoding = unicode
Subcp = cp936
Subfont-autoscale = 2
Subfont-text-scale = 3
Vo = xv
The subtitle file name must be the same as the avi file name. You can use the command line to play a video with subtitles.

Solution 2: Command Parameters
Run the following command to open the file:
./Mplayer xxx. avi-subcp cp936-subfont-encoding unicode-font/usr/share/fonts/truetype/arphic/uming. ttf-subfont-text-scale 3
This is a success. This method is successfully tested on openSUSE v11.0.
However, the screen cannot maintain the aspect ratio when the full screen is not solved. Continue the next time.

Appendix 2:
Full Screen Aspect Ratio generation parameter command Solution
./Mplayer-fs-aspect 16: 9/video_path.avi
Parameter description:
-Fs full screen mode
-Aspect ratio (you can also write 4: 3 or the like. I just saw that the aspect ratio of Qibao qibing 4 is)

Appendix 3:
After installation according to the above scheme, if you use -- prefix to specify a special installation path during configure, you must enter it in the corresponding bin directory to run mplayer. /mplayer is effective, so that it is not convenient to use each time. Add this sentence to. bashrc (also the bash configuration file for some operating systems is. bash_profile) in the user's main directory (usually/home/user_name /).
Alias mplayer = '/usr/local/mplayer/bin/mplayer' (absolute path of the executable program)
Save, log out, and log on again. In the future, you can directly use the mplayer command in any directory.

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.