先要感谢以下几位同学的贴子,正是因为有了这几篇,我才搞懂了整个过程。
testtest22 的
[分享]Mplayer+CoreAVC for Linux播放1080p高清很流畅
2ig2ag 的
CoreAVC for linux(低配CPU看高清视频)
讲得最清楚的是这篇
mplayer加CoreAVC播放H.264安装指南
正式开始
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
代码: 全选
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
安装win32codecs包
如果是intel的CPU
代码: 全选
sudo apt-get install w32codecs
代码: 全选
sudo apt-get install w64codecs
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的快乐分隔线------------------------------------------------------
6楼的兄弟提供了更简洁的编译安装办法和更高版本的CoreAVCDecoder.ax,值得参考。
3. 准备编译mplayer+Coreavc。
第一步:(引自6楼)安装依赖包,比我原来的build-deb方式更简洁。。而且现在用build-deb,最后会出错,用这个是正确的。
代码: 全选
#BASIC
sudo apt-get install build-essential
#GTK support
sudo apt-get install libgtk2.0-dev
#XV support
sudo apt-get install libxv-dev
#ALSA support
sudo apt-get install libasound2-dev
#PULSE support
sudo apt-get install libpulse-dev
下载SVN版的mplayer(只有SVN版的mplayer才能安上Coreavc)
代码: 全选
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
代码: 全选
svn checkout http://coreavc-for-linux.googlecode.com/svn/trunk/ coreavc-for-linux
代码: 全选
sudo chmod 644 /usr/lib/codecs/CoreAVCDecoder.ax
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
b. 注册CoreAVCDecoder.ax
代码: 全选
registercodec -r ~/.mplayer/registry32 -k "HKLM\\Software\\CoreCodec\\CoreAVC Pro\\Serial" -v "0OKWX-E83B3-CORE-IQ0UW-3I3B7"
代码: 全选
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
代码: 全选
cd mplayer
./configure --enable-gui --enable-menu --enable-freetype --enable-debug --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 ~/.mplayer/codecs.conf
代码: 全选
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
代码: 全选
sudo mv /usr/bin/mplayer /usr/bin/mplayer.apt
注:以上编译过程在Eeepc 1000H、ubuntu8.10上完成。不敢保证其他机型也能顺利成功完成。
附:参考资料
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
P.S. 如果你觉得Coreavc解码器的确好用,那最好还是去注册。普通版$7.95,PRO版$14.95。网址是http://www.coreavc.com/
09.03.07
更新CoreACDDecoder.ax为1.9版。/color] 简单说明:
下载后解压,连同nvcuvid.dll一起CP到/usr/lib/codecs里。使用前,需要重新输入注册码(方法上面有)
正确的话,
输入
代码: 全选
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
Called unk_IsDebuggerPresent
len: 992
ProductVersion: 1.9.0
Decoder supports the following YUV formats: YUY2 UYVY YV12 I420
Decoder is capable of YUV output (flags 0x2b)
Setting fmt
Starting
Initialization is complete