来自Nexus Galaxy的fb0上的ffmpeg错误:“无法获取帧文件名编号2”

时间:2012-02-14 03:36:43

标签: android ffmpeg adb

我使用ffmpeg从Androids转换fb0文件并生成屏幕截图。出于某种原因,这不适用于Nexus Galaxy。

我收到此错误:

[image2 @ 0000000001E0E350] Could not get frame filename number 2 from pattern '
image.png'
av_interleaved_write_frame(): Invalid argument

以下是流程:

    C:\dev\scripts>adb pull /dev/graphics/fb0
3292 KB/s (16777216 bytes in 4.976s)

C:\dev\scripts>ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix
_fmt rgb32 -s 720x1080 -i fb0 -f image2 -vcodec png image.png
ffmpeg version N-36635-gceb0dd9 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan  9 2012 17:45:55 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil      51. 34.100 / 51. 34.100
  libavcodec     53. 54.100 / 53. 54.100
  libavformat    53. 29.100 / 53. 29.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 58.100 /  2. 58.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    51.  2.100 / 51.  2.100
[rawvideo @ 000000000037D5A0] Estimating duration from bitrate, this may be inac
curate
Input #0, rawvideo, from 'fb0':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 720x1080, 25 tbr, 25
 tbn, 25 tbc
[buffer @ 000000000037D420] w:720 h:1080 pixfmt:bgra tb:1/1000000 sar:0/1 sws_pa
ram:
Output #0, image2, to 'image.png':
  Metadata:
    encoder         : Lavf53.29.100
    Stream #0:0: Video: png, bgra, 720x1080, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> png)
Press [q] to stop, [?] for help
[image2 @ 0000000001E0E350] Could not get frame filename number 2 from pattern '
image.png'
av_interleaved_write_frame(): Invalid argument

1 个答案:

答案 0 :(得分:9)

如果将rawvideo转换为图像格式,则可能有多个图像。 Ffmpeg只是警告您输出文件名不是输出多个图像文件所需的适当格式。

请改为尝试:

ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 720x1080 -i fb0 -f image2 -vcodec png image_%05d.png

这应该产生几个图像文件,即:

image_00001.png image_00002.png image_00003.png ...