Now let’s have some  fun with our camera, we’ll record a time lapse sequence. Point your camera out of a window where there is some action i.e. a busy street or a playground . Open up LX Terminal and type in the the following code, we’ll create a folder named webcam for our time-lapse pics first :

mkdir webcam
cd webcam

lets start the code for the timelapse:

raspistill -o image_%04d.jpg -tl 60000 - t 72000000

This will record an image every minute (60000 milliseconds) for 2 hours (7200000 milliseconds) and place all the pics in our folder webcam. Now’s a good time to have a break – make a cup of tea, maybe do some hoovering – or just do some python tutorials ? After 2 hours you should have a folder of . . . yes you guessed it 120 pictures !! Lets put them together in a time-lapse movie: Back to LX Terminal – type in the following code:

sudo apt-get install mencoder

This will install the software we need to ‘stitch’ the pictures together, now navigate in to your webcam folder:

cd webcam

&

ls *.jpeg >stills.txt

this will make a list of the images in your folder, lets make the time lapse clip – type this long string in one line – pay attention to spaces.

mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:
vbitrate=8000000-vf scale=1920:1080 -o timelapse.avi -mf
type=jpeg:fps=24 mf://@stills.txt

 

you will now have a short clip named timelapse.avi in your folder ready to play with omx-player:

 omxplayer timelapse.avi

Congratulations , you should now have your first time-lapse movie playing on your screen.

Advertisements

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