当前位置: 首页 > 知识库问答 >
问题:

ffmpeg不从图像生成视频

袁康裕
2023-03-14

我试图创建一个视频从jpeg图像使用ffmpeg。生成的视频应为x264或x265格式。

我有一个36张图片的目录。每个图像大小约为60像素。它们的名称如下:

  • 第00000帧。jpg
  • 框架00001。jps
  • 框架00002。jpg
  • 框架00035。jpg

我阅读了SO中的文档和几篇文章,并编写了一个批处理文件来调用ffmpeg,如下所示:

 ffmpeg.exe -r 1/5 -start_number 0 -i %1\frame%%05d.jpg -c:v libx264 -vf "fps=1,format=yuv420p" out1.mp4

当我运行这个命令时,我从ffmpeg得到了这个输出,这很奇怪:

C:\Users\m\Desktop\ffmpeg-20170702-c885356-win64-static\bin>ffmpeg.exe -r 1/5 -start_number 0 -i "C:\Resized"\frame%05d.jpg -c:v libx264 -vf "fps=1,format=yuv420p" out1.mp4
ffmpeg version N-86691-gc885356 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.1.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-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-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --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. 67.100 / 55. 67.100
  libavcodec     57.100.103 / 57.100.103
  libavformat    57. 75.100 / 57. 75.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 'C:\Resized\frame%05d.jpg':
  Duration: 00:00:01.44, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 11000x5500 [SAR 1:1 DAR 2:1], 25 tbr, 25 tbn, 25 tbc
File 'out1.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 00000000006662e0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 000000000017b220] using SAR=1/1
[libx264 @ 000000000017b220] frame MB size (688x344) > level limit (139264)
[libx264 @ 000000000017b220] DPB size (4 frames, 946688 mbs) > level limit (2 frames, 696320 mbs)
[libx264 @ 000000000017b220] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000000000017b220] profile High, level 6.2
[libx264 @ 000000000017b220] 264 - core 152 r2851 ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=6 lookahead_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 'out1.mp4':
  Metadata:
    encoder         : Lavf57.75.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 11000x5500 [SAR 1:1 DAR 2:1], q=-1--1, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.100.103 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    1 fps=0.9 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    2 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    3 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    4 fps=1.3 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    5 fps=1.4 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    5 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    6 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    7 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    8 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=    9 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   10 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   10 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   11 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   13 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   14 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   15 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   15 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   16 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   17 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   18 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   19 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   20 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   20 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   21 fps=1.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   22 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   23 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   24 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   25 fps=1.1 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   25 fps=0.5 q=0.0 size=   55040kB time=00:00:00.00 bitrate=N/A speed=   frame=   26 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   27 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   28 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   29 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   30 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   31 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   32 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   34 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   35 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   35 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   36 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   37 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   39 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   40 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   40 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   41 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   43 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   44 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   45 fps=0.1 q=0.0 size=   55296kB time=00:00:00.00 bitrate=N/A speed=   frame=   46 fps=0.1 q=0.0 size=   77568kB time=00:00:00.00 bitrate=N/A speed=   frame=   47 fps=0.0 q=0.0 size=   77824kB time=00:00:00.00 bitrate=N/A speed=   frame=   48 fps=0.0 q=0.0 size=   77824kB time=00:00:00.00 bitrate=N/A speed=   frame=   49 fps=0.0 q=0.0 size=   77824kB time=00:00:00.00 bitrate=N/A speed=   frame=   50 fps=0.0 q=0.0 size=   77824kB time=00:00:00.00 bitrate=N/A speed=   frame=   50 fps=0.0 q=0.0 size=   77824kB time=00:00:00.00 bitrate=N/A speed=   frame=   51 fps=0.0 q=17.0 size=    8448kB time=-00:00:01.99 bitrate=N/A speed=Nframe=   52 fps=0.0 q=17.0 size=    8448kB time=-00:00:00.99 bitrate=N/A speed=Nframe=   53 fps=0.0 q=17.0 size=    8448kB time=00:00:00.00 bitrate=1134531147.5frame=   54 fps=0.0 q=17.0 size=    8448kB time=00:00:01.00 bitrate=69202.2kbitsframe=   55 fps=0.0 q=17.0 size=    8448kB time=00:00:02.00 bitrate=34602.1kbitsframe=   55 fps=0.0 q=17.0 size=    8448kB time=00:00:02.00 bitrate=34602.1kbitsframe=   56 fps=0.0 q=17.0 size=   14848kB time=00:00:03.00 bitrate=40544.2kbitsframe=   57 fps=0.0 q=17.0 size=   14848kB time=00:00:04.00 bitrate=30408.3kbitsframe=   58 fps=0.0 q=17.0 size=   14848kB time=00:00:05.00 bitrate=24326.7kbitsframe=   59 fps=0.0 q=17.0 size=   14848kB time=00:00:06.00 bitrate=20272.3kbitsframe=   60 fps=0.0 q=17.0 size=   22016kB time=00:00:07.00 bitrate=25764.8kbitsframe=   60 fps=0.0 q=17.0 size=   22016kB time=00:00:07.00 bitrate=25764.8kbitsframe=   61 fps=0.0 q=17.0 size=   22016kB time=00:00:08.00 bitrate=22544.3kbitsframe=   62 fps=0.0 q=17.0 size=   22016kB time=00:00:09.00 bitrate=20039.4kbitsframe=   63 fps=0.0 q=17.0 size=   22016kB time=00:00:10.00 bitrate=18035.4kbitsframe=   64 fps=0.0 q=17.0 size=   29696kB time=00:00:11.00 bitrate=22115.3kbitsframe=   65 fps=0.0 q=17.0 size=   29696kB time=00:00:12.00 bitrate=20272.4kbitsframe=   65 fps=0.0 q=17.0 size=   29696kB time=00:00:12.00 bitrate=20272.4kbitsframe=   66 fps=0.0 q=17.0 size=   29696kB time=00:00:13.00 bitrate=18713.0kbitsframe=   67 fps=0.0 q=17.0 size=   29696kB time=00:00:14.00 bitrate=17376.4kbitsframe=   68 fps=0.0 q=17.0 size=   37376kB time=00:00:15.00 bitrate=20412.2kbitsframe=   69 fps=0.0 q=17.0 size=   37376kB time=00:00:16.00 bitrate=19136.5kbitsframe=   70 fps=0.0 q=17.0 size=   37376kB time=00:00:17.00 bitrate=18010.8kbitsframe=   70 fps=0.0 q=17.0 size=   37376kB time=00:00:17.00 bitrate=18010.8kbitsframe=   71 fps=0.0 q=17.0 size=   37376kB time=00:00:18.00 bitrate=17010.2kbitsframe=   72 fps=0.0 q=17.0 size=   37376kB time=00:00:19.00 bitrate=16114.9kbitsframe=   73 fps=0.0 q=17.0 size=   37376kB time=00:00:20.00 bitrate=15309.2kbitsframe=   74 fps=0.0 q=17.0 size=   37376kB time=00:00:21.00 bitrate=14580.2kbitsframe=   75 fps=0.0 q=17.0 size=   37376kB time=00:00:22.00 bitrate=13917.4kbitsframe=   75 fps=0.0 q=17.0 size=   37376kB time=00:00:22.00 bitrate=13917.4kbitsframe=   76 fps=0.0 q=17.0 size=   44032kB time=00:00:23.00 bitrate=15683.0kbitsframe=   77 fps=0.0 q=17.0 size=   44032kB time=00:00:24.00 bitrate=15029.6kbitsframe=   78 fps=0.0 q=17.0 size=   44032kB time=00:00:25.00 bitrate=14428.4kbitsframe=   79 fps=0.0 q=17.0 size=   44032kB time=00:00:26.00 bitrate=13873.4kbitsframe=   80 fps=0.0 q=17.0 size=   50944kB time=00:00:27.00 bitrate=15456.8kbitsframe=   80 fps=0.0 q=17.0 size=   50944kB time=00:00:27.00 bitrate=15456.8kbitsframe=   81 fps=0.0 q=17.0 size=   50944kB time=00:00:28.00 bitrate=14904.7kbitsframe=   82 fps=0.0 q=17.0 size=   50944kB time=00:00:29.00 bitrate=14390.8kbitsframe=   83 fps=0.0 q=17.0 size=   50944kB time=00:00:30.00 bitrate=13911.1kbitsframe=   84 fps=0.0 q=17.0 size=   58368kB time=00:00:31.00 bitrate=15424.2kbitsframe=   85 fps=0.0 q=17.0 size=   58368kB time=00:00:32.00 bitrate=14942.2kbitsframe=   85 fps=0.0 q=17.0 size=   58368kB time=00:00:32.00 bitrate=14942.2kbitsframe=   86 fps=0.0 q=17.0 size=   58368kB time=00:00:33.00 bitrate=14489.4kbitsframe=   87 fps=0.0 q=17.0 size=   58368kB time=00:00:34.00 bitrate=14063.2kbitsframe=   88 fps=0.0 q=17.0 size=   66048kB time=00:00:35.00 bitrate=15459.0kbitsframe=   89 fps=0.0 q=17.0 size=   66048kB time=00:00:36.00 bitrate=15029.6kbitsframe=   90 fps=0.0 q=17.0 size=   66048kB time=00:00:37.00 bitrate=14623.4kbitsframe=   90 fps=0.0 q=17.0 size=   66048kB time=00:00:37.00 bitrate=14623.4kbitsframe=   91 fps=0.0 q=17.0 size=   66048kB time=00:00:38.00 bitrate=14238.5kbitsframe=   92 fps=0.0 q=17.0 size=   66048kB time=00:00:39.00 bitrate=13873.5kbitsframe=   93 fps=0.0 q=17.0 size=   66048kB time=00:00:40.00 bitrate=13526.6kbitsframe=   94 fps=0.0 q=17.0 size=   66048kB time=00:00:41.00 bitrate=13196.7kbitsframe=   95 fps=0.0 q=17.0 size=   66048kB time=00:00:42.00 bitrate=12882.5kbitsframe=   95 fps=0.0 q=17.0 size=   66048kB time=00:00:42.00 bitrate=12882.5kbitsframe=   96 fps=0.0 q=17.0 size=   72448kB time=00:00:43.00 bitrate=13802.2kbitsframe=   97 fps=0.0 q=17.0 size=   72448kB time=00:00:44.00 bitrate=13488.5kbitsframe=   99 fps=0.0 q=17.0 size=   72448kB time=00:00:46.00 bitrate=12902.0kbitsframe=  100 fps=0.0 q=17.0 size=   79360kB time=00:00:47.00 bitrate=13832.3kbitsframe=  100 fps=0.0 q=17.0 size=   79360kB time=00:00:47.00 bitrate=13832.3kbitsframe=  101 fps=0.0 q=17.0 size=   79360kB time=00:00:48.00 bitrate=13544.1kbitsframe=  103 fps=0.0 q=17.0 size=   79360kB time=00:00:50.00 bitrate=13002.3kbitsframe=  104 fps=0.0 q=17.0 size=   86528kB time=00:00:51.00 bitrate=13898.8kbitsframe=  105 fps=0.0 q=17.0 size=   86528kB time=00:00:52.00 bitrate=13631.5kbitsframe=  105 fps=0.0 q=17.0 size=   86528kB time=00:00:52.00 bitrate=13631.5kbitsframe=  106 fps=0.0 q=17.0 size=   86528kB time=00:00:53.00 bitrate=13374.3kbitsframe=  107 fps=0.0 q=17.0 size=   86528kB time=00:00:54.00 bitrate=13126.6kbitsframe=  108 fps=0.0 q=17.0 size=   94208kB time=00:00:55.00 bitrate=14031.8kbitsframe=  109 fps=0.0 q=17.0 size=   94208kB time=00:00:56.00 bitrate=13781.3kbitsframe=  110 fps=0.0 q=17.0 size=   94208kB time=00:00:57.00 bitrate=13539.5kbitsframe=  111 fps=0.0 q=17.0 size=   94208kB time=00:00:58.00 bitrate=13306.1kbitsframe=  112 fps=0.0 q=17.0 size=   94464kB time=00:00:59.00 bitrate=13116.1kbitsframe=  113 fps=0.0 q=17.0 size=   94464kB time=00:01:00.00 bitrate=12897.5kbitsframe=  115 fps=0.0 q=17.0 size=   94464kB time=00:01:02.00 bitrate=12481.4kbitsframe=  115 fps=0.0 q=17.0 size=   94464kB time=00:01:02.00 bitrate=12481.4kbitsframe=  116 fps=0.0 q=17.0 size=  100608kB time=00:01:03.00 bitrate=13082.2kbitsframe=  117 fps=0.0 q=17.0 size=  100608kB time=00:01:04.00 bitrate=12877.8kbitsframe=  119 fps=0.0 q=17.0 size=  100608kB time=00:01:06.00 bitrate=12487.6kbitsframe=  120 fps=0.0 q=17.0 size=  107520kB time=00:01:07.00 bitrate=13146.3kbitsframe=  121 fps=0.0 q=17.0 size=  107520kB time=00:01:08.00 bitrate=12953.0kbitsframe=  123 fps=0.0 q=17.0 size=  107520kB time=00:01:10.00 bitrate=12582.9kbitsframe=  125 fps=0.0 q=17.0 size=  114944kB time=00:01:12.00 bitrate=13078.1kbitsframe=  126 fps=0.0 q=17.0 size=  114944kB time=00:01:13.00 bitrate=12898.9kbitsframe=  128 fps=0.0 q=17.0 size=  122880kB time=00:01:15.00 bitrate=13421.8kbitsframe=  129 fps=0.0 q=17.0 size=  122880kB time=00:01:16.00 bitrate=13245.2kbitsframe=  130 fps=0.0 q=17.0 size=  122880kB time=00:01:17.00 bitrate=13073.1kbitsframe=  130 fps=0.0 q=17.0 size=  122880kB time=00:01:17.00 bitrate=13073.1kbitsframe=  131 fps=0.0 q=17.0 size=  122880kB time=00:01:18.00 bitrate=12905.5kbitsframe=  133 fps=0.0 q=17.0 size=  122880kB time=00:01:20.00 bitrate=12582.9kbitsframe=  135 fps=0.0 q=17.0 size=  122880kB time=00:01:22.00 bitrate=12276.0kbitsframe=  135 fps=0.0 q=17.0 size=  122880kB time=00:01:22.00 bitrate=12276.0kbitsframe=  136 fps=0.0 q=17.0 size=  129280kB time=00:01:23.00 bitrate=12759.8kbitsframe=  137 fps=0.0 q=17.0 size=  129280kB time=00:01:24.00 bitrate=12607.9kbitsframe=  138 fps=0.0 q=17.0 size=  129280kB time=00:01:25.00 bitrate=12459.5kbitsframe=  140 fps=0.0 q=17.0 size=  136448kB time=00:01:27.00 bitrate=12848.1kbitsframe=  140 fps=0.0 q=17.0 size=  136448kB time=00:01:27.00 bitrate=12848.1kbitsframe=  141 fps=0.0 q=17.0 size=  136448kB time=00:01:28.00 bitrate=12702.1kbitsframe=  143 fps=0.0 q=17.0 size=  136448kB time=00:01:30.00 bitrate=12419.8kbitsframe=  145 fps=0.0 q=17.0 size=  143872kB time=00:01:32.00 bitrate=12810.9kbitsframe=  146 fps=0.0 q=17.0 size=  143872kB time=00:01:33.00 bitrate=12673.1kbitsframe=  148 fps=0.0 q=17.0 size=  151552kB time=00:01:35.00 bitrate=13068.6kbitsframe=  149 fps=0.0 q=17.0 size=  151552kB time=00:01:36.00 bitrate=12932.4kbitsframe=  150 fps=0.0 q=17.0 size=  151552kB time=00:01:37.00 bitrate=12799.1kbitsframe=  150 fps=0.0 q=17.0 size=  151552kB time=00:01:37.00 bitrate=12799.1kbitsframe=  151 fps=0.0 q=17.0 size=  151552kB time=00:01:38.00 bitrate=12668.5kbitsframe=  153 fps=0.0 q=17.0 size=  151552kB time=00:01:40.00 bitrate=12415.1kbitsframe=  155 fps=0.0 q=17.0 size=  151552kB time=00:01:42.00 bitrate=12171.7kbitsframe=  156 fps=0.0 q=17.0 size=  157952kB time=00:01:43.00 bitrate=12562.5kbitsframe=  157 fps=0.0 q=17.0 size=  157952kB time=00:01:44.00 bitrate=12441.8kbitsframe=  159 fps=0.0 q=17.0 size=  157952kB time=00:01:46.00 bitrate=12207.0kbitsframe=  160 fps=0.0 q=17.0 size=  164864kB time=00:01:47.00 bitrate=12622.1kbitsframe=  161 fps=0.0 q=17.0 size=  164864kB time=00:01:48.00 bitrate=12505.2kbitsframe=  163 fps=0.0 q=17.0 size=  164864kB time=00:01:50.00 bitrate=12277.9kbitsframe=  165 fps=0.0 q=17.0 size=  172288kB time=00:01:52.00 bitrate=12601.6kbitsframe=  166 fps=0.0 q=17.0 size=  172288kB time=00:01:53.00 bitrate=12490.1kbitsframe=  168 fps=0.0 q=17.0 size=  179968kB time=00:01:55.00 bitrate=12820.0kbitsframe=  169 fps=0.0 q=17.0 size=  179968kB time=00:01:56.00 bitrate=12709.5kbitsframe=  170 fps=0.0 q=17.0 size=  179968kB time=00:01:57.00 bitrate=12600.8kbitsframe=  171 fps=0.0 q=17.0 size=  179968kB time=00:01:58.00 bitrate=12494.0kbitsframe=  173 fps=0.0 q=17.0 size=  179968kB time=00:02:00.00 bitrate=12285.8kbitsframe=  175 fps=0.0 q=17.0 size=  179968kB time=00:02:02.00 bitrate=12084.4kbitsframe=  176 fps=0.0 q=17.0 size=  186368kB time=00:02:03.00 bitrate=12412.4kbitsframe=  176 fps=0.0 q=-1.0 Lsize=  254547kB time=00:02:53.00 bitrate=12053.5kbits/s speed=0.0344x
video:254543kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001571%
[libx264 @ 000000000017b220] frame I:1     Avg QP: 7.13  size:8716365
[libx264 @ 000000000017b220] frame P:44    Avg QP:10.34  size:5710783
[libx264 @ 000000000017b220] frame B:131   Avg QP:13.29  size:  5046
[libx264 @ 000000000017b220] consecutive B-frames:  0.6%  0.0%  1.7% 97.7%
[libx264 @ 000000000017b220] mb I  I16..4: 22.8% 68.7%  8.5%
[libx264 @ 000000000017b220] mb P  I16..4:  0.8% 44.9%  3.6%  P16..4:  4.9%  5.5%  3.1%  0.0%  0.0%    skip:37.1%
[libx264 @ 000000000017b220] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.6%  0.0%  0.0%  direct: 0.1%  skip:99.2%  L0:42.7% L1:55.9% BI: 1.5%
[libx264 @ 000000000017b220] 8x8 transform intra:90.1% inter:72.0%
[libx264 @ 000000000017b220] coded y,uvDC,uvAC intra: 96.9% 93.0% 90.5% inter: 3.6% 3.7% 3.6%
[libx264 @ 000000000017b220] i16 v,h,dc,p: 50% 15% 14% 21%
[libx264 @ 000000000017b220] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 29% 21%  4%  5%  4%  7%  5%  9%
[libx264 @ 000000000017b220] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 33% 11%  6%  9%  6%  9%  5%  8%
[libx264 @ 000000000017b220] i8c dc,h,v,p: 50% 29% 16%  5%
[libx264 @ 000000000017b220] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 000000000017b220] ref P L0: 44.8% 21.7% 12.8% 20.8%
[libx264 @ 000000000017b220] ref B L0: 85.0% 14.0%  1.0%
[libx264 @ 000000000017b220] ref B L1: 98.0%  2.0%
[libx264 @ 000000000017b220] kb/s:11847.81

可以看出:

  • 它报告说:

已弃用的像素格式,请确保您正确设置了范围

这意味着什么?

  • 它试图处理超过36帧,而我们只有36帧
  • 在第25帧之前,大小为零,比特率为N/A,在第25帧之后,大小变为零
  • 它运行了几百张图像,然后停止,但我不能播放视频
  • 在第47帧之后,FPS变为零
  • 我无法播放输出的视频

如何解决这些问题并从这些帧创建视频?

在得到一些回复后,我注意到h264不支持最终分辨率,因此我转换为使用VP9,我使用以下命令:

ffmpeg -i %1\frame%%05d.jpg -c:v libvpx-vp9 -b:v 2M -c:a libvorbis output.webm

我得到了正确的帧数,但我不能用VLC播放输出。

  • 有可以玩这个分辨率的玩家吗?
  • 除了播放视频之外,还有什么方法可以检查视频中的数据是否正确吗?例如,通过将它们提取成几个图像并查看图像。

共有1个答案

夏何平
2023-03-14

它试图处理超过36帧,而我们只有36帧。

您的输入速率设置为1/5,即显示每帧5秒,但您的输出速率设置为1fps=1),因此ffmpeg将重复每帧4次(除了最后一次))。

在第25帧之前,大小为零,比特率为N/A,在第25帧之后,大小变为零。

当流在编码后被多路复用时,会报告大小和比特率,因此会有一些延迟。

在帧47之后,FPS变为零。

这是第27帧,这个FPS值是处理速度。您的最终处理速度为0.03x,即0.03 x 1 fps,因此fps读数将向下舍入或截断为0.0-

我无法播放输出的视频。

两个可能的原因:

许多视频播放器不能播放低帧率视频<代码>5往往是安全的最低值。所以fps=5。另外,将-r 1/5更改为-framerate 1/5

其它原因可能是框架尺寸。一些播放器可能无法播放帧那么大的视频,这可能是由于帧本身的大小或不符合任何有效的H.264级别。如果是这种情况,您可能不得不降低流的规模。

 类似资料:
  • 我使用ffmpeg从视频中获取缩略图。工作正常。但是shell_exec函数返回null。 我的命令是, 我能从中得到返回值吗?请帮助我:)

  • 我在另一个论坛上问过这个问题,但从来没有运气。我在网上找到了下面的命令,它应该使用FFMPEG从图像创建一个视频(每个持续时间为5秒)。 FFMPEG-F image2-r 1/5-i img%03d.png-vcodec libx264 out.mp4 编辑:添加命令行输出

  • 问题内容: 有没有办法在PHP中给出的视频文件(,),以生成缩略图图像预览? 问题答案: 请看一下http://ffmpeg.org/以及此讨论http://board.phpbuilder.com/showthread.php?10327812-How- to-install-ffmpeg-php-to-create-thumbnails-from- 影片

  • 正在尝试从图像(1080p.png)音乐(320kbmp3)为youtube制作视频。 但转化是缓慢的。有什么想法吗,它是如何使优化的<代码>E:\U测试

  • 我正在做一个简单的ffmpeg测试。我想用它为我正在开发的网站生成缩略图/视频抓取。我目前正在使用VLC获取单个帧,然后生成一个缩略图,但它相当慢,有点麻烦。 问题是,我正在使用的视频(从我自己的电脑)是由安全摄像头软件生成的,并且它有一种奇怪的视频格式。当我在VLC中打开它(.bvr)时,它播放得非常非常快。10秒的视频大约需要2.5秒。此外,使用ffmpeg“ffmpeg-i test.bvr

  • 这行工作良好,但我想创建一个视频文件从图像在另一个文件夹。“我的文件夹”中的映像名称为: 我如何从不同的文件夹输入图像文件?示例: 我尝试了这个命令,但是只生成了第一个图像(img001.jpg)的视频。