X86的LINUX上已经自带了解码库,不需要另外安装解码库,而arm平台自己做的
文件系统没有解码库,需要另外安装解码库。
下载MPlayer:MPlayer-1.0rc2.tar.bz2
解码库:libmad-0.15.0b.tar.gz
一、在X86的LINUX上安装mplayer
1 #./configure (./configure --enable-gui –-enable-live –-language=zh )
2 #make
3 #make install
此时在MPlayer-1.0rc2目录下会生成可执行文件mplayer.
把它拷贝到/bin/目录下。要执行时:
#/bin/mpalyer /路径/要播放的媒体文件名;
#/bin/mplayer a.mp3
二、移植mplayer到arm平台的LINUX上(使用3.3.2编译器)
1 配置安装libmad
(如果不先配置安装libmad,则在make mplayer时出现找不到mad.h 错误)
echo PATH=/usr/local/arm/3.3.2/bin:$PATH
(1)#./configure --enable-fpm=arm --host=arm-linux --disable-shared --disable-debugging --prefix=/usr/local/arm/3.3.2/lib CC=arm-linux-gcc
参数解析:
--enable-fpm=arm
--host=arm-linux
--disable-shared
--disable-debugging
--prefix=/usr/local/arm/3.3.2/lib
CC=arm-linux-gcc
(2)#make
(3)#make install
此时会在/usr/local/arm/3.3.2/lib/目录下生成include目录和lib目录。
其中liclude目录下有文件 mad.h
lib 目录有文件 libmad.a libmad.la
2 配置安装mplayer
(1)#./configure --host-cc=gcc --cc=arm-linux-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 --with-extraincdir=/usr/local/arm/3.3.2/lib/include --with-extralibdir=/usr/local/arm/3.3.2/lib/lib
参数解析:
--host-cc=gcc # C compiler for tools needed while building [gcc]
--cc=arm-linux-gcc #C compiler to build MPlayer [gcc]
--target=arm-linux #target platform (i386-linux, arm-linux, etc)
--enable-static #build a statically linked binary
--enable-ossaudio #enable OSS audio output [autodetect]
--prefix=/tmp/mplayer-rc2 #prefix directory for installation [/usr/local]
--disable-win32dll # disable Win32 DLL support [enabled]
--disable-dvdread #disable libdvdread [autodetect]
--enable-fbdev #enable FBDev video output [autodetect]
--disable-mencoder #disable MEncoder (A/V encoder) compilation [enable] 使能编码器编辑
--disable-live #disable LIVE555 Streaming Media [autodetect] 让Mpalyer不支持流媒体协议
--disable-mp3lib # disable builtin mp3lib [enabled]
--enable-mad #disable libmad (MPEG audio) support [autodetect]
--enable-libavcodec_a #disable static libavcodec [autodetect]
--disable-armv5te #disable DSP extensions (ARM) [autodetect]
--disable-armv6 #disable ARMv6 (ARM) [autodetect]
--with-extraincdir=/usr/local/arm/3.3.2/lib/include #指明mad.h文件所在路径
--with-extralibdir=/usr/local/arm/3.3.2/lib/lib #指明limad相关链接库所在路径
(2)#make
使用arm-linux-gcc 3.3.2编译mplayer可能会出现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:259: parse error before "__u32"
/usr/local/arm/3.3.2/include/netinet/in.h:260: parse error before '(' token
/usr/local/arm/3.3.2/include/netinet/in.h:260: parse error before "__u16"
/usr/local/arm/3.3.2/include/netinet/in.h:262: parse error before '(' token
/usr/local/arm/3.3.2/include/netinet/in.h:262: parse error before "__u32"
需要修改一下/usr/local/arm/3.3.2/include/netinet/in.h中,在 __BEGIN_DECLS 后面增加下述文字
#undef ntohl
#undef ntohs
#undef htonl
#undef htons
(3)make install(出现提示不认识的文件。因为是ARM平台运行的文件,所有不认识)
install -m 755 -s mplayer /tmp/mplayer-rc2/bin
strip: Unable to recognise the format of the input file `/tmp/mplayer-rc2/bin/mplayer'
此时在MPlayer-1.0rc2目录下会生成可执行文件mplayer.
把它拷贝到/bin/目录下。要执行时:
#/bin/mpalyer /路径/要播放的媒体文件名;
#/bin/mplayer -ac mad a.mp3
三、MPlayer slave命令
在命令中添加 -slave 和 -quiet就可以通过命令设置Mplayer实现相应的功能。在mplayer源码中的,
/DOCS/tech/slave.txt中对这些命令有详细的解析。
阅读(1364) | 评论(0) | 转发(0) |