View Single Post
Posts: 59 | Thanked: 71 times | Joined on Sep 2009 @ Brazil
#1
Hi All!

I'm part of the KAPing with the N900 team, developing a KAP (Kite Aerial Photography) system for the Push N900 project.

While testing some ideas, I wrote this simple, quick-and-dirty intervalometer in Perl that you can run from the X Terminal of your N900. Install gstreamer, since this script will use it. You can take as many pictures as you want ($max) with a fixed interval in seconds ($delay). Just be sure to save them in a valid folder ($dir). I compiled a video with the pictures I took in a session, check it out if you want to.

So, here is the code, as requested:

EDIT: a better one is down on this page

Code:
#!/usr/bin/perl -w

# A simple intervalometer for the Nokia N900
# Author: Ricardo Mendonca Ferreira - ric@mpcnet.com.br
# Date: 2009.12.17

use strict;

my $dir = '/home/user/MyDocs/test';
my $gst = '/usr/bin/gst-launch v4l2camsrc device=/dev/video0 num-buffers=1 ! omx_jpegenc ! filesink location=';
my $max=1000;
my $delay=2;

my $num=0;

while ($num < $max) {
	$num=sprintf'%05d',$num;
	`$gst$dir/$num.jpg`;
	print "($num/$max - ", $max-$num, " to go)\n";
	sleep $delay;
	$num++;
}

Last edited by Ricardo; 2009-12-24 at 20:41. Reason: Added link for improved script
 

The Following 26 Users Say Thank You to Ricardo For This Useful Post: