您的位置:首页 > 运维架构 > Linux

linux下mplayer(ffmpeg)通过x264解码播放高清h264视频

2014-08-12 15:38 441 查看
系统环境:Linux inbank-GZ 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/LinuxUbuntu 8.04Genuine Intel(R) CPU 1250 @ 1.73GHz * 21G内存
目标:能用mplayer播放H264格式的高清视频
下载相关软件
Mplayer1.1版本(包含了ffmpeg)
各类解码包codes
x264
yasm + faac + faad

可以在这里下载全部包 http://down.51cto.com/data/1861780

2.编译相关软件

解压all-20110131后将文件拷贝到新建好的/usr/local/lib/codecs目录

编译yasm + faac + faad
./configure && make && make install

编译x264

./configure --enable-shared && make && make install
编译mplayer
chmod 775 -R MPlayer-1.1.1/
./configure --enable-x264 --extra-libs="-lx264 -lfaac" && make && make install

3.mplayer命令操作

如果是在后台命令行操作,要先敲命令export DISPLAY=:0.0
然后mplayer -vo x11 -fixed-vo -geometry 0:0 -quiet -slave -demuxer lavf fenggu.mpg
4.FAQ

报错
vo: couldn't open the X11 display ()!

要先敲export DISPLAY=:0.0

报错

/opt/MPlayer-1.0rc4/libavcodec/libx264.c:305: undefined reference to `x264_encoder_headers'
collect2: ld returned 1 exit status
make: *** [mplayer] Error 1

则要在编译的时候加入相应的库 --extra-libs="-lx264 -lfaac"

报错
video: cannot read properties
要加入参数 -demuxer lavf

本文出自 “李城” 博客,请务必保留此出处http://licheng1987.blog.51cto.com/9141096/1539020
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐