Created
February 13, 2015 23:52
-
-
Save jamak/2f66984dc38029b98a6f to your computer and use it in GitHub Desktop.
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
#! /bin/zsh | |
TIME=$1 | |
FNAME=$2 | |
# if [[ $# != 3]] then; | |
# echo "USAGE: $0 time_interval filename" | |
# exit 2 | |
# fi | |
if [[ -f $FNAME ]]; then | |
echo "filename taken!" | |
exit 2 | |
fi | |
a=0 | |
while true | |
do | |
sleep $TIME | |
screencapture "$(pwd)/img${(l:6::0:)a}.png" | |
((a++)) | |
trap "ffmpeg -framerate 30 -i img%06d.png -c:v libx264 -r 30 -pix_fmt yuv420p $FNAME.mp4;break" 2 | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment