in reply to Re: capturing raw video with v4l
in thread capturing raw video with v4l
New code which outputs blue-tinted pnm's.
#!/usr/bin/perl use Video::Capture::V4l; $grab = new Video::Capture::V4l or die "Unable to open Videodevice: $!"; $|=1; my $frame=0; my $fr=$grab->capture ($frame, 320, 240); my $count=0; for(1..5) { my $nfr = $grab->capture (1-$frame, 320, 240); $grab->sync($frame) or die "unable to sync"; # save $fr now, as it contains the raw BGR data open (JP,">z$count.pnm") or die $!; print JP "P6\n320 240\n255\n"; #header print JP $nfr; close JP; print "."; $count++; $frame = 1-$frame; $fr = $nfr; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: capturing raw video with v4l
by BobbyVector (Monk) on Feb 18, 2004 at 16:08 UTC | |
by zentara (Cardinal) on Feb 18, 2004 at 16:15 UTC |