Skip to content

Instantly share code, notes, and snippets.

@videlalvaro
Created August 26, 2010 06:23
Show Gist options
  • Save videlalvaro/550922 to your computer and use it in GitHub Desktop.
Save videlalvaro/550922 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Usage:
# Take 1 picture every second, during one hour
# ./slacking 3600 1
#
N=0
PICS_PATH="/path/to/pics/destination"
echo "Capturing " $1 " images with an interval of " $2 " seconds"
while [ $N -lt $1 ]; do
let N=N+1
NAME=`printf "%s/%04d.jpg" $PICS_PATH $N`
echo $NAME
screencapture -x -tjpg $NAME
sleep $2
done
cd $PICS_PATH
ffmpeg -f image2 -i %04d.jpg -r 15 -s hd480 -vcodec libx264 -vpre hq -crf 16 slacking_480.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment