[FFmpeg-user] Extract N evenly spaced images from a video

Benjamin Black benblack86 at gmail.com
Tue Feb 17 20:47:36 CET 2015


Using the latest version on the same example I get 4 frames. The video is 02.83 seconds long, so even if the first frame is generated on the 0 second, I would expect 3 frames.





benblack$ ffmpeg -i example.mov -f image2 -r 1 preview-%d.jpeg

ffmpeg version git-2015-02-11-194165a Copyright (c) 2000-2015 the FFmpeg developers

  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)

  configuration: --prefix=/home/benblack/ffmpeg_build --extra-cflags=-I/home/benblack/ffmpeg_build/include --extra-ldflags=-L/home/benblack/ffmpeg_build/lib --bindir=/home/benblack/bin --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264

  libavutil      54. 18.100 / 54. 18.100

  libavcodec     56. 21.102 / 56. 21.102

  libavformat    56. 19.101 / 56. 19.101

  libavdevice    56.  4.100 / 56.  4.100

  libavfilter     5. 10.100 /  5. 10.100

  libswscale      3.  1.101 /  3.  1.101

  libswresample   1.  1.100 /  1.  1.100

  libpostproc    53.  3.100 / 53.  3.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example.mov':

  Metadata:

    major_brand     : qt

    minor_version   : 0

    compatible_brands: qt

    creation_time   : 2015-02-11 16:52:01

  Duration: 00:00:02.83, start: 0.000000, bitrate: 736 kb/s

    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 638x468 [SAR 1:1 DAR 319:234], 726 kb/s, 59.29 fps, 60 tbr, 6k tbn, 12k tbc (default)

    Metadata:

      creation_time   : 2015-02-11 16:52:01

      handler_name    : Core Media Data Handler

      encoder         : H.264

[swscaler @ 0x23f10c0] deprecated pixel format used, make sure you did set range correctly

Output #0, image2, to 'preview-%d.jpeg':

  Metadata:

    major_brand     : qt

    minor_version   : 0

    compatible_brands: qt

    encoder         : Lavf56.19.101

    Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 638x468 [SAR 1:1 DAR 319:234], q=2-31, 200 kb/s, 1 fps, 1 tbn, 1 tbc (default)

    Metadata:

      creation_time   : 2015-02-11 16:52:01

      handler_name    : Core Media Data Handler

      encoder         : Lavc56.21.102 mjpeg

Stream mapping:

  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))

Press [q] to stop, [?] for help

frame=    4 fps=0.0 q=1.7 Lsize=N/A time=00:00:04.00 bitrate=N/A dup=0 drop=164

video:244kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown


More information about the ffmpeg-user mailing list