Debian sequeeze编译coreavc 2.0+mplayer

UP HOME

Debian sequeeze编译coreavc 2.0+mplayer

好不容易终于编译出了sequeeze下的coreavc2.0+mplayer(2011-03-06),应该要比1.0 rc4更新吧。

这里记录以下整个编译过程,以防遗忘。

为什么要用coreavc

手上一台dell的笔记本,但是CPU不是很好,即使用mplayer+mepg-mt,播放720P,cpu基本100%,画面一卡一卡,所以决定用coreavc,虽然画质有损失,但是只要放着不卡就好。:)

下载源代码

mplayer源代码
http://www.mplayerhq.hu/MPlayer/releases/mplayer-checkout-snapshot.tar.bz2
coreavc源代码
svn checkout http://coreavc-for-linux.googlecode.com/svn/trunk/ coreavc-for-linux-read-only
其他

当然准备好你的coreavc 2.0也是必须的。当前的coreavc-for-linux需要wine运行,所以需要安装wine。 在/etc/apt/sources.list里增加如下:

deb http://www.lamaresh.net/apt squeeze main

安装wine

sudo aptitude install wine wine-dev

安装一些必要的编译包

编译准备工作

编译coreavc-for-linux
cd /dshowserver
make
sudo make install
安装coreavc 2.0
cd 
wine setup.exe

我在运行过程中得到一个错,这时按Ctrl+c,就跳出安装界面了。输入序列号完成安装。

注册测试CoreAVCDecoder.ax

拷贝CoreAVCDecoder.ax到 /usr/lib/codecs

sudo cp ~/.wine/drive_c/Program Files/CoreCodec/CoreAVC Professional Edition/CoreAVCDecoder.ax /usr/lib/codecs/

测试是否成功

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

成功的话输出如下

Starting wine dshowserver.exe.so
No id specified, assuming test mode
Opening device (port is 0)
len: 992
ProductVersion: 2.0.0
fixme:thread:SetThreadIdealProcessor (0x4c): stub
fixme:thread:SetThreadIdealProcessor (0x50): stub
Decoder supports the following YUV formats: YUY2 UYVY YV12 I420 
Decoder is capable of YUV output (flags 0x2b)
Setting fmt
Starting
Initialization is complete

编译

configure
cd 
CC=gcc-4.3 ./configure --enable-menu --enable-freetype --enable-debug --codecsdir=/usr/lib/codecs

这里使用gcc-4.3,第一次使用gcc4.4编译出来了好像不能用,改成4.3就好了,不知原因

patch
patch -p0 < ../coreavc-for-linux/mplayer/dshowserver.patch #安装dshowserver补丁

这个补丁打的时候会失败,主要是Makefile打补丁时,没打上,所以我修改了以下Makefile相关的地方

--- Makefile.orig       2011-03-06 13:15:09.000000000 +0800
+++ Makefile    2011-03-07 23:38:51.000000000 +0800
@@ -20,6 +20,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include config.mak
+EXTRALIBS += -lrt
 
 ###### variable declarations #######
 
@@ -476,6 +477,7 @@ SRCS_COMMON = asxparser.c \
               stream/stream_mf.c \
               stream/stream_null.c \
               stream/url.c \
+              libmpcodecs/vd_dshowserver.c \
               sub/eosd.c \
               sub/find_sub.c \
               sub/osd.c \
@@ -859,6 +861,7 @@ gui/%: CFLAGS += -Wno-strict-prototypes
 libdvdcss/%:   CFLAGS := -Ilibdvdcss -D_GNU_SOURCE -DVERSION=\"1.2.10\" $(CFLAGS_LIBDVDCSS) $(CFLAGS)
 libdvdnav/%:   CFLAGS := -Ilibdvdnav -D_GNU_SOURCE -DHAVE_CONFIG_H -DVERSION=\"MPlayer-custom\" $(CFLAGS)
 libdvdread4/%: CFLAGS := -Ilibdvdread4 -D_GNU_SOURCE $(CFLAGS_LIBDVDCSS_DVDREAD) $(CFLAGS)
+libmpcodecs/%: CFLAGS := $(CFLAGS) -g -O0
 
 loader/%: CFLAGS += -fno-omit-frame-pointer $(CFLAGS_NO_OMIT_LEAF_FRAME_POINTER)
 #loader/%: CFLAGS += -Ddbg_printf=__vprintf -DTRACE=__vprintf -DDETAILED_OUT

用上班这一段,替换原来补丁的中的Makefile那段内容

compile

这下应该没有问题了,开始编译,安装

make
sudo make install
configuration

在一切都完成后还要修改mplayer的配置文件

mkdir ~/.mplayer
cp /etc/codecs.conf ~/.mplayer/

并且在~/.mplayer/codecs.conf中增加如下内容

videocodec coreserve
  info "CoreAVC DShow H264 decoder x.x 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

这段内容可以写在文件的最后。

测试

现在运行一个720p的mkv看看,运行是需要加“-demuxer mkv”参数

$ mplayer Hereafter.2010.BluRay.720p.DTS.x264-CHD.mkv -demuxer mkv
MPlayer SVN-r33030-4.4.5 (C) 2000-2011 MPlayer Team
162 audio & 353 video codecs

Playing Hereafter.2010.BluRay.720p.DTS.x264-CHD.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "Hereafter.2010.BluRay.720p.DTS.x264-CHD", -vid 0
[mkv] Track ID 2: audio (A_DTS) "DTS 5.1 1510kbps", -aid 0, -alang eng
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO:  [avc1]  1280x534  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
Load subtitles in ./
==========================================================================
Opening video decoder: [dshowserver] DirectShowServer video codecs
[PP] Using codec's postprocessing, max q = 4.
Movie-Aspect is 2.40:1 - prescaling to correct movie aspect.
VO: [xv] 1280x534 => 1280x534 Planar YV12 
dshowserver --codec CoreAVCDecoder.ax --size 1280x534 --guid 09571a4b-f1fe-4c60-9760de6d310c7c31 --fourc 0x31637661 --bits 12 --outfmt 0x32315659 --pid 5769 --id b6e62700 --numpages 10 --port 45788 &
Starting wine dshowserver.exe.so
Opening device (port is 45788)
len: 992
ProductVersion: 2.0.0
fixme:thread:SetThreadIdealProcessor (0x50): stub
fixme:thread:SetThreadIdealProcessor (0x54): stub
Decoder supports the following YUV formats: YUY2 UYVY YV12 I420 
Decoder is capable of YUV output (flags 0x2b)
Setting fmt
Starting
Initialization is complete
Using socket based mutex
Found DirectShow filterSelected video codec: [coreserve] vfm: dshowserver (CoreAVC DShow H264 decoder x.x for x86 - http://corecodec.org/)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
EINPROGRESS in connect() - selecting
Dshowserver Connected to host
AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [ffdca] afm: ffmpeg (FFmpeg DTS)
==========================================================================
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...

一切顺利,成功,开心~~

Author: Shine Zhong

Date: 2011-03-08 10:34:18 CST

HTML generated by org-mode 7.4 in emacs 23

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/737564/viewspace-688611/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/737564/viewspace-688611/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值