当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > Ubuntu6.06 Linux安装Mplayer过程解析

Linux服务器
Linux上双网卡绑定方法(Suse9SP3)
Linux操作系统调优参数的意义
Linux下使用SSH客户端及其Sftp文件传送
教你恢复被误删除的Linux文件
SQL Server注入大全及防御
Linux无法解析域名的解决办法
Linux系统下安装和配置MyEclipse的方法
Ubuntu下VirtualBox 1.4.0设置文件共享
Windows与Linux系统共享StarDict字典文件
修改Linux下相关的登陆信息
Windows通过SecureCRT远程登录Linux主机
Linux操作系统如何修改SWAP交换区的大小
Linux操作系统下为Apache目录添加密码
Linux时间设置与同步(NTP)
Linux内核补丁AMD旁路转换缓冲(TLB)错误
Linux架设DHCP服务器的方法
Fedora 8下Apache配置与管理
Linux操作系统下用单网卡捆绑双IP的方法
Ubuntu Linux系统环境变量配置文件
SUSE Linux中将Tomcat作为Service运行

Linux服务器 中的 Ubuntu6.06 Linux安装Mplayer过程解析


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 45 ::
收藏到网摘: n/a

sudo apt-get install mplayer-386

sudo apt-get install mplayer-fonts

sudo apt-get install mozilla-mplayer

sudo cp /etc/mplayer/mplayer.conf /etc/mplayer/mplayer.conf_backup

sudo gedit /etc/mplayer/mplayer.conf

找出下面这一行

... vo=x11, # To specify default video driver (see -vo help for...

以下面这一行取代

vo=xv, # To specify default video driver (see -vo help for

安装 w32codecs解码器(用于播放wmv、rmvb等常见windows平台下的多媒体文件;假设你已经添加了ubuntu-cn源。

$ sudo apt-get install w32codecs

配置中文字幕显示(可选)

cd ; mkdir .mplayerln -sf /usr/share/fonts/truetype/arphic/uming.ttf .mplayer/subfont.ttfgedit .mplayer/gui.config

sub_cp = "GBK"font_text_scale = "4.000000"font_osd_scale = "4.000000"sub_fuzziness=2

设置配置文件

gedit .mplayer/config

subcp=cp936

本以为用上面的方法就可以轻松搞定了,可惜网络不行,没下来,只好自己编译了。

1、下载相关codes(http://www.mplayerhq.hu/MPlayer/)主要都在这里

Mplayer-1.0rc1.tar.bz2(主程序)

Abyss-1.6.tar.bz2 (皮肤)

all-20061022.tar.bz2

windows-all-20061022.zip(建议不要在win下使用. rar,用. zip)

2、安装过程

a.安装相应的解码

sudo mkdir /usr/lib/codecs

sudo mkdir /usr/lib/wincodecs

tar jxvf all-20061022.tar.bz2

sudo mv all-20060611/* /usr/lib/codecs

unzip windows-all-20061022.zip

sudo mv windows-all-20060611/* /usr/lib/wincodecs

b.安装mplayer

tar jxvf MPlayer-1.0rc1.tar.bz2

cd MPlayer-1.0rc1

./configure --prefix=/usr/local/mplayer --enable-gui --enable-freetype --with-codecsdir=/usr/lib/codecs/ --with-win32libdir=/usr/lib/wincodecs/ --language=zh_CN

注意:

--prefix=/usr/local/mplayer 是安装路径

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

--enable-freetype 调节字体(可以防止Mplayer发生乱码)

--with-codecsdir=/usr/lib/codecs/

--with-win32libdir=/usr/lib/wincodecs 指定解码位置

--language=zh_CN 中文

出错:

Checking for inttypes.h (required) ... no

Checking for bitypes.h (inttypes.h predecessor) ...no

Error: Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/en/faq.h)

郁闷,估计又是什么开发库没有装,没办法google了下,看到网上有人说得装libc6-dev,装一个吧:

sudo apt-get install libc6-dev

运行过程中安装了两个包:libc6-dev linux-kernel-headers

再次运行configure,又出错了:

Checking for GUI ... yes

Error: The GUI requires PNG support, please install libpng and libpng-dev packages.

Check "configure.log" if you do not understand why it failed.

我哭,这个也没有啊,dpkg了下,系统里面是有libpng的,但是没有libpng-dev,接着get吧:

sudo apt-get install libpng12-dev

运行configure,再次出错,崩溃了.....

Error: X11 support required for GUI compilation.

去网上Google了下,需要GTK的dev包,继续get,我就不信了:

sudo apt-get install libgtk1.2-dev

这会安装了15个包:

libglib1.2 libglib1.2-dev libgtk1.2 libgtk1.2-common libgtk1.2-dev libx11-dev libxau-dev libxdmcp-dev libxext-dev libxi-dev pkg-config x11proto-core-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev

无语了......还好终与configure过了


接着make吧,又一次华丽的倒在了错误之下:

./version.sh `cc -dumpversion`

cc -c -Wdeclaration-after-statement -fno-PIC -O4 -march=prescott -mtune=prescott -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I. -I./libavutil -I./libavcodec -o mplayer.o mplayer.c

In file included from mplayer.c:59:

libvo/font_load.h:5:22: error: ft2build.h: No such file or directory

libvo/font_load.h:6:10: error: #include expects "FILENAME" or

In file included from mplayer.c:59:

libvo/font_load.h:40: error: expected specifier-qualifier-list before 'FT_Face'

make: *** [mplayer.o] 错误 1

其实在编译时加入--enable-freetype参数是为了解决字幕乱码的问题,但是加了之后make时出错.不加--enable-freetype是可以正常编译,不过GUI和字幕均为乱码.请教了N个人,最后得知,问题是因为当初安装编译环境的时候选择的是GTK1.2,更新为2.0既可顺利编译:

sudo apt-get install libgtk2.0-dev

make一下,各种warning,看得我都眼花,还好最后通过了,最后

sudo make install

c.安装皮肤

tar jxvf Abyss-1.6.tar.bz2

sudo mv Abyss /usr/local/mplayer/share/mplayer/skins/

cd /usr/local/mplayer/share/mplayer/skins/

sudo mv Abyss default


d.设置字体

个人比较喜欢幼园,所以复制个simyou.ttf过来,copy到~/.mplayer下面,改名成subfont.ttf

编辑下~/.mplayer下面的gui.conf:

sub_cp = “cp936″

font_factor = “0.750000″

font_encoding = "Unicode"

如果还有问题,请试着修改gui.conf文件中的sub_cp = “cp936″,把cp936换成其他的例如GB,GBK,GB2312,GB18030等等,总有一个行的。至于中文字幕就再说吧,没有看字幕的习惯,终于算是装上了,执行程序在/usr/local/mplayer/bin中,在桌面建个起动器,激动的时刻到来了,加入了一首歌Maria,居然没声!!!!!报错:

[AO OSS] audio_setup: Can't open audio device /dev/dsp: Device or resource busy

ao_nas: init(): Can't open nas audio server -> nosound

再次郁闷,仔细检查了下,Ubuntu的桌面环境使用的是Gnome,默认使用是esd (Enlightenment Sound Daemon),而不是我们通常使用的ALSA或者更老的OSS。esd的功能就是负责Gnome的背景音效,并且它有多音源同时发声的能力。自己安装的mplayer默认是使用OSS,导致在X下会提示"/dev/dsp被占用"之类的错误信息而不能正常使用,/dev/dsp就是被esd所占用了。

把ESD关了:System > Preferences > Sound Preferences 中反选 Enable sound server startup 和 Sounds for events,结果就一切都正常了,就是Gnome的背景音效不见了.