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

本文介绍如何在Ubuntu 8.10系统中安装Win32Codecs,并通过添加源的方式安装最新版本的MPlayer。此外,还详细介绍了如何从源代码编译MPlayer及CoreAVC,包括配置、打补丁和安装步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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,以及破解版的CoreAVCDecoder.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



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

代码:
sudo chmod 644 /usr/lib/codecs/CoreAVCDecoder.ax



第三步 顺序是:处理Coreavc---注册CoreAVCDecoder.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. 注册CoreAVCDecoder.ax

代码:
registercodec -r ~/.mplayer/registry32 -k "HKLM//Software//CoreCodec//CoreAVC Pro//Serial" -v "0OKWX-E83B3-CORE-IQ0UW-3I3B7"


然后验证dshowserver是否工作:

代码:
dshowserver -c CoreAVCDecoder.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 "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。

代码:
sudo mv /usr/bin/mplayer /usr/bin/mplayer.apt


好,现在,大功告成。哪怕是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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值