MPlayer音视频播放器的移植

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Mr_Stardust/article/details/93305529

MPlayer 是一款很好用的音视频播放工具,如果我们要在linux系统或者ARM系统上播放视频,我们只要移植过去就行了。这个过程就好比如,在电脑的系统上安装一个软件。

1.可到 http://www.mplayerhq.hu/MPlayer/releases/ 下载
源码版本为:MPlayer-1.0rc4.tar.gz

2.将MPlayer-1.0rc4.tar.gz放到家目录下,解压
tar -zxvf MPlayer-1.0rc4.tar.gz

3.解压后会生成一个文件夹,进入MPlayer-1.0rc4文件夹,跟之前移植jpeg库类似,会看到configure,然后需要我们配置一下环境

./configure --host-cc=gcc --cc=arm-none-linux-gnueabi-gcc --target=arm-linux --enable-fbdev --enable-static --disable-dvdread --disable-live --disable-mp3lib  --disable-win32dll --disable-mencoder --disable-ivtv --disable-dvdnav --disable-dvdread-internal --disable-libdvdcss-internal --enable-libavcodec_a --prefix=/usr/local/mplayer

配置说明:
–host-cc=gcc --cc=arm-linux-gcc --target=arm-linux
//设置交叉编译器
–enable-fbdev
//打开framebuffer支持,ARM开发板必须的
–enable-static
//静态编译,编译成功后只需要将exe文件拷走即可以使用
–disable-dvdread --disable-dvdnav --disable-dvdread-internal
//全部与DVD相关,不适用
–disable-libdvdcss-internal
//这个不加低版本mplayer也会出错
–disable-live //禁止流媒体
–disable-win32dll //禁用win32动态链接库支持
–disable-mencoder
//交叉编译mencoder会有问题,而且arm上不需要这个功能
–disable-ivtv
//如果不加会出现ivtv文件产生的错误
–enable-libavcodec_a
//启用静态的libavcodec解码
–prefix=/usr/local/mplayer //安装路径

4.配置完成后会生成一个makfie文件,编译源码
make
这时就生成了可执行文件mplayer

5.查看mplayer格式
file mplayer
以移植到ARM为例,看到mplayer: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped才是正确无误滴

6.测试
将可执行文件mplayer放到开发板的 /bin目录下
(bin目录是存放命令的文件夹)

7.播放MP3文件,直接使用mplayer命令+视频
mplayer xxx.mp3
MPlayer 1.0rc4-5.4.0 © 2000-2010 MPlayer Team

展开阅读全文

mplayer arm 移植的问题

12-31

我在做arm上的移植,用的是arm2410,编译器是arm-linux-g++(3.4.1)rn 在编译过程中出现这样的问题!rnmake -C libmpcodecsrnmake[1]: Entering directory `/root/mplayer/MPlayer-0.92.1/libmpcodecs'rnarm-linux-gcc -c -O4 -pipe -ffast-math -fomit-frame-pointer -I. -Inative -I..rn-I../libmpdemux -I../loader -D_GNU_SOURCE -o ad_libmad.o ad_libmad.crnad_libmad.c:23:17: mad.h: No such file or directoryrnad_libmad.c:27: error: field `synth' has incomplete typernad_libmad.c:28: error: field `stream' has incomplete typernad_libmad.c:29: error: field `frame' has incomplete typernad_libmad.c: In function `read_frame':rnad_libmad.c:75: error: `MAD_ERROR_BUFLEN' undeclared (first use in this function)rnad_libmad.c:75: error: (Each undeclared identifier is reported only oncernad_libmad.c:75: error: for each function it appears in.)rnad_libmad.c: In function `init':rnad_libmad.c:88: error: `MAD_MODE_SINGLE_CHANNEL' undeclared (first use in this function)rnad_libmad.c: At top level:rnad_libmad.c:104: error: parse error before "sample"rnad_libmad.c: In function `scale':rnad_libmad.c:106: error: `sample' undeclared (first use in this function)rnad_libmad.c:106: error: `MAD_F_FRACBITS' undeclared (first use in this function)ad_libmad.c:109: error: `MAD_F_ONE' undeclared (first use in this function)rnad_libmad.c: In function `decode_audio':rnad_libmad.c:130: error: `mad_fixed_t' undeclared (first use in this function)rnad_libmad.c:130: error: parse error before "const"rnad_libmad.c:134: error: dereferencing pointer to incomplete typernad_libmad.c:135: error: dereferencing pointer to incomplete typernad_libmad.c:136: error: `left_ch' undeclared (first use in this function)rnad_libmad.c:136: error: dereferencing pointer to incomplete typernad_libmad.c:137: error: `right_ch' undeclared (first use in this function)rnad_libmad.c:137: error: dereferencing pointer to incomplete typernmake[1]: *** [ad_libmad.o] Error 1rnmake[1]: Leaving directory `/root/mplayer/MPlayer-0.92.1/libmpcodecs'rnmake: *** [libmpcodecs/libmpcodecs.a] Error 2rn[root@localhost MPlayer-0.92.1]# makernmake -C libmpcodecsrnmake[1]: Entering directory `/root/mplayer/MPlayer-0.92.1/libmpcodecs'rnarm-linux-gcc -c -O4 -pipe -ffast-math -fomit-frame-pointer -I. -Inative -I..rn-I../libmpdemux -I../loader -D_GNU_SOURCE -o ad_libmad.o ad_libmad.crnad_libmad.c:23:17: mad.h: No such file or directoryrnad_libmad.c:27: error: field `synth' has incomplete typernad_libmad.c:28: error: field `stream' has incomplete typernad_libmad.c:29: error: field `frame' has incomplete typernad_libmad.c: In function `read_frame':rnad_libmad.c:75: error: `MAD_ERROR_BUFLEN' undeclared (first use in this function)rnad_libmad.c:75: error: (Each undeclared identifier is reported only oncernad_libmad.c:75: error: for each function it appears in.)rnad_libmad.c: In function `init':rnad_libmad.c:88: error: `MAD_MODE_SINGLE_CHANNEL' undeclared (first use in this function)rnad_libmad.c: At top level:rnad_libmad.c:104: error: parse error before "sample"rnad_libmad.c: In function `scale':rnad_libmad.c:106: error: `sample' undeclared (first use in this function)rnad_libmad.c:106: error: `MAD_F_FRACBITS' undeclared (first use in this function)ad_libmad.c:109: error: `MAD_F_ONE' undeclared (first use in this function)rnad_libmad.c: In function `decode_audio':rnad_libmad.c:130: error: `mad_fixed_t' undeclared (first use in this function)rnad_libmad.c:130: error: parse error before "const"rnad_libmad.c:134: error: dereferencing pointer to incomplete typernad_libmad.c:135: error: dereferencing pointer to incomplete typernad_libmad.c:136: error: `left_ch' undeclared (first use in this function)rnad_libmad.c:136: error: dereferencing pointer to incomplete typernad_libmad.c:137: error: `right_ch' undeclared (first use in this function)rnad_libmad.c:137: error: dereferencing pointer to incomplete typernmake[1]: *** [ad_libmad.o] Error 1rnmake[1]: Leaving directory `/root/mplayer/MPlayer-0.92.1/libmpcodecs'rnmake: *** [libmpcodecs/libmpcodecs.a] Error 2rnrn用的是这个mplayerrnMPlayer-0.92.1rnrn./configure --cc=arm-linux-gcc --target=arm-armv4-linux --enable-static --prefix=/mplayer --disable-win32 --disable-dvdread --enable-fbdev --disable-mencoder --disable-live --enable-libavcodec --language=zh_CN --enable-mad rn说mad.hrn找不到!请专家看看! 论坛

mplayer s3c2410移植的问题

05-24

各位高手,大家好rn小弟最近在学arm嵌入式移植,现在弄mplayer的移植,移植过程中有很多问题,以前的慢慢解决了,但是现在播放mplayer时 (./mplayer xxxx.avi),遇到了问题,信息如下,由于没有经验,不知怎么解决,也不知从哪里入手,请各位帮助,十分感谢!rnrnMPlayer 1.0pre7try2-3.3.2 (C) 2000-2005 MPlayer TeamrnCPU: ARMrnrnFailed to open /dev/rtc: No such file or directory (it should be readable by the user.)rnLoading config '1.avi.conf'rnrnOption RIFF needs a parameter at line 1rnparse error at line 10rnparse error at line 14rnparse error at line 20rnparse error at line 77rnparse error at line 82rnparse error at line 84rnparse error at line 96rnOption " needs a parameter at line 104rnOption & needs a parameter at line 110rnOption ) needs a parameter at line 112rnOption * needs a parameter at line 113rnparse error at line 124rnparse error at line 125rnparse error at line 152rnparse error at line 153rntoo many errorsrnPlaying 1.avi.rnAVI file format detected.rnVIDEO: [XVID] 320x240 12bpp 30.000 fps 394.7 kbps (48.2 kbyte/s)rn==========================================================================rnOpening audio decoder: [mp3lib] MPEG layer-2, layer-3rnAUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)rnSelected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)rn==========================================================================rnCan't open /dev/fb0: No such file or directoryrn[fbdev2] Can't open /dev/fb0: No such file or directoryrn==========================================================================rnOpening video decoder: [ffmpeg] FFmpeg's libavcodec codec familyrnoom-killer: gfp_mask=0x201d2, order=0rnMem-info:rnDMA per-cpu:rncpu 0 hot: low 0, high 0, batch 1 used:0rncpu 0 cold: low 0, high 0, batch 1 used:0rnDMA32 per-cpu: emptyrnNormal per-cpu: emptyrnHighMem per-cpu: emptyrnFree pages: 752kB (0kB HighMem)rnActive:1372 inactive:1203 dirty:0 writeback:0 unstable:0 free:188 slab:385 mapped:271 pagetables:12rnDMA free:752kB min:512kB low:640kB high:768kB active:5488kB inactive:4812kB present:16384kB pages_scanned:1334 all_unreclaimable? nornlowmem_reserve[]: 0 0 0 0rnDMA32 free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? nornlowmem_reserve[]: 0 0 0 0rnNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? nornlowmem_reserve[]: 0 0 0 0rnHighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? nornlowmem_reserve[]: 0 0 0 0rnDMA: 54*4kB 3*8kB 2*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 752kBrnDMA32: emptyrnNormal: emptyrnHighMem: emptyrnSwap cache: add 0, delete 0, find 0/0, race 0+0rnFree swap = 0kBrnTotal swap = 0kBrnFree swap: 0kBrn4096 pages of RAMrn218 free pagesrn711 reserved pagesrn385 slab pagesrn41 pages sharedrn0 pages swap cachedrnOut of Memory: Killed process 64 (mplayer).rnKilledrnrn1.系统为arm9+linux s3c2410 rn2.ramdisk大小不够,我就挂载了u盘,把mplayer,xxx.avi放了进去,在u盘里弄rn3.看过两篇mplayer s3c2410移植的文章,说要有/dev/fb0,可是我没有,不知在哪里出了问题rn也没有/dev/fb,在内核编译的时候已经支持了framebuffer,不知这个问题怎么解决rn4.以前把madplay移植过去放歌没有问题,可换了内核后说找不到/dev/tty,不知怎么解决rn5.请问各位高手能不能给一些学arm9 lcd的见意 论坛

没有更多推荐了,返回首页