View Single Post
Posts: 445 | Thanked: 367 times | Joined on Nov 2010 @ Italy
#1360
what about using a perl script...

this one is for timelapse

Code:
# 2009.12.17  First version.
# 2009.12.24  Better gstreamer pipeline; more options, with better descriptions.

use strict;

#---- CONFIG SECTION ---- [BEGIN] ----

 my ($x,$y) = (800, 480);               # image resolution - try (2592, 1968)
 my $cam    = 0;                        # camera: 0 = back, 1 = front
 my $dir    = '/home/user/MyDocs/FCamera'; # folder where images will be saved
 my $max    = 800;  # total number of images to take
 my $delay  = 3;  # interval between pictures

#---- CONFIG SECTION ----  [END]  ----

die "$dir not found!\n" if !-d $dir;

my $gst = "/usr/bin/gst-launch v4l2camsrc device=/dev/video$cam num-buffers=1 ! ffmpegcolorspace ! video/x-raw-yuv,width=$x,height=$y ! jpegenc ! filesink location=";

my $num=0;

print "Intervalometer started - will take $max pictures at $x x $y\n";

while ($num < $max) {
	$num=sprintf'%05d',$num;
	`$gst$dir/$num.jpg`;
	printf "saved %d of %d", $num+1, $max;
	$num++;
	if ($num < $max) { print " - sleeping $delay sec."; sleep $delay; }
        print "\n";
}
is it possible to set delay to 1/8 second ?
__________________
Flickr photos taken with N900 https://www.flickr.com/cameras/nokia/n900/
"Closed source software tells you what you can do. With open source, you decide what software can do for you" Richard Stallman