ffmpeg幻灯片无法正常工作

时间:2012-10-18 14:43:55

标签: video ffmpeg

我正在尝试基于两个图像('ocean001.jpg'和'ocean002.jpg')创建一个简单的幻灯片视频。我正在使用ffmpeg文档中列出的命令,但我总是在15秒的时间内得到一个空白(例如黑色)视频文件。

我已检查确认两个图像文件的大小相同。两者都是1024x768px。也没有报告错误。

谁能告诉我我做错了什么?

以下是我正在使用的命令的输出:

ffmpeg -f image2 -r 1/15 -i ocean%03d.jpg -vcodec libx264 out.mp4

以下是上述命令的输出:

ffmpeg version 1.0 Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep 29 2012 11:22:50 with gcc 4.7.1 (GCC) 20120721 (prerelease)
  configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-libgsm --enable-libspeex --enable-postproc --enable-shared --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-librtmp --enable-libpulse --enable-libv4l2 --enable-gpl --enable-version3 --enable-runtime-cpudetect --disable-debug --disable-static
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, image2, from 'ocean%03d.jpg':
  Duration: 00:00:30.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj444p, 1024x768 [SAR 72:72 DAR 4:3], 1 tbr, 0.07 tbn, 0.07 tbc
[libx264 @ 0x22debc0] using SAR=1/1
[libx264 @ 0x22debc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle Cache64
[libx264 @ 0x22debc0] profile High, level 3.1
[libx264 @ 0x22debc0] 264 - core 124 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf54.29.104
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 1024x768 [SAR 1:1 DAR 4:3], q=-1--1, 1 tbn, 0.07 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> libx264)
Press [q] to stop, [?] for help
frame=    2 fps=0.0 q=17.0 Lsize=     215kB time=00:00:30.00 bitrate=  58.7kbits/s    
video:214kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.363298%
[libx264 @ 0x22debc0] frame I:1     Avg QP:16.68  size:132919
[libx264 @ 0x22debc0] frame P:1     Avg QP:14.27  size: 85767
[libx264 @ 0x22debc0] mb I  I16..4:  0.0% 100.0%  0.0%
[libx264 @ 0x22debc0] mb P  I16..4:  8.1% 82.9%  9.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip: 0.0%
[libx264 @ 0x22debc0] 8x8 transform intra:91.5% inter:100.0%
[libx264 @ 0x22debc0] coded y,uvDC,uvAC intra: 97.6% 96.7% 80.8% inter: 100.0% 100.0% 100.0%
[libx264 @ 0x22debc0] i16 v,h,dc,p:  1%  3%  1% 96%
[libx264 @ 0x22debc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 18% 28%  7%  5%  5%  7%  7% 11%
[libx264 @ 0x22debc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 16% 12%  8% 10%  8%  6%  8%  5%
[libx264 @ 0x22debc0] i8c dc,h,v,p: 39% 25% 16% 20%
[libx264 @ 0x22debc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x22debc0] kb/s:58.32

1 个答案:

答案 0 :(得分:1)

您还必须在输出上设置费率

ffmpeg -r 1/15 -i ocean%03d.jpg -r 30 out.mp4