Mplayer 移植
時間:2017-01-05作者:華清遠(yuǎn)見
關(guān)于mplayer移植網(wǎng)上資料很多,但都很混亂。在此,我做了一個關(guān)于mplayer 的詳細(xì)總結(jié)。在做之前好在解壓源碼包后,先通過./configure --help看一下相關(guān)配置。 X86的LINUX上已經(jīng)自帶了解碼庫,不需要另外安裝解碼庫,而arm平臺自己做的文件系統(tǒng)沒有解碼庫,需要另外安裝解碼庫。
下載MPlayer:MPlayer-1.0rc2.tar.bz2 一、在x86的LINUX上安裝mplayer
1 #./configure (./configure --enable-gui –-enable-live –-language=zh )
此時在MPlayer-1.0rc2目錄下會生成可執(zhí)行文件mplayer. 二、移植mplayer到arm平臺的LINUX上(使用4.3.2編譯器) 1 配置安裝libmad
(如果不先配置安裝libmad,則在make mplayer時出現(xiàn)找不到mad.h 錯誤) (1)#./configure --enable-fpm=arm --host=arm-none-linux-gnueabi --disable-shared --disable-debugging --prefix=/usr/local/arm/3.3.2/lib CC=arm-none-linux-gnueabi-gcc
參數(shù)解析: (2)#make 注意如果出現(xiàn)error:unrecognized command line option "-fforce-mem"錯誤,需要修改makefile,去掉--fforce-mem標(biāo)志(因?yàn)閍rm-eabi編譯器都不支持這個選項(xiàng)) (3)#make install
此時會在/home/linux目錄下生成include目錄和lib目錄。 2 配置安裝mplayer (1)#./configure --host-cc=gcc --cc=arm-none-linux-gnueabi-gcc --target=arm-linux --enable-static --enable-ossaudio --prefix=/tmp/mplayer-rc2 --disable-win32dll --disable-dvdread --enable-fbdev --disable-mencoder --disable-live --disable-mp3lib --enable-mad --enable-libavcodec_a --disable-armv5te --disable-armv6 --disable-dvdnav --disable-dvdread --disable-dvdread-internal with-extraincdir=/usr/local/arm/3.3.2/lib/include --with-extralibdir=/usr/local/arm/3.3.2/lib/lib
參數(shù)解析: (2)#make 其中可能會遇到如下問題: 1.Error:motion_comp_arm_s.S 在libmpeg2/motion_comp_arm_s.S文件的前面加上如下的內(nèi)容:
#ifndef HAVE_PLD 2.vo_ivtv.c:79: error: storage size of ’sd’ isn’t known vo_ivtv.c:80: error: storage size of ’sd1′ isn’t known 添加--disable-ivtv 3. undefined reference to `video_out_ivtv'
在文件 file libvo/video_out.c, 找到 使用arm-linux-gcc 3.3.2編譯mplayer可能會出現(xiàn)in.h頭文件錯誤如下:
/usr/local/arm/3.3.2/include/netinet/in.h:259: parse error before '(' token 需要修改一下/usr/local/arm/3.3.2/include/netinet/in.h中,在 __BEGIN_DECLS 后面增加下述文字
#undef ntohl (3) make install(出現(xiàn)提示不認(rèn)識的文件。因?yàn)槭茿RM平臺運(yùn)行的文件,所有不認(rèn)識)
install -m 755 -s mplayer /tmp/mplayer-rc2/bin 要執(zhí)行時:
#/bin/mpalyer /路徑/要播放的媒體文件名; 三、MPlayer slave命令 在命令中添加 -slave 和 -quiet就可以通過命令設(shè)置Mplayer實(shí)現(xiàn)相應(yīng)的功能。在mplayer源碼中的,/DOCS/tech/slave.txt中對這些命令有詳細(xì)的解析。 Mplayer相關(guān)文章:
相關(guān)資訊
發(fā)表評論
|