Skip to content

Instantly share code, notes, and snippets.

@StanCallewaert
Last active September 20, 2019 11:10
Show Gist options
  • Save StanCallewaert/57360fcbf24ed4428e43c093372b0d2e to your computer and use it in GitHub Desktop.
Save StanCallewaert/57360fcbf24ed4428e43c093372b0d2e to your computer and use it in GitHub Desktop.
Extract images from video
# First install ffmpeg
# Then set the following 2 variables
FILENAME=your_file.mp4
NUMBER_OF_IMAGES=50
VIDEO_LENGTH_IN_SECONDS=`ffprobe -i $FILENAME -show_entries format=duration -v quiet -of csv="p=0"`
ffmpeg -i $FILENAME -vf fps=$NUMBER_OF_SECONDS/$NUMBER_OF_IMAGES image%04d.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment