到 http://www.mplayerhq.hu/MPlayer 下载相关的包

1.Mplayer-1.x.tar.bz2(主程序)

2.all(essensial)-20071007.tar.bz2

3.windows-all(essensial)-20071007.zip(据说rmvb需要这个)

4.Cleanlooks(皮肤)

5.gb2312-ming.tar.bz2(中文字体)

http://www.mplayerhq.hu/MPlayer/contrib/fonts/chinesefonts/gb2312-mi
ng.tar.bz2


安装过程(以root身份打开):

mkdir /usr/local/lib/codecs/
mkdir /usr/local/lib/wincodecs/
tar jxvf all-20071007.tar.bz2
mv all-20071007/* /usr/local/lib/codecs/
unzip windows-20071007.zip
mv windows-20071007/* /usr/local/lib/wincodecs/


安装mplayer

tar jxvf MPlayer-1.x.tar.bz2
cd MPlayer-1.x
./configure --codecsdir=/usr/local/lib/codecs/ --enable-gui --enable-menu --prefix=/usr/local/mplayer --mandir=/usr/share/man --win32codecsdir=/usr/local/lib/wincodecs/ --enable-largefiles --disable-tv --enable-freetype --disable-inet6 --enable-gl --enable-xv --enable-x11 --disable-ivtv --language=zh_CN --cc=gcc32

说明一下参数

--prefix 安装路径
--codecsidr
--win32codecsdir 解码位置
--enable-gui 安装图形化界面
--enable-freetype 调节字体
--disable-ivtv #我装的时候提示vo_ivtv.o的错误将disable即可
--language=zh_CN 中文(可不写)
--cc=gcc32(有人说gcc4编译器编译会产生错误所有才用这个)
其他的看大概意思也能懂。。。

当提示错误的时候如Error:X11我会装gtk-2devel和glib2-devel

yum install gtk2-devel
yum install glib2-devel

3步安装:

1.刚刚的./configure....——提示没有error才进行下一步
2.make (大概10分钟)注意有没有提示错误
3.make install

注意提示缺什么包,

另外,如果X11,Xv选项如果是no,一定要安装libX11-dev(el),libXv-dev(el)这些包

关于mplayer的编译错误可以看这篇:

http://hi.baidu.com/peking1987/item/614c644a51705de81f19bc75

如果make出错,那么需要:

make clean

基本上的编译错误都提及到(记一下,免得博主删blog了):

1. The GUI requires libavcodec with PNG support (needs zlib).
solution:
sudo apt-get install zlib1g-dev
sudo apt-get install libxv-dev
2. vo_ivtv.c: In function 'ivtv_reset':
vo_ivtv.c:79: error: storage size of 'sd' isn't known
vo_ivtv.c:80: error: storage size of 'sd1' isn't known
vo_ivtv.c:84: error: 'IVTV_STOP_FL_HIDE_FRAME' undeclared (first use in this
function)
solution:
because i don't want ivtv used on my pc, so i use --disable-ivtv to reconfigure it.
3. undefined reference to `video_out_ivtv'
collect2: ld returned 1 exit status
solution:
in file libvo/video_out.c, where
#ifdef HAVE_DXR2
extern vo_functions_t video_out_dxr2;
#endif
extern vo_functions_t video_out_dxr3; // ошибка сделана тут
#ifdef HAVE_IVTV
extern vo_functions_t video_out_ivtv;
#endif
edit it like this:
#ifdef HAVE_DXR2
extern vo_functions_t video_out_dxr2;
#endif
#ifdef HAVE_DXR3
extern vo_functions_t video_out_dxr3; / / Added patch HAVE_DXR3 because that is not compiling mplayer
#endif
#ifdef HAVE_IVTV
extern vo_functions_t video_out_ivtv;
#endif

我在make的时候遇到错误2,解决成功,libvo/目录在安装目录,看--prefix参数zhu

接下来应该安装皮肤,使用Abyss-1.7.tar.bz2这个皮肤

http://www2.mplayerhq.hu/MPlayer/skins/

之前使用的Cleanlook皮肤提示出错,搜答案网友就说不同皮肤可能导致出错,要多试几个,因为试过这个没问题了,暂时先用这个吧。。。

可以运行看看有没有其他错误~

cd /usr/local/mplayer/bin
./gmplayer

但还是提示错误关于subfont.ttf,其实是没有字体,网上都建议到/usr/share/fonts/chinese/Thre Type/目录下cp umint.ttf到$HOME/.mplayer目录下,再:

mv uming.ttf subfont.ttf

但我的即使没有这样做都不影响字体的播放~~

接下来是播放。。。

天哪。。。搞了我这么久,快晕了。。。

播放还有另外一种方式。。。

mpalyer /路径/要播放的媒体文件名;如 mpalyer -vo xv xxx.avi -zoom -x 1920 -y 1080

快晕的是:居然没有声音!!!

不过很快就网上搜到了。。。

mknod /dev/dsp c 14 3
chmod 666 /dev/dsp

不过swf文件只能播放声音不能播放图像。。。我还是再看看。。。。

卸载的命令记一下~~

make uninstall #当然必须到它的目录下啦~~~

再记一个网址,关于参数的设置和包、错误都提及可以~

http://blog.sina.com.cn/s/blog_4b5039210100f7w6.html