Created
November 5, 2014 20:49
-
-
Save addamh/1efd772ef2ba7900efe2 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/bash | |
# | |
# Create timelapse movies from images in the output/screen and output/isight folders | |
# | |
SOURCES=( screen isight ) | |
# IMGSRC=isight | |
for src in "${SOURCES[@]}" | |
do | |
COUNTER=0; | |
rm output/$src/series/*.jpg | |
for i in `find output/$src -name '*.jpg'` ; | |
do | |
# Write the filename to be friendly with ffmpeg's old filename input | |
FILENAME=`printf '%05d.jpg' $COUNTER` | |
cp $i output/$src/series/$FILENAME | |
let COUNTER=COUNTER+1; | |
done | |
nice ffmpeg -r 24 -i output/$src/series/%5d.jpg output/videos/timelapse-$src.mov | |
done |
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/bash | |
# timelapse | |
# | |
# Records a sequence of screencaptures at regular intervals on | |
# Mac OS X. | |
# | |
# Can also record using webcam via the imagesnap program. | |
# | |
while true; do | |
timestamp=$(date '+%Y-%m-%dT%H%M%S'); | |
echo "Capturing screen at $timestamp." | |
# For one screen: | |
screencapture -t jpg -x "output/screen/screen1-$timestamp.jpg"; | |
# For two screens: | |
# screencapture -x "screen1-$timestamp.png" "screen2-$timestamp.png"; | |
# If you have a webcam, you might want to capture that too. | |
#echo "Capturing isight at $timestamp." | |
#./imagesnap/imagesnap -q "output/isight/isight-$timestamp.jpg"; | |
# sleep 60; | |
sleep 15; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment