正文

Linux下MPlayer安装手记2009-02-25 11:13:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/xman/41044.html

分享到:

版本信息:

Linux系统版本RHEL5.5(i386-redhat-linux)

Kernel版本:2.6.18-53.el5

(由#uname -r命令获得)

gcc 版本4.1.2 20070626 (Red Hat 4.1.2-14)

(由#gcc -v命令获得)

安装mplayer需要四个包的安装:主程序,皮肤,codecs以及wincodecs(win32)。这四个程序都可以从以下两个网站下载:

http://www.mplayerhq.hu

http://www.mplayerhq.hu/MPlayer/releases/codecs/

 我下载的程序分别是以下四种:

(1)codecsall-20071007.tar.bz2

(2)wincodecswindows-all-20071007.zip

(3)mplayer src code pkgMplayer-1.0rc2.tar.bz2

(4)SkinAbyss-1.7.tar.bz2

然后从Windows下搜索*.ttf,查找到字体文件simkai.ttf和以上四个文件一起放到/home/fan/MPlayer文件夹中。

首先在终端进入MPlayer文件夹:[root@localhost ~]# cd /home/fan/MPlayer

1.安装编码器

Mplayer默认/usr/local/lib/codecs/文件夹中查找解码器(我们可以运行不带参数的./configure来查看其默认解码器搜索目录)。这里我们将解码器指定安装在

/usr/lib/codecs//usr/lib/wincodecs文件夹中:

<1>安装codecs

[root@localhost ~]# cd /home/fan/MPlayer

[root@localhost MPlayer]# tar vjxf essential-20071007.tar.bz2

[root@localhost MPlayer]# mv all-20071007 /usr/lib/codecs

<2>安装windcodecs

[root@localhost MPlayer]# unzip windows-essential-20071007.zip

[root@localhost MPlayer]# mv windows-all-20071007 /usr/lib/wincodecs

2.安装MPlayer

[root@localhost Mplayer]# tar vjxf Mplayer-1.0rc2.tar.bz2

[root@localhost Mplayer]# cd Mplayer-1.0rc2

[root@localhost MPlayer]# ./configure  --enable-gui  --enable-menu --prefix=/usr  --codecsdir=/usr/lib/codecs/ --win32codecsdir=/usr/lib/wincodecs/  --language=zh_CN –confdir=/etc/mplayer

注意:

--prefix=/usr 是安装路径

--enable-gui 安装图形化用户界面

--enable-menu 安装菜单

--codecsdir=/usr/lib/codecs/指定解码位置(此处命令已经改变,以前要加with)

--win32codecsdir=/usr/lib/wincodecs 指定解码位置(此处命令已经改变,以前要加with)

--language=zh_CN 中文

[root@localhost MPlayer]# make

[root@localhost MPlayer]# make install

注意这里的./configure命令,Mplayer-1.0rc2版本支持gcc4编译,如果是更低的Mplayer版本,则可能只支持gcc3,则要安装gcc3glib-1.2.10gtk+-1.2.10,以下链接可下载glib-1.2.10tar.gzgtk+-1.2.10.tar.gz----ftp://ftp.gtk.org/pub/gtk/v1.2相应的./configure命令参数可能不同。

3.安装字体

把你想用的字体(如 simsun.ttf windows系统的字体目录下c\windows\font\),root用户放到/root/.mplayer

(一般用户则放在/home/<你的用户名>/.mplayer 下),这里以root用户为例。

[root@localhost MPlayer]# cp ./simkai.ttf /root/.mplayer/

[root@localhost MPlayer]# mv /root/.mplayer/simkai.ttf /root/.mplayer/subfont.ttf

4.安装皮肤

[root@localhost Mplayer]# tar vjxf Abyss-1.7.tar.bz2

[root@localhost Mplayer]# mv ./Abyss/ /usr/share/mplayer/skins/

[root@localhost MPlayer]# cd /usr/share/mplayer/skins/

[root@localhost skins]# ln -s Abyss default

5.运行MPlayer

gmplayer所在目录: /usr/local/bin/mplayer,我们可以直接点击gmplayer图标运行播放器。通常在开始菜单的影音菜单中能找到MPlayer启动应用程序->影音->MPlayer,右击MPlayer播放界面,Open即可打开需要播放的文件,经测试:

1wmv:弹出以下Error提示,但能正确播放

Error:Could not open required DirectShow codec wmvdmod.dll.

2wmv:弹出以下Error提示,能正确播放视频,但无音频

Error:Can not find codec for audio format 0x162.

3wmv:能正确播放,播放期间弹出以下Error提示

Error:J-type picture is not supported

4rm:弹出以下Error提示,有的能播放,有的不能

Error:Cannot find codec matching selected -vo and video format 0x30345652.

5rmvb:弹出以下Error提示,不能播放

Error:Cannot find codec matching selected -vo and video format 0x30345652.

6.不能播放rm/rmvb文件的解决方案
在终端启动
MPlayer:#gmplayer,这样启动主要是能看到到底哪里出错了。每当播放rm rmvb时就有以下错误提示:
================================
Opening video decoder: [realvid] RealVideo decoder
Error: libstdc++.so.5: cannot open shared object file: No such file or directory
Win32 LoadLibrary failed to load:drvc.so,/usr/lib/codecs/drvc.so,/usr/lib/win32/drvc.so, /usr/local/lib/win32/drvc.so
Error loading dll
………………
================================
但我在
/usr/lib/下发现有libstdc++.so.6libstdc++.so.6.0.8
/usr/lib/codecs下发现有
drvc.so
如是我就建立一个链接:

[root@localhost ~] # ln -s /usr/lib/libstdc++.so.6.0.8 /usr/lib/libstdc++.so.5
这样仍旧报错:

====================================
Error: /usr/lib/libstdc++.so.5: version `GLIBCPP_3.2' not found (required by /usr/lib/codecs/drvc.so)
Win32 LoadLibrary failed to load: drvc.so, /usr/lib/codecs/drvc.so, /usr/lib/win32/drvc.so, /usr/local/lib/win32/drvc.so
Error loading dll
………………
====================================
看来还是
gcc版本的问题了,因为我的RHEL5.5自带的gcc4.1.2,这里需要gcc3.2编译。
在网上找了很久终于发现《
libstdc++.so.5丢失的处理办法》一文:
http://hi.baidu.com/wangwader/blog/item/c87b44cdebd021550fb34584.html
上的处理方法,于是我就试了一下:

下载http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/compat-libstdc++-33-3.2.3-47.3.i386.rpm
再安装
[root@localhost ~]# rpm -ivh compat-libstdc++-33-3.2.3-47.3.i386.rpm

安装这个包估计主要解决gcc编译时的版本问题,但是这样播放rm,rmvb时还是弹出Error消息框:Cannot find codec matching selected- vo and video format 0x30345652.并且桌面右下方有个五角星提示SELinux显示错误: SELinux AVC denial,这时只要对解码器进行以下处理:

[root@localhost ~]# chcon - t textrel_shlib_t /usr/lib/codecs/drv*
终于,机子上的什么
.mp3.wma.wmv.mpeg.avi.rm.rmvb都能播放了

参考:

http://www.linuxsir.org/main/?q=node/169

http://industry.ccidnet.com/art/321/20070326/1045091_1.html

阅读(8753) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册