Created
May 13, 2009 20:11
-
-
Save wizardishungry/111265 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/sh | |
#short circuit if screensaver is running | |
/usr/sbin/lsof /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine && exit | |
CAPTURE="/opt/local/bin/isightcapture -t jpg" | |
cd $HOME/Documents/captures | |
D1=`date +%y%m%d/%H` | |
D2=`date +%y%m%d.%H%M%S` | |
# If the date directory does not exist, create it | |
if [ ! -d $D1 ] ; then | |
mkdir -p $D1 | |
fi | |
# Construct the filename and path and capture a pic | |
FN="$D1/$D2.jpg" | |
$CAPTURE $FN | |
# Make a symlinked image of the last photo taken | |
if [ -h 'last.jpg' ] ; then | |
rm last.jpg | |
fi | |
ln -s $FN last.jpg |
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/sh | |
COUNTER=0; | |
DIR=$HOME/Documents/captures | |
rm $DIR/series/*.jpg | |
for i in `find $DIR -name '*.jpg'` ; | |
do | |
#Write the filename to be friendly with ffmpeg's odd filename input | |
FILENAME=`printf '%03d.jpg' $COUNTER` | |
cp $i $DIR/series/$FILENAME | |
let COUNTER=COUNTER+1; | |
done | |
name="$DIR/videos/timelapse-overall.mp4" | |
nice /opt/local/bin/ffmpeg -y -r 20 -b 64k -i $DIR/series/%3d.jpg $name |
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/sh | |
COUNTER=0; | |
DIR=$HOME/Documents/captures | |
rm $DIR/series/*.jpg | |
for i in `find $DIR -newerBt '1 day ago' -name '*.jpg'` ; | |
do | |
#Write the filename to be friendly with ffmpeg's odd filename input | |
FILENAME=`printf '%03d.jpg' $COUNTER` | |
cp $i $DIR/series/$FILENAME | |
let COUNTER=COUNTER+1; | |
done | |
name="$DIR/videos/timelapse-`date +%Y-%m-%d`.mp4" | |
nice /opt/local/bin/ffmpeg -y -r 20 -b 64k -i $DIR/series/%3d.jpg $name | |
ln -sf $name $DIR/videos/latest.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment