#!/usr/bin/perl

#fgrabber.pl

# Capture and save a single frame from a webcam.
# Refresh every 10 seconds.
# Peter Walsh July 2011

$|=1;

use AnyEvent;


$z_event = AnyEvent->condvar;

$f_event = AnyEvent->timer (after => 1,
                   interval => 10.0,
                   cb => sub { 
      `streamer -c /dev/video0 -b 16 -o fgrabber.jpeg 2> /dev/null`;
      `./remote_copy.sh`; # move file to web server
                         });


$z_event->recv;

