Last active
June 14, 2017 08:26
-
-
Save kencoba/e28f7bd368c8a80ab94a07a9cb81951f to your computer and use it in GitHub Desktop.
create thresholded images from mp4 file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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