Mplayer的移植
2013-08-04 21:21
363 查看
日期: 2013.8.4 作者:杨正 QQ:1209758756 Email:yz2012ww@gmail.com
前言
MPlayer最初的名字叫做
"MPlayer - The Movie Player for Linux",不过后来开发者们简称其为
"MPlayer - The Movie Player",原因是MPlayer已经不仅可以用于Linux而可以在所有平台上运行.MPlayer是一款开源多媒体播放器,以GNU通用公共许可证发布。此款软件可在各主流作业系统使用,例如Linux和其他类Unix系统、微软的视窗系统及苹果电脑的Mac
OS X系统。MPlayer是建基于命令行界面,在各作业系统可选择安装不同的图形界面。mplayer的另一个大的特色是广泛的输出设备支持。它可以在
X11
、
Xv
、
DGA
、
OpenGL
、
SVGAlib
、
fbdev
、
AAlib
、
DirectFB下工作。
开发环境:linux
目标环境:fl2440
移植步骤:
移植libmad
移植libid3tag
移植madplay
移植mplayer
测试
一、移植libmad库
1)、下载源代码包,并解压缩:
[lingyun@localhost mplayer]$ wget ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz
[lingyun@localhost mplayer]$ tar -zxf libmad-0.15.1b.tar.gz
[lingyun@localhost mplayer]$ ls
libmad-0.15.1b libmad-0.15.1b.tar.gz
[lingyun@localhost mplayer]$ mkdir -p install/libmad
[lingyun@localhost mplayer]$ pwd
/home/lingyun/yangzheng/mplayer
[lingyun@localhost mplayer]$ cd libmad-0.15.1b
2)、配置生产Makefile(--prefix=/home/lingyun/yangzheng/mplayer/install/libmad/:指定最终库文件的安装路径;
CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc指定交叉编译器):
[lingyun@localhost libmad-0.15.1b]$ ./configure --enable-fpm=arm --host=arm-linux --disable-shared \
> --disable-debugging --prefix=/home/lingyun/yangzheng/mplayer/install/libmad/ \
>CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc
注:sed -i -e 's/-fforce-mem//' Makefile //把makefile中的-fforce-mem删除掉
3)、使用make和make install进行编译,安装:
[lingyun@localhost libmad-0.15.1b]$ make
[lingyun@localhost libmad-0.15.1b]$ make install
[lingyun@localhost libmad]$ tree
.
|-- include
| `-- mad.h
`-- lib
|-- libmad.a
`-- libmad.la
2 directories, 3 files
二、移植libid3tag
1)、下载源代码包:
[lingyun@localhost mplayer]$ wget ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz
[lingyun@localhost mplayer]$ tar -zxf libid3tag-0.15.1b.tar.gz
[lingyun@localhost mplayer]$ mkdir –p install/madid3
2)、配置生产Makefile(CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc:指定交叉编译器):
[lingyun@localhost libid3tag-0.15.1b]$ ./configure --host=arm-linux --prefix=/home/lingyun/yangzheng/mplayer/install/madid3/ \
disable-shared --disable-debugging \
CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc
再修改一下makefile,当然也可以把CFLAGS、LDFLAGS一次加到上面的那条命令里面:
[lingyun@localhost libid3tag-0.15.1b]$ vim Makefile
INST_PATH = /home/lingyun/yangzheng/mplayer/install
#CFLAGS = -Wall -O2 -fomit-frame-pointer
CFLAGS = -I${INST_PATH}/libmad/include
#LDFLAGS =
LDFLAGS=-L${INST_PATH}/libmad/lib
[lingyun@localhost libid3tag-0.15.1b]$ make
[lingyun@localhost libid3tag-0.15.1b]$ make install
[lingyun@localhost madid3]$ tree
.
|-- include
| `-- id3tag.h
`-- lib
|-- libid3tag.a
`-- libid3tag.la
2 directories, 3 files
三、移植madplay
1)、下载源代码包,并解压缩:
[lingyun@localhost mplayer]$ wget ftp://ftp.mars.org/pub/mpeg/madplay-0.15.2b.tar.gz
[lingyun@localhost mplayer]$ tar –zxf madplay-0.15.2b.tar.gz
[lingyun@localhost mplayer]$ mkdir -p install/madplay
2)、配置生产Makefile(--prefix=/home/lingyun/yangzheng/mplayer/install/madplay/:指定安装路径;CFLAGS,LDFLAGS指定编译时所用到的库文件;CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc指定交叉编译器):
[lingyun@localhost madplay-0.15.2b]$ ./configure --host=arm-linux \
--prefix=/home/lingyun/yangzheng/mplayer/install/madplay/ \
--disable-shared --disable-debugging \
CFLAGS=”-I/home/lingyun/yangzheng/mplayer/install/libmad/include \
-I/home/lingyun/yangzheng/mplayer/install/madid3/include "
LDFLAGS="-L/home/lingyun/yangzheng/mplayer/install/libmad/lib \
-L/home/lingyun/yangzheng/mplayer/install/madid3/lib"
CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc
3)、使用make和make install进行安装:
[lingyun@localhost madplay-0.15.2b]$ make
[lingyun@localhost madplay-0.15.2b]$ make install
[lingyun@localhost madplay]$ tree
.
|-- bin
| |-- abxtest
| `-- madplay
|-- man
| `-- man1
| |-- abxtest.1
| `-- madplay.1
`-- share
`-- locale
|-- en
| `-- LC_MESSAGES
| `-- madplay.mo
|-- es
| `-- LC_MESSAGES
| `-- madplay.mo
|-- fr
| `-- LC_MESSAGES
| `-- madplay.mo
|-- hr
| `-- LC_MESSAGES
| `-- madplay.mo
|-- locale.alias
`-- no
`-- LC_MESSAGES
`-- madplay.mo
15 directories, 10 files
四、移植mplayer
1)、下载源代码包,并解压缩:
[lingyun@localhost mplayer]$ wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc3.tar.bz2
[lingyun@localhost mplayer]$ tar -jxf MPlayer-1.0rc3.tar.bz2
[lingyun@localhost mplayer]$ mkdir -p install/mplayer
2)、修改motion_comp_arm_s.S文件
[lingyun@localhost libmpeg2]$ pwd
/home/lingyun/yangzheng/mplayer/MPlayer-1.0rc3/libmpeg2
[lingyun@localhost libmpeg2]$ ls
alloc.c cpu_state.c idct_altivec.c mmx.h motion_comp_arm_s.S mpeg2.h vlc.h
alpha_asm.h decode.c idct.c motion_comp_alpha.c motion_comp.c mpeg2_internal.h
attributes.h header.c idct_mmx.c motion_comp_altivec.c motion_comp_mmx.c slice.c
cpu_accel.c idct_alpha.c libmpeg2_changes.diff motion_comp_arm.c motion_comp_vis.c vis.h
[lingyun@localhost libmpeg2]$ vim motion_comp_arm_s.S
.text
#ifndef HAVE_PLD
.macro pld reg
.endm
#endif
3)、配置生产Makefile(prefix=/home/lingyun/yangzheng/mplayer/install/mplayer/:
指定安装路径;--cc=arm-linux-gcc --ar=arm-linux-ar --ranlib=arm-linux-ranlib --disable-gui:指定交叉编译器):
[lingyun@localhost MPlayer-1.0rc3]$ ./configure --prefix=/home/lingyun/yangzheng/mplayer/install/mplayer/ \
> --cc=arm-linux-gcc --ar=arm-linux-ar --ranlib=arm-linux-ranlib --disable-gui \
> --target=arm-armv4-linux --host-cc=gcc --disable-freetype \
> --enable-fbdev --disable-mencoder --disable-sdl --disable-live --disable-dvdread \
> --disable-libdvdcss-internal --disable-x11 --enable-cross-compile --disable-mp3lib \
> --enable-ass \
> --disable-dvdnav --disable-dvdread-internal --disable-jpeg --disable-tga \
> --disable-dvbhead --disable-pnm --disable-tv --disable-ivtv \
> --disable-fontconfig --disable-xanim --disable-win32dll --disable-armv5te --disable-armv6
4)、使用make和make install进行编译,安装:
[lingyun@localhost MPlayer-1.0rc3]$ make
[lingyun@localhost MPlayer-1.0rc3]$ make install
[lingyun@localhost MPlayer-1.0rc3]$ /opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-strip /home/lingyun/yangzheng/mplayer/install/mplayer/bin/mplayer
[lingyun@localhost install]$ cd mplayer/
[lingyun@localhost mplayer]$ ls
bin etc lib
[lingyun@localhost mplayer]$ tree
.
|-- bin
| `-- mplayer
|-- etc
| `-- mplayer
`-- lib
4 directories, 1 file
[lingyun@localhost MPlayer-1.0rc3]$ ls
******mplayer******
5)、把生成的mplayer下载到开发板的/bin目录下
五、测试:
>: ./bin/mplayer zhendeaini.mp3
Creating config file: //.mplayer/config
MPlayer 1.0rc3-4.5.4 (C) 2000-2009 MPlayer Team
Playing zhendeaini.mp3.
Audio only file format detected.
Clip info:
Title: ?μ???
Artist: Beyond(????
Album: ?μMusicPalace
Year:
Comment:
Genre: Unknown
==========================================================================
Requested audio codec family [mp3] (afm=mp3lib) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 32.0 kbit/2.27% (ratio: 4000->176400)
Selected audio codec: [ffmp3] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
==========================================================================
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 42.7 (42.7) of 1097.0 (18:17.0) 12.1%
MPlayer interrupted by signal 2 in module: play_audio
A: 42.8 (42.7) of 1097.0 (18:17.0) 12.1%
Exiting... (Quit)
>: ./bin/mplayer zhendeaini.mp3
MPlayer 1.0rc3-4.5.4 (C) 2000-2009 MPlayer Team
Playing zhendeaini.mp3.
Audio only file format detected.
Clip info:
Title: ?μ???
Artist: Beyond(????
Album: ?μMusicPalace
Year:
Comment:
Genre: Unknown
==========================================================================
Requested audio codec family [mp3] (afm=mp3lib) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 32.0 kbit/2.27% (ratio: 4000->176400)
Selected audio codec: [ffmp3] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
==========================================================================
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 19.3 (19.3) of 1097.0 (18:17.0) 12.0%
MPlayer interrupted by signal 2 in module: play_audio
A: 19.4 (19.3) of 1097.0 (18:17.0) 12.0%
Exiting... (Quit)
结束!!!!
参考文档:http://blog.csdn.net/qq419036154/article/details/6256011
http://www.360doc.com/content/13/0804/20/13396188_304740347.shtml
http://www.360doc.com/content/13/0804/20/13396188_304740347.shtml
相关文章推荐
- MPlayer在ARM开发板的移植
- 【操作详解】终于成功移植Mplayer到OK6410开发板上了,发帖详述移植全过程!(转载)
- QT4.5.3 + Mplayer + tslib 移植到…
- mplayer移植到arm下没声音
- ARM MPlayer移植过程
- MPlayer在ARM开发板的移植
- mplayer在s3c2410+linux的移植
- 在Ubuntu上移植MPlayer到mini2440
- Mplayer 移植到UP6410 开发板
- Linux平台基于S3C2440的MPlayer的移植
- 移植 mplayer 到 mini2440 全流程的小窍门
- 移植mplayer
- 移植mplayer
- MPlayer1.1.1移植记录
- 移植MPlayer:Error: selected processor does not support `pld [r1]''
- mplayer移植
- ubuntu11.10系统移植mplayer到TQ2440
- MPlayer-1.1 ARM 编译 移植
- Mplayer播放器的在PC、arm平台上的移植
- 移植Mplayer到OK6410开发板