[FFmpeg-user] Dropping frames from video to images

Johanna Andersson johanna.e.andersson at chalmers.se
Wed Mar 14 13:06:50 EET 2018


Hi!

I am not an expert at all in ffmpeg, but I use it to cut videos into frames for scientific investigation of fluid flows. I want to get every image (Windows shows me the video has 29 fps). However I seem to drop frames.
My code is as follows:

ffmpeg -i D_CIMG7477.MOV -r 29 -f image2 D_CIMG7477-%3d.png

the answer is for example:
ffmpeg version N-87353-g183fd30 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.2.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-libxml2 --enable-libzimg --enable-lzma --enab
le-zlib
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.101 / 57. 82.101
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.105.100 /  6.105.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D_CIMG7477.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf57.82.101
  Duration: 00:01:07.94, start: 0.000000, bitrate: 14438 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080
, 14436 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc (default)
    Metadata:
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
Output #0, image2, to 'D_CIMG7477-%3d.png':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf57.82.101
    Stream #0:0(eng): Video: png, rgb24, 1920x1080, q=2-31, 200 kb/s, 29 fps, 29
tbn, 29 tbc (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Lavc57.106.101 png
frame=    6 fps=5.3 q=-0.0 size=N/A time=00:00:00.06 bitrate=N/A speed=0.0614x
frame=   10 fps=4.7 q=-0.0 size=N/A time=00:00:00.20 bitrate=N/A speed=0.0975x
frame=   12 fps=3.8 q=-0.0 size=N/A time=00:00:00.27 bitrate=N/A speed=0.088x
frame=   16 fps=3.7 q=-0.0 size=N/A time=00:00:00.41 bitrate=N/A speed=0.0947x
Past duration 0.614952 too large
frame=   20 fps=3.9 q=-0.0 size=N/A time=00:00:00.55 bitrate=N/A speed=0.108x
Past duration 0.647331 too large
frame=   21 fps=3.3 q=-0.0 Lsize=N/A time=00:00:00.72 bitrate=N/A speed=0.115x
[...]
frame= 1961 fps=3.6 q=-0.0 size=N/A time=00:01:07.48 bitrate=N/A dup=0 drop=64 s
frame= 1963 fps=3.6 q=-0.0 size=N/A time=00:01:07.55 bitrate=N/A dup=0 drop=64 s
frame= 1966 fps=3.6 q=-0.0 size=N/A time=00:01:07.65 bitrate=N/A dup=0 drop=64 s
frame= 1968 fps=3.6 q=-0.0 size=N/A time=00:01:07.72 bitrate=N/A dup=0 drop=64 s
frame= 1971 fps=3.6 q=-0.0 size=N/A time=00:01:07.82 bitrate=N/A dup=0 drop=64 s
frame= 1972 fps=3.6 q=-0.0 Lsize=N/A time=00:01:08.00 bitrate=N/A dup=0 drop=64
speed=0.125x
video:5571246kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxi
ng overhead: unknown

Is it that I have dropped 64 frames in this case? How can I avoid it? Because the speed of the flow I analyze would be double as fast in the pictures in between I dropped the frame, which result in peaks in my curve.

Best regards,
Johanna



More information about the ffmpeg-user mailing list