Skip to content

Instantly share code, notes, and snippets.

@kencoba
Last active June 14, 2017 08:26
Show Gist options
  • Save kencoba/e28f7bd368c8a80ab94a07a9cb81951f to your computer and use it in GitHub Desktop.
Save kencoba/e28f7bd368c8a80ab94a07a9cb81951f to your computer and use it in GitHub Desktop.
create thresholded images from mp4 file.
#!/usr/bin/env zsh
if [ $# -ne 2 ]; then
echo "$# args specified" 1>&2
echo "usage: sh ./mp42png.sh mp4_filename output_directory" 1>&2
exit 1
fi
( mkdir -p $2 && rm -rf $2 && ffmpeg -i $1 -r 1 -vcodec png $2/%05d.png && mogrify -threshold 50% $2/*.png )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment