參考了我的第一篇關於mini2440移植ffmpeg(見 http://www.linuxidc.com/Linux/2011-09/43791.htm),先是編譯了ffmpeg-0.8.2和0.8.7都不行,後來我發現的arm-linux-gcc版本不行,就換了4.1.2,哎可以了,但是下到板子上運行說少了個libz.so.1這個庫,我看了下的我lib下面請確實沒有,我就在4.1.2下面拷貝了這個庫,運行。./ffmpeg -f video4linux2 -s 320*240 -i /dev/video0 test.avi出現如下信息:
FFmpeg version 0.6.3, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 15 2011 16:54:12 with gcc 4.3.3
configuration: --prefix=./_install/ --enable-shared --disable-static --enable-
gpl --cross-prefix=/usr/local/arm/4.3.3/bin/arm-linux- --enable-cross-compile --
arch=arm --disable-stripping --target-os=linux
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.11. 0 / 0.11. 0
zc3xx: probe 2wr ov vga 0x0000
然後就沒了,我想這只是說明蛇形頭打開了,還沒編碼,也沒有發現test.avi文件的生成,我上網查了半天沒有查到。後來我換了ffmpeg-0.6.3試了下也不行,。./ffmpeg -f video4linux2 -s 320*240 -r 10 -i /dev/video0 test.avi終於出現了Input #0, video4linux2, from '/dev/video0':
Duration: N/A, start: 14319.005000, bitrate: 0 kb/s
Stream #0.0: Video: mjpeg, yuvj422p, 320x240, 0 kb/s, 10 tbr, 1000k tbn, 10
tbc
File 'test.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'test.avi':
Metadata:
ISFT : Lavf52.64.2
Stream #0.0: Video: mpeg4, yuv420p, 320x240, q=2-31, 200 kb/s, 10 tbn, 10 tb
c
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 3 fps= 0 q=2.0 size= 19kB time=0.30 bitrate= 523.7kbits/s dup=0
frame= 6 fps= 4 q=2.0 size= 35kB time=0.60 bitrate= 482.5kbits/s dup=0
frame= 9 fps= 5 q=2.0 size= 43kB time=0.90 bitrate= 391.1kbits/s dup=0
frame= 12 fps= 5 q=2.0 size= 53kB time=7.10 bitrate= 60.9kbits/s dup=0
frame= 16 fps= 5 q=2.0 size= 67kB time=7.60 bitrate= 72.1kbits/s dup=0
frame= 19 fps= 5 q=2.0 size= 75kB time=7.90 bitrate= 77.8kbits/s dup=0
frame= 22 fps= 5 q=2.0 size= 82kB time=8.50 bitrate= 79.3kbits/s dup=0
frame= 25 fps= 5 q=1.6 size= 94kB time=9.00 bitrate= 85.1kbits/s dup=0
ok了,終於行了,我移植了一天了哎。還好有收獲的。嘿嘿看下效果: