<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Carbon Silk &#187; me</title>
	<atom:link href="http://www.carbonsilk.com/tag/me/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.carbonsilk.com</link>
	<description>Developing Ideas by James Broad</description>
	<lastBuildDate>Sun, 20 Mar 2011 00:28:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Making a time lapse video on Mac</title>
		<link>http://www.carbonsilk.com/development/timelapse-video-mac/</link>
		<comments>http://www.carbonsilk.com/development/timelapse-video-mac/#comments</comments>
		<pubDate>Fri, 01 May 2009 12:42:20 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[me]]></category>
		<category><![CDATA[timelapse]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=122</guid>
		<description><![CDATA[Me on a time lapse from James Broad on Vimeo. This video is what you can create (that or something similar) by following these steps on your Mac. Step 1 Download &#38; install a command line webcam capture utility, we will be using isightcapture http://www.macupdate.com/info.php/id/18598 Open the DMG and extract the binary to /usr/bin/ sudo [...]]]></description>
			<content:encoded><![CDATA[<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4426507&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4426507&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
<p><a href="http://vimeo.com/4426507">Me on a time lapse</a> from <a href="http://vimeo.com/kulor">James Broad</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>This video is what you can create (that or something similar) by following these steps on your Mac.</p>
<h3>Step 1</h3>
<p>Download &amp; install a command line webcam capture utility, we will be using isightcapture<br />
<a href="http://www.macupdate.com/info.php/id/18598">http://www.macupdate.com/info.php/id/18598</a><br />
Open the DMG and extract the binary to <code>/usr/bin/</code><br />
<code>sudo cp /Volumes/isightcapture1_1/isightcapture /usr/bin/</code></p>
<h3>Step 2</h3>
<p>Set up new directory to work in.<br />
Lets use ~/captures/<br />
<code>cd ~</code><br />
<code>mkdir captures</code><br />
<code>mkdir captures/scripts</code><br />
<code>mkdir captures/series</code></p>
<h3>Step 3</h3>
<p>Make script to take photo and save it<br />
<code>cd ~/captures/scripts</code><br />
<code>vi captureme.sh</code></p>
<p>Insert the contents into the file:</p>
<pre>
CAPTURE="isightcapture -t jpg"
cd $HOME/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
</pre>
<p>Save and quit (:wq)</p>
<p>To be able to run this script we need to allow execution permission on this file.</p>
<p><code>chmod a+x captureme.sh</code></p>
<h3>Step 4</h3>
<p>Put your capture script on cron<br />
<code>crontab -e</code></p>
<p>Write the contents:</p>
<pre>* * * * * ~/captures/scripts/captureme.sh</pre>
<h3>Step 5</h3>
<p>Install a utility to convert a series of images to a movie. We will be using <a href="http://www.ffmpeg.org/">ffmpeg</a><br />
<code>cd /tmp/</code><br />
<code>svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg</code><br />
<code>cd ffmpeg</code></p>
<p>We need to install ffmpeg to our machine, this process is going to basically compile the code. Hopefully nothing will go wrong for you here, if it does though, take a look on <a href="http://stephenjungels.com/jungels.net/articles/ffmpeg-howto.html">http://stephenjungels.com/jungels.net/articles/ffmpeg-howto.html</a></p>
<p><code>./configure --enable-shared --disable-mmx</code><br />
<code>sudo make</code><br />
<code>sudo make install</code></p>
<h3>Step 5</h3>
<p>Make script to grab photos and run them through ffmpeg<br />
<code>mkdir ~/captures/videos/</code><br />
<code>cd ~/captures/scripts</code><br />
<code>vi make_complete_sequence.sh</code></p>
<p>Write the contents to the file:</p>
<pre>
COUNTER=0;
rm ~/captures/series/*.jpg
for i in `find ~/captures -name '*.jpg'` ;
do
#Write the filename to be friendly with ffmpeg's odd filename input
FILENAME=`printf '%03d.jpg' $COUNTER`
cp $i ~/captures/series/$FILENAME
let COUNTER=COUNTER+1;
done
nice ffmpeg -r 20 -vcodec copy  -i ~/captures/series/%3d.jpg ~/captures/videos/timelapse_complete.mov
</pre>
<p>Again setting the permissions to be able to run the script and then run it to generate a movie based on the images taken so far.</p>
<p><code>chmod a+x make_complete_sequence.sh</code><br />
<code>./make_complete_sequence.sh</code></p>
<h3>Step 6</h3>
<p>View the finished result<br />
Browse in finder to your home directory &gt; captures/videos and watch the result.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/timelapse-video-mac/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

