Skip to content

Instantly share code, notes, and snippets.

@EvilScott
Last active August 19, 2016 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EvilScott/a39581897399d96f29655c53b06e836a to your computer and use it in GitHub Desktop.
Save EvilScott/a39581897399d96f29655c53b06e836a to your computer and use it in GitHub Desktop.
Grab every X frames from a video with ffmpeg

Download ffmpeg from here (ffmpeg is also available via brew)

Use the following bash command:

$ ffmpeg -i <videofile> -vf fps=1/10 frame%04d.png

Notes on this command:

  • Replace <videofile> with the path to the video file you wish to process
  • fps=1/10 is the frames per second (grab one frame every ten seconds)
  • %04d is specifying how many leading zeros the filenames for frame captures will use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment