Search code examples
imagevideomedia-playervideo-capturevideo-processing

Get images from a video in every N frames


I am looking for some tool or program to automatically grab snapshots (a few mins interval) from a video file without display it for me. Mkv support would be nice!


Solution

  • From the ffmpeg manual page http://ffmpeg.org/ffmpeg.html :

    For extracting images from a video:
    
    
    ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
    
    This will extract one video frame per second from the video and will output them in files named ‘foo-001.jpeg’, ‘foo-002.jpeg’, etc. Images will be rescaled to fit the new WxH values.
    

    There are other options for extracting images depending on frame position or time, etc.