timelapse box notes

install imagemagick, ffmpeg, motion, vlc, mplayer, sox

scripts->
capture.sh:

#! /bin/bash
# edit config files to capture timelapse frames every 30 seconds/min/etc
# edit text to display at bottom of each snap
motion -c /etc/motion/motion.conf

recordaudio.sh

#! /bin/bash
# boranj!
# see instructions here:
# https://broadcasterproject.wordpress.com/2010/07/14/how-to-make-a-timelapse-shared-memory-server/
# see also screencast version here: http://plebiandesign.com/blog/?p=552
# ************* for capturing frames from a camera:
# ************* LINUX is STREAMER
# ************* MAC is WACAW
# *****************************
# lots of garbage in here you can filter out *********
# ******************************
# whatever you want to be your directory of files
cd ~/Pictures/OMPD
# make a subdirectory with today’s date, then go to it.
mkdir `date +%Y%m%d`
cd `date +%Y%m%d`

DDDATE=`date +%Y%m%d`
TOMORROW=`date -d tomorrow +%Y%m%d`
DATETIME=`date +%Y%m%d%H%M%S`

while [ $DDDATE -lt $TOMORROW ] || [ $HOURNOW -ne 1 ]
do
FLAG=0
DDDATE=`date +%Y%m%d`
DATETIME=`date +%Y%m%d%H%M%S`

NOWDATE=`date +%Y%m%d`

HOURNOW=`date +%H`

rec -c 1 audio$DATETIME.wav trim 0 00:00:02.00

sleep 200
echo yofool $DATETIME
# number of seconds between shots
done

## ###### ##### make AUDIO AND MOVIE FOR DAY ########

echo “DONE with audio for the day”
~/audiocombine.sh
echo “audio combined”
#ffmpeg -i movNoSound.mp4 -vcodec copy -i mixed.mp3 -ab 192k movSound.mp4

see instructions for youtube autoupload

makemovie.sh:

#! /bin/bash

###
#https://broadcasterproject.wordpress.com/2010/05/18/how-to-layerremix-videos-with-free-command-line-tools/
# MAKE background image with imagemagick.
#convert -size 640×480 gradient: -evaluate sin 20 wave_gradient.png

## yesterday’s date?
## how to erase day old files?

## timelapse video thing to be used in conjunction with motion.
##

##DIRECTORY WHERE MOTION IMAGES ARE WRITTEN
MOTDIR=”/tmp/motion”

## DDDATE=`date +%Y%m%d`
DDDATE=`date -d yesterday +%Y%m%d`
#DDDATE=20110402
YESTERDAY=`date -d yesterday +%Y%m%d`

DATETIME=`date +%Y%m%d%H%M%S`
mkdir ~/Pictures/$YESTERDAY
cd ~/Pictures/$YESTERDAY
STARTHOUR=13
ENDHOUR=23

#for (( c=${STARTHOUR}; c input, Y -> output
## Y_1 = X_1
## Y_N = Y_{N-1} + alpha*X_N
## alpha is 0..1 here but 0..100 in IM
##### ##### ##### ##### ##### ##### #####
cntr=100001
cp cam${cntr:1}.jpg filter${cntr:1}.jpg
cp cam${cntr:1}.jpg last.jpg
cntr=100000
alpha=25 # o to 100 in imagemagick.
for f in cam*.jpg; do
let “cntr+=1”
composite -blend $alpha cam${cntr:1}.jpg last.jpg -alpha Set filter${cntr:1}.jpg

cp filter${cntr:1}.jpg last.jpg

# BLUR
#composite -blend 50 ${DA}${counter:1}.jpg ${DB}${c2:1}.jpg -matte ./blur${counter:1}.jpg

# SLICES
convert cam${cntr:1}.jpg filter${cntr:1}.jpg ~/text2.jpg -compose over -composite ./MIX${cntr:1}.jpg

done
echo “made blends and mixes and such, now i will make movies”

ffmpeg -i MIX%5d.jpg -sameq ~/Videos/Loop/mixt-$YESTERDAY-a$alpha.mpg

# ffmpeg -i cam%5d.jpg -sameq ~/Videos/testout$YESTERDAY.mpg

ffmpeg -i ~/Videos/Loop/mixt-$YESTERDAY-a$alpha.mpg -vcodec copy -i ~/Pictures/OMPD/$YESTERDAY/mix2.wav ~/Videos/sound-$YESTERDAY-k.mpg
echo “made some movies for $YESTERDAY”

#youtube-upload –email=allasiatwvee@gmail.com –password=****** –description=”All Asia Cafe, 334 Mass ave. Cambridge MA 02139. This video is in the public domain. ” –category=”Music” –keywords=”publicdomain, cambridge, rock, club, live, music” –title=”$YESTERDAY” ~/Videos/Loop/sound-$YESTERDAY.mpg

crontab->
# m h dom mon dow command
* 3 * * * /home/allasiabroadcaster/Videos/videochecker.sh
1 1 * * * ~/makeMovie.sh >> ~/movielogfile 2>&1
2 16 * * * rm -rf /tmp/motion/*
1 16 * * * ~/recordaudio.sh >> audiologfile 2>&1

initiate by running capture.sh from terminal

One Response to “timelapse box notes”

  1. All Asia Timelapse Twvee « The Broadcaster Project Says:

    […] using motion now to capture frames. other incomplete notes here GA_googleAddAttr("AdOpt", "1"); GA_googleAddAttr("Origin", "other"); […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: