2012-10-25 60 views
0

我試圖捕捉到Android設備的屏幕使用的FFmpeg使用此命令的視頻文件,視頻文件:捕獲的Android屏幕使用的FFmpeg

/data/local/ffmpeg -y -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 320x480 -i /dev/graphics/fb0 /sdcard/output2.avi 2> /sdcard/out.txt 

這將創建一個單一的(不清楚)框架文件和停止。

ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers 
    built on Sep 20 2012 13:28:38 with gcc 4.6.x-google 20120106 (prerelease) 
    configuration: --arch=arm --cpu=cortex-a8 --target-os=linux --enable-runtime-cpudetect --prefix=/data/data/org.witness.sscvideoproto --enable-pic --disable-shared --enable-static --cross-prefix=/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi- --sysroot=/opt/android-ndk/platforms/android-3/arch-arm --extra-cflags='-I../x264 -mfloat-abi=softfp -mfpu=neon' --extra-ldflags=-L../x264 --enable-version3 --enable-gpl --disable-doc --enable-yasm --enable-decoders --enable-encoders --enable-muxers --enable-demuxers --enable-parsers --enable-protocols --enable-filters --enable-avresample --enable-libfreetype --disable-indevs --enable-indev=lavfi --disable-outdevs --enable-hwaccels --enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --enable-libx264 --enable-zlib 
    libavutil  51. 54.100/51. 54.100 
    libavcodec  54. 23.100/54. 23.100 
    libavformat 54. 6.100/54. 6.100 
    libavdevice 54. 0.100/54. 0.100 
    libavfilter  2. 77.100/2. 77.100 
    libswscale  2. 1.100/2. 1.100 
    libswresample 0. 15.100/0. 15.100 
    libpostproc 52. 0.100/52. 0.100 
[rawvideo @ 0xee5540] Estimating duration from bitrate, this may be inaccurate 
Input #0, rawvideo, from '/dev/graphics/fb0': 
    Duration: N/A, start: 0.000000, bitrate: N/A 
    Stream #0:0: Video: rawvideo (BGRA/0x41524742), bgra, 320x480, 25 tbr, 25 tbn, 25 tbc 
[buffer @ 0xef16e0] w:320 h:480 pixfmt:bgra tb:1/25 sar:0/1 sws_param:flags=2 
[buffersink @ 0xef1950] No opaque field provided 
[format @ 0xef1a70] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'format' 
[scale @ 0xef2c10] w:320 h:480 fmt:bgra sar:0/1 -> w:320 h:480 fmt:yuv420p sar:0/1 flags:0x4 
Output #0, avi, to '/sdcard/output2.avi': 
    Metadata: 
    ISFT   : Lavf54.6.100 
    Stream #0:0: Video: mpeg4 (FMP4/0x34504D46), yuv420p, 320x480, q=2-31, 200 kb/s, 25 tbn, 25 tbc 
Stream mapping: 
    Stream #0:0 -> #0:0 (rawvideo -> mpeg4) 
Press [q] to stop, [?] for help 
frame= 5 fps=0.0 q=5.4 Lsize=  199kB time=00:00:00.20 bitrate=8156.6kbits/s  
video:193kB audio:0kB global headers:0kB muxing overhead 2.929166% 

任何想法我做錯了什麼?

+0

更改爲480x800固定輸出質量,但輸出視頻仍然只包含2幀,然後ffmpeg停止 – jacob

+0

ffmpeg loop = 1可能有助於您。那麼VNC呢?如果我想將手機作爲影片捕捉,我在手機上運行vnc服務器,然後在PC上使用vnc客戶端來拍攝服務器會話。使完美的電影,如:http://www.youtube.com/watch?v=XqNYbAwnYXo –

回答

0

-i的/ dev /圖形/ FB0只讀FB0一次,所以你只能得到一個單一的框架。 ffmpeg不會一直讀取fb0。用命令行,你不會得到這個功能。