Skip to content

Instantly share code, notes, and snippets.

@ja-k-e
Last active August 29, 2015 13:56
Show Gist options
  • Save ja-k-e/9233825 to your computer and use it in GitHub Desktop.
Save ja-k-e/9233825 to your computer and use it in GitHub Desktop.
Insanely specific script for generating screenshots of all mp4 files in a directory using ffmpeg. Creates named directory for each file's screenshots.
# for each mp4 file in current directory
for FILE in *.mp4
do
# get name of file sans the extension
NAME=${FILE%.*}
# make directory with file name
mkdir $NAME
# generate screens: currently 4 screens per second, starting at 1 second, for 5 seconds.
ffmpeg -i $FILE -r 4 -ss 00:00:01 -t 00:00:05 -f image2 $NAME/$NAME%05d.png
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment