MPlayer移植arm9+linux

一、编译环境及库文件

linux环境:ubuntu-10.04
交叉编译:arm-linux-gcc4.3.3
硬件平台:GT2440
软件平台:Linux-2.6.30.4

软件包:
zlib-1.2.3.tar.gz 
libid3tag-0.15.1b.tar.gz 
libmad-0.15.1b.tar.gz 
MPlayer-1.0rc2.tar.bz2

二、编译步骤

1、libz的交叉编译:

#tar xvf zlib-1.2.3.tar.gz 
#cd zlib-1.2.3/
#make clean
#./configure --prefix=/usr/local/arm/4.3.3/arm-none-linux-gnueabi
#vi Makefile
CC=arm-linux-gcc
AR=arm-linux-ar  rc
RANLIB=arm-linux-ranlib


#make
#make install


2、编译libid3tag-0.15.1b

#tar xvf libid3tag-0.15.1b.tar.gz 
#cd libid3tag-0.15.1b
#./configure CC=arm-linux-gcc --host=arm-linux --prefix=/usr/local/madplay 


#make
#make install


3、编译libmad-0.15.1b

#tar xvf libmad-0.15.1b.tar.gz 
#cd libmad-0.15.1b
#./configure CC=arm-linux-gcc --host=arm-linux --prefix=/usr/local/madplay
#gedit  Makefile
删除CFLAGS中的 -fforce-mem 
arm-linux-gcc4.3.3不支持 -fforce-mem


4、解压MPlayer-1.0rc2

#tar xvf MPlayer-1.0rc2.tar.bz2
#cd  MPlayer-1.0rc2
#./configure --cc=arm-linux-gcc --host-cc=gcc --enable-cross-compile --target=arm-


armv4l-linux --disable-armv6 --enable-static --enable-linux-devfs --disable-


win32dll --disable-dvdread --enable-fbdev --disable-mencoder --disable-liba52 --


enable-mp3lib --disable-live --disable-armv5te --disable-iconv --charset=noconv --


enable-mad --enable-ossaudio --disable-ivtv --enable-libavcodec_a --with-


extralibdir=/usr/local/madplay/lib --with-extraincdir=/usr/local/madplay/include


错误1:

在make之前修改两个地方,否则会出现不支持pld [r1]指令的问题


#gedit ./libavcodec/armv4l/dsputil_arm_s.S &
#gedit ./libmpeg2/motion_comp_arm_s.S
在MPlayer-1.0rc2/libmpeg2/motion_comp_arm_s.S文件
和MPlayer-1.0rc2/libavcodec/armv4l/dsputil_arm_s.S文件的开始处写入


#ifndef HAVE_PLD


.macro pld reg
.endm


#endif


错误2:

ioctl.c: In function 'ioctl_ReadCopyright':
ioctl.c:273:5: error: #error "DVD ioctls are unavailable on this system"


#gedit libdvdcss/ioctl.c &
找到ioctl.c的相应行,注释掉,再编译,编译成功。


错误3:

不能识别 intptr_t
这个是arm-linux-gcc4.3.3编译器的问题
#gedit libavcodec/bitstream.h &
把intptr_t 替换为 unsigned int


#make
#make install
这里会出现一个错误,可以不管它,因为此时mplayer已经出来了,也就是说已经成功了。。。。


修改make install的bug:
查资料看install带-s 参数时会自动调用strip来strip应用程序。但是arm编译时要调用arm-


linux-strip才有正确处理。解决办法是取消-s参数,查看Makefile可以发现-s是如下


install-mplayer: mplayer$(EXESUF)
$(INSTALL) -m 755 $(INSTALLSTRIP) mplayer$(EXESUF) $(BINDIR)


的INSTALLSTRIP设置的,它默认是-s,因此只要简单在Makefile的前面(95行)加入


         INSTALLSTRIP :=  #       (将其置为空即可)


错误4:

播放无声音解决方法:
将/dev/dsp软链接到/dev/sound/dsp
#mkdir -p /dev/sound & ln -s /dev/dsp /dev/sound/
#ln -s /dev/dsp /dev/sound/
#ln -s /dev/dsp /dev/sound/dsp //该命令也可以


原因:目标系统上有 /dev/dsp 音频设备文件,只是OSS音频驱动需要的是 /dev/sound/dsp 设备


文件,这问题的简单解决方法是建一个符号链接,当然这两条命令可以写在系统的启动文件的适当


位置,即修改系统的/etc/init.d/rcS文件。

5、测试mplayer

参考:http://www.360doc.com/content/12/0924/15/9481051_237908074.shtml


#cp mplayer /opt/GTStudio/GT2440/root_qtopia/motion_sdk/
#cat /proc/version //查看内核版本信息
#./mplayer4.4.3  air.wav 
用4.4.3编译的mplayer在4.3.3编译的文件系统上运行出现:


FATAL: kernel too old
Segmentation fault


用4.3.3编译后运行正常;
#./mplayer screen.avi -fs -zoom -x 480 -y 272
#./mplayer --help //查看帮助信息
#./mplayer HAPPYBABY.avi -fs
#./mplayer –fs –zoom –x 320 –y 240 -ac mad –nosound –cache 4096 output.avi –loop 0

参数解释:

-fs 全屏居中
-zoom -x 320 -y 240 全屏
-ac mad 是必须,表示强制用libmad解码;
-nosound 取消音频;
-cache 4096 缓存设置为4M;
-loop 循环播放,为0则无限循环播放,!0则有限播放;
-zoom -x 320 -y 240  也可以用   -vf scale=240:320    



- Most common: broken/buggy _audio_ driver
  - Try -ao sdl or use the OSS emulation of ALSA.
  - Experiment with different values for -autosync, 30 is a good start.
- Slow video output
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值