现在的位置: 首页 > 综合 > 正文

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

2017年12月20日 ⁄ 综合 ⁄ 共 4021字 ⁄ 字号 评论关闭
 



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

抱歉!评论已关闭.