Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4523718
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: 嵌入式

2011-04-12 10:00:19

参考:
http://lizzy115.blog.163.com/blog/static/36491958201102981344921/

http://hi.baidu.com/zhxust/blog/item/5f31e52d877f223e349bf7ac.html
http://www.cublog.cn/u1/35418/showart_273358.html

1.下载 MPLayger  MPlaye-1.0rc4.tar.bz2  
 
2.解压 文件

3.进入  root@yuweixian:/home/ywx/yu/src# cd cd MPlayer-1.0rc4/

  编译配置
  1. root@yuweixian:/home/ywx/yu/src/MPlayer-1.0rc4# ./configure --host-cc=gcc --cc=arm-linux-gcc --target=arm-armv4l-linux --enable-static --prefix=/home/ywx/yu/src/mplayer --disable-win32dll --disable-dvdread --enable-fbdev --disable-mencoder --disable-live 2>&1 | tee logfile

   
   我这里将生成的mplayer 安装到 /home/ywx/yu/src/mplayer/下面


4. make  编译

  注:这里会出错,在libmpeg2/motion_comp_arm_s.S文件的最前面加上如下的内容:

  1. #ifndef HAVE_PLD
  2. .macro pld reg
  3. .endm
  4. #endif


5.再次 make

  然后再次 make 编译,这次编译没有了错误,
  最后在 /home/ywx/yu/src/mplaye/ 生成了 bin  etc  lib
  在 bin/下面 生成了 mplayer  大约  11MB

   这里会提示不能更改权限的错误,我们需要手动 改变权限
   chmod 777 bin/mplayer



上传 mplayer 附件,一共分成了3个压缩包


上传不了    mplayer.part1.rar    mplayer.part2.rar    mplayer.part3.rar  




madplay还有一些快捷键,比如:增大/减小音量+/-,暂停b,停止

(ESC/s)
,回车(从头播放)其他的操作可以查看madplay的源码。



6.处理好了。。

7.通过nfs 文件加载到 开发板上
  [root@yuweixian /mnt]# mount -t nfs 192.168.1.8:/home/ywx/yu /mnt/nfs -o proto=tcp -o nolock

  ./mplayer testbeijing.avi  注意这里需要时320*240 的视频

8.查看结果
 
  mplayer直接默认将视频输出到/dev/fb0,事实上是可以通过-vo fb来指定。

[root@yuweixian yu]# cd test-avi/
[root@yuweixian test-avi]# ls
mplayer          testbiejing.avi
[root@yuweixian test-avi]# ./mplayer testbiejing.avi
MPlayer 1.0rc4-4.5.1 (C) 2000-2010 MPlayer Team

Playing testbiejing.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO:  [FMP4]  320x240  24bpp  15.000 fps  206.8 kbps (25.2 kbyte/s)
Clip info:
 Software: Lavf52.20.0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 64.0 kbit/4.54% (ratio: 8000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0x92f3b8]No accelerated colorspace conversion found from yuv420p to rgb565le.
[swscaler @ 0x92f3b8]using unscaled yuv420p -> rgb565le special converter
VO: [fbdev] 320x240 => 320x240 BGR 16-bit
framebuffer too small for double-buffering, disabling
A:  52.7 V:  52.7 A-V:  0.032 ct:  0.000 791/791 32%  7% 52.6% 30 0             



当播放完一个视频后:

  1. A: 190.1 V: 190.1 A-V: 0.026 ct: 0.019 2852/2852 32% 7% 51.9% 33 0 A: 190.2 V: 190.1 A-V: 0.023 ct: 0.021 2853/2853 32% 7% 51.9% 33 0 A: 190.2 V: 190.2 A-V: 0.026 ct: 0.023 2854/2854 32% 7% 51.9% 33 0 A: 190.2 V: 190.3 A-V: -0.017 ct: 0.021 2855/2855 32% 7% 51.9% 33 0 A: 190.2 V: 190.3 A-V: -0.017 ct: 0.019 2855/2855 32% 7% 51.9% 33 0

  2. Exiting... (End of file)
  3. [root@yuweixian yu]#



这是移植了 ffmpeg 后显示的,  注意对比

[root@yuweixian /]# mplayer /home/yu/testbiejing.avi
Creating config file: //.mplayer/config
MPlayer 1.0rc4-4.5.1 (C) 2000-2010 MPlayer Team

Playing /home/yu/testbiejing.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO:  [FMP4]  320x240  24bpp  15.000 fps  206.8 kbps (25.2 kbyte/s)
Clip info:
 Software: Lavf52.20.0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 64.0 kbit/4.54% (ratio: 8000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0x92f3b8]No accelerated colorspace conversion found from yuv420p to rgb565le.
[swscaler @ 0x92f3b8]using unscaled yuv420p -> rgb565le special converter
VO: [fbdev] 320x240 => 320x240 BGR 16-bit
framebuffer too small for double-buffering, disabling
A:  96.4 V:  96.4 A-V:  0.002 ct:  0.000 1447/1447 32%  7% 52.3% 30 0     


阅读(2263) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~