我用Python生成了旋转图片,现在想用它创建一个动画。 ffmpeg似乎是完美的,但生成的视频仅包括第一帧(在VLC中查看),并且对于所有36张图片来说都是小(一个png的一半大小)。我究竟做错了什么?谢谢。
shell中的命令:ffmpeg -framerate 5 -i "./mov/movie%03d.png" -y "movie.mp4"
文件夹中的文件mov:movie000.png movie010.png .. movie350.png
ffmpeg version ffmpeg-20170620-ae6f6d4-win64-static
输出
ffmpeg version N-86537-gae6f6d4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --e
nable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --
enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-li
bfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug -
-enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enabl
e-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolam
e --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable
-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 66.100 / 55. 66.100
libavcodec 57. 99.100 / 57. 99.100
libavformat 57. 73.100 / 57. 73.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 94.100 / 6. 94.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, image2, from './mov/movie%03d.png':
Duration: 00:00:00.20, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 1152x864 [SAR 2834:2834 DAR 4:3], 5 tbr,
5 tbn, 5 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
Press [q] to stop, [?] for help
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 00000000003ec140] using SAR=1/1
[libx264 @ 00000000003ec140] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2
[libx264 @ 00000000003ec140] profile High 4:4:4 Predictive, level 3.2, 4:4:4 8-b
it
[libx264 @ 00000000003ec140] 264 - core 150 r2833 df79067 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=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_pski
p=1 chroma_qp_offset=4 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decim
ate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_a
dapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=5
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 'movie.mp4':
Metadata:
encoder : Lavf57.73.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 1152x8
64 [SAR 1:1 DAR 4:3], q=-1--1, 5 fps, 10240 tbn, 5 tbc
Metadata:
encoder : Lavc57.99.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 1 fps=0.0 q=23.0 Lsize= 19kB time=00:00:00.00 bitrate=1581142.9kb
its/s speed=0.00138x
video:18kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
erhead: 4.403838%
[libx264 @ 00000000003ec140] frame I:1 Avg QP:17.26 size: 17865
[libx264 @ 00000000003ec140] mb I I16..4: 29.6% 56.0% 14.5%
[libx264 @ 00000000003ec140] 8x8 transform intra:56.0%
[libx264 @ 00000000003ec140] coded y,u,v intra: 11.5% 2.3% 6.3%
[libx264 @ 00000000003ec140] i16 v,h,dc,p: 77% 22% 1% 0%
[libx264 @ 00000000003ec140] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 3% 62% 0% 0%
0% 0% 0% 0%
[libx264 @ 00000000003ec140] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 53% 25% 12% 1% 1%
2% 1% 2% 1%
[libx264 @ 00000000003ec140] kb/s:714.60
答案 0 :(得分:1)
您使用
文件夹中的文件mov:movie000.png movie010.png .. movie350.png
然而,ffmpeg需要0001,0002,0003,0004,......(连续)