您的位置:首页 > 其它

ubuntu8.10下mplayer+win32codecs+Coreavc编译安装详解

2009-07-07 11:38 417 查看



document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
var text = clipboardData.getData("text");
if (text && text.length>300) {
text = text + "/r/n/n本文来自CSDN博客,转载请标明出处:" + location.href;
clipboardData.setData("text", text);
}
}, 100);
}
}

function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}
1. 如何安装win32codecs

比起手动安装来,我更推荐加源安装的方法。medibuntu是目前最好的源。

以ubuntu8.10为例

先加源

代码:

sudo wget http://www.medibuntu.org/sources.list.d/intrepid.list --output-document=/etc/apt/sources.list.d/medibuntu.list

然后加GPG Key

代码:

sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

这一步时可能会有未验证之类的错误提示,回答yes,或y让它继续进行即可。

安装win32codecs包

如果是intel的CPU

代码:

sudo apt-get install w32codecs

如果是64位 CPU

代码:

sudo apt-get install w64codecs

OK,完成win32codecs的安装

2. 从源里安装mplayer。这一步很重要,因为我们需要用源里的mplayer来确定依赖关系,要不然,编译的mplayer很可能会缺少某些功能。

8.10源里的mplayer仍是1.0rc2,有点老。我们可以加个源用新的

代码:

sudo gedit /etc/apt/sources.list

在末尾加上

代码:

deb http://ppa.launchpad.net/rvm/ubuntu intrepid main

deb-src http://ppa.launchpad.net/rvm/ubuntu intrepid main

保存后

代码:

sudo apt-get update
代码:

sudo apt-get install mplayer smplayer mplayer-fonts mozilla-mplayer

执行到这一步,不想编译的同学就可以止步了。你将得到一个版本比较新的mplayer和smplayer。但有可能mplayer会有问题。源里的mplayer要稳定得多。

---------------------------------------编译mplayer的快乐分隔线------------------------------------------------------

3. 准备编译mplayer+Coreavc。

第一步(重要)

代码:

sudo apt-get build-dep mplayer

第二步 下载mplayer,下载Coreavc,以及破解版的Core***CDecoder.ax。

下载SVN版的mplayer(只有SVN版的mplayer才能安上Coreavc)

代码:

svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

用SVN版下载Coreavc

代码:

svn checkout http://coreavc-for-linux.googlecode.com/svn/trunk/ coreavc-for-linux

下载Core***CDecoder.ax破解包
。内有安装说明。解压后将Core***CDecoder.ax拷贝到/usr/lib/codecs目录中,然后更改此文件权限为所有用户可读。

代码:

sudo chmod 644 /usr/lib/codecs/Core***CDecoder.ax

第三步 顺序是:处理Coreavc---注册Core***CDecoder.ax--配置mplayer--打补丁--编译--完成

a. 处理Coreavc(以intel CPU为例 )

代码:

cd coreavc-for-linux

make -C dshowserver

然后

代码:

sudo cp dshowserver/dshowserver /usr/local/bin

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. 注册Core***CDecoder.ax

代码:

registercodec -r ~/.mplayer/registry32 -k "HKLM//Software//CoreCodec//Core***C Pro//Serial" -v "0OKWX-E83B3-CORE-IQ0UW-3I3B7"

然后验证dshowserver是否工作:

代码:

dshowserver -c Core***CDecoder.ax -s 1280x720 -g 09571a4b-f1fe-4c60-9760de6d310c7c31 -b 12 -f 0x34363248 -o 0x30323449

如果输出信息如下,那就表示解码器工作正常。

代码:

输出:No id specified, assuming test mode

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,
要不然是打不上补丁的。

代码:

cd mplayer

./configure --enable-gui --enable-freetype --codecsdir=/usr/lib/codecs --language=zh_CN

打补丁

代码:

patch -p0 < ../coreavc-for-linux/mplayer/dshowserver.patch

然后编译安装

代码:

make

sudo make install

最后还有一步

编辑~/.mplayer/中的codecs.conf文件。如果没有这个文件,就拷贝一个过去

代码:

cp etc/codecs.conf ~/.mplayer/

gedit codecs.conf

把下面这一段拷贝到codecs.conf中,VIDEO CODECS部分的最前面。

代码:

videocodec coreserve

info "Core***C DShow H264 decoder 1.3 for x86 - http://corecodec.org/"
status working

format 0x10000005

fourcc H264,h264 H264

fourcc X264,x264

fourcc avc1,***C1 ***C1

fourcc davc,D***C

fourcc VSSH

driver dshowserver

dll "Core***CDecoder.ax"

guid 0x09571a4b, 0xf1fe, 0x4c60, 0x97, 0x60, 0xde, 0x6d, 0x31, 0x0c, 0x7c, 0x31

out YV12,IYUV,I420,YUY2

最后,把从源里安装的mplayer改个名,保证以后调用的都是编译的mplayer。

代码:

sudo mv /usr/bin/mplayer /usr/bin/mplayer.apt

好,现在,大功告成。哪怕是Atom CPU,也能基本流畅地播放720P视频了。

注:以上编译过程在Eeepc 1000H、ubuntu8.10上完成。不敢保证其他机型也能顺利成功完成。

另外,6楼的兄弟提供了更简洁的安装办法和更高版本的Core***CDecoder.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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: