简体   繁体   中英

FFMPEG. Video to image sequences, duration changed

The duration of the video changes from 7 minutes and 59 seconds to 7 minutes and 55 seconds. I'm not sure what the issue is. But it's def eating up frames but i'm not sure what the issue is.

My command:

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

And well that's about it. I would really appreciate it, if someone was willing to help me out with this. Would mean a lot:,. Edit: I Understand there are mistakes with my command, still doesn't explain why the duration is changed. Check the duration. and then check the time of the output, 7 mins and 55 secs. I clearly lost something somewhere, To make sure this wasn't an error i went back and converted the image sequence to video and it was 7 mins and 55 secs. unlike the source, The command was perfectly fine and i even set the fps twice using different commands. but it was something else. Please i would really appreciate it , if any one of you could help me out.

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

No frames have been eaten.

See

  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);

On the other hand, your command isn't working as intended.

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

Only the right hand side is being applied. To apply both filters, in that order, it has to be

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

(24000/1001 is the exact representation for 23.976)

But this is not needed, as your video is already 24000/1001 fps. So just remove -vf fps=23.976 from your original command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM