1. 如何安装win32codecs
比起手动安装来,我更推荐加源安装的方法。medibuntu是目前最好的源。
以ubuntu8.10为例
先加源
然后加GPG Key
这一步时可能会有未验证之类的错误提示,回答yes,或y让它继续进行即可。
安装win32codecs包
如果是intel的CPU
如果是64位 CPU
OK,完成win32codecs的安装
2. 从源里安装mplayer。这一步很重要,因为我们需要用源里的mplayer来确定依赖关系,要不然,编译的mplayer很可能会缺少某些功能。
8.10源里的mplayer仍是1.0rc2,有点老。我们可以加个源用新的
在末尾加上
deb-src http://ppa.launchpad.net/rvm/ubuntu intrepid main
保存后
执行到这一步,不想编译的同学就可以止步了。你将得到一个版本比较新的mplayer和smplayer。但有可能mplayer会有问题。源里的mplayer要稳定得多。
---------------------------------------编译mplayer的快乐分隔线------------------------------------------------------
3. 准备编译mplayer+Coreavc。
第一步(重要)
第二步 下载mplayer,下载Coreavc,以及破解版的CoreAVCDecoder.ax。
下载SVN版的mplayer(只有SVN版的mplayer才能安上Coreavc)
用SVN版下载Coreavc
下载CoreAVCDecoder.ax破解包。内有安装说明。解压后将CoreAVCDecoder.ax拷贝到/usr/lib/codecs目录中,然后更改此文件权限为所有用户可读。
第三步 顺序是:处理Coreavc---注册CoreAVCDecoder.ax--配置mplayer--打补丁--编译--完成
a. 处理Coreavc(以intel CPU为例 )
make -C dshowserver
然后
sudo cp dshowserver/registercodec /usr/local/bin
对于64位CPU,应该到http://code.google.com/p/coreavc-for-linux/downloads/list下载最新的包。然后把dshowserver和registercodec拷贝到/usr/local/bin目录中。
b. 注册CoreAVCDecoder.ax
然后验证dshowserver是否工作:
如果输出信息如下,那就表示解码器工作正常。
Opening device
len: 992
ProductVersion: 1.7.0Decoder supports the following YUV formats: YUY2 UYVY YV12 I420
Decoder is capable of YUV output (flags 0x2b)
Setting fmt
Starting
Initialization is complete
c. 配置mplayer和打补丁,在打补丁之前,一定要先./configure,要不然是打不上补丁的。
./configure --enable-gui --enable-freetype --codecsdir=/usr/lib/codecs --language=zh_CN
打补丁
然后编译安装
sudo make install
最后还有一步
编辑~/.mplayer/中的codecs.conf文件。如果没有这个文件,就拷贝一个过去
gedit codecs.conf
把下面这一段拷贝到codecs.conf中,VIDEO CODECS部分的最前面。
info "CoreAVC DShow H264 decoder 1.3 for x86 - http://corecodec.org/"
status working
format 0x10000005
fourcc H264,h264 H264
fourcc X264,x264
fourcc avc1,AVC1 AVC1
fourcc davc,DAVC
fourcc VSSH
driver dshowserver
dll "CoreAVCDecoder.ax"
guid 0x09571a4b, 0xf1fe, 0x4c60, 0x97, 0x60, 0xde, 0x6d, 0x31, 0x0c, 0x7c, 0x31
out YV12,IYUV,I420,YUY2
最后,把从源里安装的mplayer改个名,保证以后调用的都是编译的mplayer。
好,现在,大功告成。哪怕是Atom CPU,也能基本流畅地播放720P视频了。
注:以上编译过程在Eeepc 1000H、ubuntu8.10上完成。不敢保证其他机型也能顺利成功完成。
另外,6楼的兄弟提供了更简洁的安装办法和更高版本的CoreAVCDecoder.ax,值得参考。
附:参考资料
coreavc地址及官方教程
http://code.google.com/p/coreavc-for-li ... stallation
http://code.google.com/p/coreavc-for-li ... verInstall
mplayer的普通编译安装
http://blog.chinaunix.net/u2/81801/showart_1330801.html
medibuntu官方指南
https://help.ubuntu.com/community/Medibuntu