gpt4 book ai didi

ffmpeg 视频幻灯片只拍摄第一张图片

转载 作者:行者123 更新时间:2023-12-04 14:21:48 27 4
gpt4 key购买 nike

我想从 10 张图像中创建帧率为 1 fps 的 .mp4 视频。我关注了https://trac.ffmpeg.org/wiki/Slideshow并到达(我的图像在我运行命令的文件夹中,名称为 img000.png、img001.png 等)

path_to_ffmpeg\ffmpeg.exe -framerate 1 -i img%03d.png output.mp4

但是只有第一张图片被拍摄到视频中并且它只显示一张图片!

在尝试了 -framerate 和 -r 选项的多种排列以及选项的位置后,我没有收到任何更好的结果。

有谁知道即使在这种简单的情况下可能出了什么问题?谢谢。

完整日志:

C:\Users\foo\Documents\path>C:\bar\ffmpeg-4.0.2-win64-static\bin\ffmpeg.ex
e -framerate 1 -i img%03d.png output.mp4
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.1 (GCC) 20180722
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --e
nable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libblur
ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enab
le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-li
bvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --en
able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enabl
e-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enabl
e-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enab
le-dxva2 --enable-avisynth
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, image2, from 'img%03d.png':
Duration: 00:00:10.00, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 959x550 [SAR 2834:2834 DAR 959:550], 1 fp
s, 1 tbr, 1 tbn, 1 tbc
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0000000000611040] using SAR=1/1
[libx264 @ 0000000000611040] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2
[libx264 @ 0000000000611040] profile High 4:4:4 Predictive, level 3.1, 4:4:4 8-b
it
[libx264 @ 0000000000611040] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=4 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 deci
mate=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 'output.mp4':
Metadata:
encoder : Lavf58.12.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p, 959x550 [SA
R 1:1 DAR 959:550], q=-1--1, 1 fps, 16384 tbn, 1 tbc
Metadata:
encoder : Lavc58.18.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 10 fps=0.0 q=-1.0 Lsize= 20kB time=00:00:07.00 bitrate= 23.1kbits
/s speed=68.6x
video:19kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
erhead: 5.046419%
[libx264 @ 0000000000611040] frame I:1 Avg QP: 4.41 size: 14084
[libx264 @ 0000000000611040] frame P:3 Avg QP:12.31 size: 632
[libx264 @ 0000000000611040] frame B:6 Avg QP:19.11 size: 436
[libx264 @ 0000000000611040] consecutive B-frames: 20.0% 0.0% 0.0% 80.0%
[libx264 @ 0000000000611040] mb I I16..4: 89.7% 0.0% 10.3%
[libx264 @ 0000000000611040] mb P I16..4: 0.2% 0.0% 0.1% P16..4: 0.5% 0.1
% 0.1% 0.0% 0.0% skip:98.9%
[libx264 @ 0000000000611040] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.6% 0.1
% 0.1% direct: 0.0% skip:99.1% L0:22.0% L1:73.7% BI: 4.3%
[libx264 @ 0000000000611040] coded y,u,v intra: 6.1% 2.5% 2.6% inter: 0.2% 0.1%
0.1%
[libx264 @ 0000000000611040] i16 v,h,dc,p: 72% 25% 3% 0%
[libx264 @ 0000000000611040] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 31% 20% 2% 2%
2% 3% 5% 2%
[libx264 @ 0000000000611040] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0000000000611040] ref P L0: 65.8% 1.5% 26.5% 6.1%
[libx264 @ 0000000000611040] ref B L0: 77.0% 12.7% 10.3%
[libx264 @ 0000000000611040] ref B L1: 88.6% 11.4%
[libx264 @ 0000000000611040] kb/s:14.87

最佳答案

旧版本的 VLC 无法播放帧率为 5 或更低的视频。添加 -r 6 来纠正这个问题。此外,您可能需要添加 -pix_fmt yuv420p 以实现广泛的播放兼容性。

关于ffmpeg 视频幻灯片只拍摄第一张图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53778503/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com