FFMPEG。视频到图像序列,持续时间已更改

时间:2020-04-17 18:38:37

标签: linux ffmpeg

视频的持续时间从7分钟59秒更改为7分钟55秒。 我不确定是什么问题。但这确实是吃光了帧,但我不确定是什么问题。

我的命令:

“ ffmpeg -loglevel verbose -i'/secrets/secret.mkv'-vf fps = 23.976 -qscale:v 3 -vf scale = 720:540'/secrets/lol5/SecretJpgs%05d.png'”

就这样。 如果有人愿意帮助我,我将非常感激。 会很重要!!! 编辑:我了解我的命令有错误,但仍然无法解释更改持续时间的原因。检查持续时间:然后检查输出时间,即7分钟55秒。我显然在某处丢失了一些东西。为了确保这不是错误,我回过头将图像序列转换为视频,这是7分钟55秒,与来源不同。该命令非常好,我什至使用不同的命令两次设置了fps,但这是另外一回事。请我真的很感激,如果你们中的任何一个可以帮助我。

ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[h264 @ 0x56089f88a500] Reinit context to 1440x1088, pix_fmt: yuv420p
Input #0, matroska,webm, from '/secret/secrets/My secrets/Secret.mkv':
  Metadata:
    ENCODER         : Lavf57.71.100
  Duration: 00:07:59.08, start: 3.401000, bitrate: 5257 kb/s
    Chapter #0:0: start 0.000000, end 113.594000
    Metadata:
      title           : 00:02:23.643
    Chapter #0:1: start 113.594000, end 479.000000
    Metadata:
      title           : 00:09:54.594
    Stream #0:0(eng): Video: h264 (High), 1 reference frame, yuv420p(progressive, left), 1440x1080 (1440x1088) [SAR 1:1 DAR 4:3], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 5789491
      BPS-eng         : 5789491
      DURATION-eng    : 00:23:37.375000000
      NUMBER_OF_FRAMES: 33983
      NUMBER_OF_FRAMES-eng: 33983
      NUMBER_OF_BYTES : 1025735076
      NUMBER_OF_BYTES-eng: 1025735076
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-02-16 22:40:33
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-02-16 22:40:33
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      DURATION        : 00:07:59.083000000
    Stream #0:1(eng): Subtitle: ass (default) (forced)
    Metadata:
      title           : English full
      BPS             : 35
      BPS-eng         : 35
      DURATION-eng    : 00:23:34.413000000
      NUMBER_OF_FRAMES: 248
      NUMBER_OF_FRAMES-eng: 248
      NUMBER_OF_BYTES : 6265
      NUMBER_OF_BYTES-eng: 6265
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-02-16 22:40:33
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-02-16 22:40:33
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      ENCODER         : Lavc57.89.100 ssa
      DURATION        : 00:07:42.860000000
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
[h264 @ 0x56089f88cd00] Reinit context to 1440x1088, pix_fmt: yuv420p
[Parsed_scale_0 @ 0x56089f843ae0] w:720 h:540 flags:'bicubic' interl:0
[graph 0 input from stream 0:0 @ 0x56089f843b80] w:1440 h:1080 pixfmt:yuv420p tb:1/1000 fr:24000/1001 sar:1/1 sws_param:flags=2
[Parsed_scale_0 @ 0x56089f843ae0] w:1440 h:1080 fmt:yuv420p sar:1/1 -> w:720 h:540 fmt:rgb24 sar:1/1 flags:0x4
Output #0, image2, to '/secret/lol5/SecretJpgs%05d.png':
  Metadata:
    encoder         : Lavf57.83.100
    Chapter #0:0: start 0.000000, end 110.193000
    Metadata:
      title           : 00:02:23.643
    Chapter #0:1: start 110.193000, end 475.599000
    Metadata:
      title           : 00:09:54.594
    Stream #0:0(eng): Video: png, 1 reference frame, rgb24(left), 720x540 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
    Metadata:
      BPS             : 5789491
      BPS-eng         : 5789491
      DURATION-eng    : 00:23:37.375000000
      NUMBER_OF_FRAMES: 33983
      NUMBER_OF_FRAMES-eng: 33983
      NUMBER_OF_BYTES : 1025735076
      NUMBER_OF_BYTES-eng: 1025735076
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-02-16 22:40:33
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-02-16 22:40:33
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      DURATION        : 00:07:59.083000000
      encoder         : Lavc57.107.100 png
No more output streams to write to, finishing.
frame=11405 fps= 20 q=-0.0 Lsize=N/A time=00:07:55.68 bitrate=N/A speed=0.823x    
video:4711858kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (/secret/secrets/My secrets/Secret.mkv):
  Input stream #0:0 (video): 11405 packets read (314757039 bytes); 11405 frames decoded; 
  Input stream #0:1 (subtitle): 0 packets read (0 bytes); 
  Total: 11405 packets (314757039 bytes) demuxed
Output file #0 (/secret/lol5/SecretJpgs%05d.png):
  Output stream #0:0 (video): 11405 frames encoded; 11405 packets muxed (4824942145 bytes); 
  Total: 11405 packets (4824942145 bytes) muxed

1 个答案:

答案 0 :(得分:0)

没有吃掉任何框架。

请参见

  Input stream #0:0 (video): 11405 packets read (314757039 bytes); 11405 frames decoded; 
...
  Output stream #0:0 (video): 11405 frames encoded; 11405 packets muxed (4824942145 bytes);

另一方面,您的命令无法正常工作。

-vf fps=23.976 ... -vf scale=720:540

仅应用右侧。要按顺序应用两个过滤器,必须

-vf fps=24000/1001,scale=720:540

(24000/1001是23.976的精确表示)

但这不是必需的,因为您的视频已经是24000/1001 fps。因此,只需从原始命令中删除-vf fps=23.976