I am trying to write a basic frame grabber but am having problems with 
Video::Capture::V4l.

My camera is attached and loaded:
/var/log/messages
---------------------------
Oct 23 10:07:00 lsn kernel: drivers/usb/media/ov511.c: Sensor is an OV7610
Oct 23 10:07:01 lsn kernel: drivers/usb/media/ov511.c: Device at usb-0000:00:02.2-2 
registered to minor 0

dmesg
----------
usb 1-2: new full speed USB device using address 13
drivers/usb/media/ov511.c: USB OV511 video device found
drivers/usb/media/ov511.c: model: Creative Labs WebCam 3
drivers/usb/media/ov511.c: Sensor is an OV7610
drivers/usb/media/ov511.c: Device at usb-0000:00:02.2-2 registered to minor 0

The initial test program (test_V4l.pl):
---------------------------------
#!/usr/bin/perl
use strict;
use Video::Capture::V4l;
my $grab = new Video::Capture::V4l("/dev/video0") or die "Unable to open Video device: 
$!";
print "silent error:$!\n";
$grab->sync(0) or die "unable to sync: $!\n";
---------------------------------

Although ' new Video::Capture::V4l("/dev/video0")' creates a new object, there is a 
silent error:
[EMAIL PROTECTED] video4linux]# ./test_V4l.pl
silent error:Illegal seek
unable to sync: Invalid argument
[EMAIL PROTECTED] video4linux]#

I have poked around in 
/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/Video/Capture/V4l.pm
and the error code is being set at line 96:
sysopen($self->{handle}, $device, O_RDWR) or return;
but it does not cause the command to fail so the 'new' function continues to
finish and the calling program does not fail on or die "Unable to open Video device: 
$!";

I am running test_V4l.pl as root. The permissions on /dev/video0 are:
crw-rw-rw-   1 cs   root    81,   0 Feb 23  2004 video0

And yes, /dev/video0 is the camera. If I run my video4linux camera detection program, 
it finds the camera.
[EMAIL PROTECTED] video4linux]$ ./probe_usb_V4l.pl
Access point:           /dev/video0
Device:                 name(OV511 USB Camera), type(capture, subcapture), 
video_channels(1), supported_sizes(64x48-640x480)
Picture Settings:       brightness(11520), hue(39168), colour(40960), contrast(0), 
whiteness(26880), depth(12), palette(10)
Channel 0:              name(Camera), type(camera), norm(PAL)
[EMAIL PROTECTED] video4linux]$

any ideas?

thanks,
Christopher


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to