免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 946 | 回复: 0
打印 上一主题 下一主题

Ubuntu6.06安装Mplayer全记录 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-05 10:58 |只看该作者 |倒序浏览

  • 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 .mplayer
    ln -sf /usr/share/fonts/truetype/arphic/uming.ttf .mplayer/subfont.ttf
    gedit .mplayer/gui.configsub_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的背景音效不见了.
这会听歌,看电影都没问题了,总算可以休息休息了......



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13279/showart_314818.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP