linux(CentOS6.4 i686)安裝MPlayer

到 http://www.mplayerhq.hu/MPlayer 下載相關的包

1.Mplayer-1.x.tar.bz2(主程序)

2.all(essensial)-20071007.tar.bz2

3.windows-all(essensial)-20071007.zip(據說rmvb需要這個)

4.Cleanlooks(皮膚)

5.gb2312-ming.tar.bz2(中文字體)

http://www.mplayerhq.hu/MPlayer/contrib/fonts/chinesefonts/gb2312-mi
ng.tar.bz2


安裝過程(以root身份打開):

mkdir /usr/local/lib/codecs/
mkdir /usr/local/lib/wincodecs/
tar jxvf all-20071007.tar.bz2
mv all-20071007/* /usr/local/lib/codecs/
unzip windows-20071007.zip
mv windows-20071007/* /usr/local/lib/wincodecs/


安裝mplayer

tar jxvf MPlayer-1.x.tar.bz2
cd MPlayer-1.x
./configure --codecsdir=/usr/local/lib/codecs/ --enable-gui --enable-menu --prefix=/usr/local/mplayer --mandir=/usr/share/man --win32codecsdir=/usr/local/lib/wincodecs/ --enable-largefiles --disable-tv --enable-freetype --disable-inet6 --enable-gl --enable-xv --enable-x11 --disable-ivtv --language=zh_CN --cc=gcc32

說明一下參數

--prefix 安裝路徑
--codecsidr
--win32codecsdir 解碼位置
--enable-gui 安裝圖形化界面
--enable-freetype 調節字體
--disable-ivtv #我裝的時候提示vo_ivtv.o的錯誤將disable即可
--language=zh_CN 中文(可不寫)
--cc=gcc32(有人說gcc4編譯器編譯會產生錯誤所有才用這個)
其他的看大概意思也能懂。。。

當提示錯誤的時候如Error:X11我會裝gtk-2devel和glib2-devel

yum install gtk2-devel
yum install glib2-devel

3步安裝:

1.剛剛的./configure....——提示沒有error才進行下一步
2.make (大概10分鐘)注意有沒有提示錯誤
3.make install

注意提示缺什麼包,

另外,如果X11,Xv選項如果是no,一定要安裝libX11-dev(el),libXv-dev(el)這些包

關於mplayer的編譯錯誤可以看這篇:

http://hi.baidu.com/peking1987/item/614c644a51705de81f19bc75

如果make出錯,那麼需要:

make clean

基本上的編譯錯誤都提及到(記一下,免得博主刪blog了):

1. The GUI requires libavcodec with PNG support (needs zlib).
solution:
sudo apt-get install zlib1g-dev
sudo apt-get install libxv-dev
2. vo_ivtv.c: In function 'ivtv_reset':
vo_ivtv.c:79: error: storage size of 'sd' isn't known
vo_ivtv.c:80: error: storage size of 'sd1' isn't known
vo_ivtv.c:84: error: 'IVTV_STOP_FL_HIDE_FRAME' undeclared (first use in this
function)
solution:
because i don't want ivtv used on my pc, so i use --disable-ivtv to reconfigure it.
3. undefined reference to `video_out_ivtv'
collect2: ld returned 1 exit status
solution:
in file libvo/video_out.c, where
#ifdef HAVE_DXR2
extern vo_functions_t video_out_dxr2;
#endif
extern vo_functions_t video_out_dxr3; // ошибка сделана тут
#ifdef HAVE_IVTV
extern vo_functions_t video_out_ivtv;
#endif
edit it like this:
#ifdef HAVE_DXR2
extern vo_functions_t video_out_dxr2;
#endif
#ifdef HAVE_DXR3
extern vo_functions_t video_out_dxr3; / / Added patch HAVE_DXR3 because that is not compiling mplayer
#endif
#ifdef HAVE_IVTV
extern vo_functions_t video_out_ivtv;
#endif

我在make的時候遇到錯誤2,解決成功,libvo/目錄在安裝目錄,看--prefix參數zhu

接下來應該安裝皮膚,使用Abyss-1.7.tar.bz2這個皮膚

http://www2.mplayerhq.hu/MPlayer/skins/

之前使用的Cleanlook皮膚提示出錯,搜答案網友就說不同皮膚可能導致出錯,要多試幾個,因爲試過這個沒問題了,暫時先用這個吧。。。

可以運行看看有沒有其他錯誤~

cd /usr/local/mplayer/bin
./gmplayer

但還是提示錯誤關於subfont.ttf,其實是沒有字體,網上都建議到/usr/share/fonts/chinese/Thre Type/目錄下cp umint.ttf到$HOME/.mplayer目錄下,再:

mv uming.ttf subfont.ttf

但我的即使沒有這樣做都不影響字體的播放~~

接下來是播放。。。

天哪。。。搞了我這麼久,快暈了。。。

播放還有另外一種方式。。。

mpalyer /路徑/要播放的媒體文件名;如 mpalyer -vo xv xxx.avi -zoom -x 1920 -y 1080

快暈的是:居然沒有聲音!!!

不過很快就網上搜到了。。。

mknod /dev/dsp c 14 3
chmod 666 /dev/dsp

不過swf文件只能播放聲音不能播放圖像。。。我還是再看看。。。。

卸載的命令記一下~~

make uninstall #當然必須到它的目錄下啦~~~

再記一個網址,關於參數的設置和包、錯誤都提及可以~

http://blog.sina.com.cn/s/blog_4b5039210100f7w6.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章