免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1633 | 回复: 0
打印 上一主题 下一主题

mplayer加CoreAVC播放H.264安装指南 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-22 23:29 |只看该作者 |倒序浏览

                                今天研究了mplayer加coreAVC来播放高清H.264电影,总结了一下,跟大家分享.

(如果某些指令无权限请注意在开头加sudo)
A. 从svn上下载两样东西:
(如果你的linux还不支持svn那么请安装此包: sudo apt-get install subversion)
1. svn checkout
[color="#0000ff"]svn://svn.mplayerhq.hu/mplayer/trunk
mplayer
(注意:要支持coreavc的codecs则一定要使用svn的mplayer版本,要不补丁会打不上去,最终的videocodec  coreserve 也无法真正支持)
2. svn checkout
[color="#0000ff"]http://coreavc-for-linux.googlecode.com/svn/trunk/
coreavc-for-linux

B. 建议直接从
http://code.google.com/p/coreavc-for-linux/downloads/list
下最近的bin文件,
然后把coreavc-for-linux中的dshowserver和registercodec拷到/usr/local/bin目录中

C. CoreAVCDecoder.ax这个codecs库则直接从网上下载,在此我提供了CoreAVC1[1].7.tar.gz的下载.

文件:
CoreAVC1[1].7.tar.gz
大小:
224KB
下载:
下载
按照此方法注册:
如果用到dshowserver:
registercodec -r ~/.mplayer/registry32 -k "HKLM\\Software\\CoreCodec\\CoreAVC Pro\\Serial" -v "0OKWX-E83B3-CORE-IQ0UW-3I3B7"
如果用mplayer or xine的话:
registercodec -r ~/.mplayer/registry -k "HKLM\\Software\\CoreCodec\\CoreAVC Pro\\Serial" -v "0OKWX-E83B3-CORE-IQ0UW-3I3B7"
不放心的话可以两个都执行一下.
可以用registercodec -r ~/.mplayer/registry32 -l 查看是不是写进去了,可重复执行上面的导入命令,变换注册码

验证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
表明这个解码器已经可以工作了

D. 配置和编译mplayer
进入svn的mplayer目录执行:
./configure --prefix=/usr/local/mplayer --enable-gui --enable-freetype --codecsdir=/usr/lib/codecs --win32codecsdir=/usr/lib/win32  --language=zh_CN
如果出现错误信息请查看我的另一篇文章<
[color="#02368d"]linux平台mplayer的编译安装方法

打上dshowserve的补丁:
patch -p0
make
make install
mplayer将安装到/usr/local/mplayer/bin

E.为mplayer添加视频codec设置
查看下~/.mplayer/codecs.conf文件,如果没有拷一个过去:
cp /etc/codecs.conf ~/.mplayer/
vi 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

到此就大功告成了.
Tips:
to use coreavc, you may need to add '-vc coreserve' (assuming you use the above codecs.conf options)
you may also need to use '-demuxer lavf' for some formats (TS streams for example)
with current mplayer you may also need -no-correct-pts to prevent jerky playback.



               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/81801/showart_1332833.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP