Video-Capture-V4l
view release on metacpan or search on metacpan
examples/grab view on Meta::CPAN
#!/usr/bin/perl
use Video::Capture::V4l;
sub print_capability {
my $c=shift;
print "Device: ";
print "name ",$c->name;
print ", type";
for (qw(capture tuner teletext overlay chromakey clipping frameram scales monochrome subcapture)) {
print " $_" if eval "\$c->$_";
}
print ", channels ",$c->channels;
print ", audios ",$c->audios;
print ", sizes ",$c->minwidth,"x",$c->minheight,"-",$c->maxwidth,"x",$c->maxheight;
print "\n";
}
sub print_channel {
my $c=shift;
print "Channel ",$c->channel,": ";
print "name ",$c->name;
print ", tuners ",$c->tuners;
print ", flags";
for (qw(tuner audio)) {
print " $_" if eval "\$c->$_";
}
print ", type";
for (qw(tv camera)) {
print " $_" if eval "\$c->$_";
}
# PAL, NTSC, SECAM, PAL-NC, PAL-M, PAL-N, NTSC-Japan
print ", norm ",$c->norm;
print "\n";
}
sub print_tuner {
my $c=shift;
print "Tuner ",$c->tuner,": ";
print "name ",$c->name;
print ", range ",$c->rangelow,"-",$c->rangehigh;
print ", flags";
for (qw(pal ntsc secam low norm stereo_on rds_on mbs_on)) {
print " $_" if eval "\$c->$_";
}
print ", mode ",$c->mode;
print ", signal ",$c->signal;
print "\n";
}
sub print_audio {
my $c=shift;
print "Audio Channel ",$c->audio,": ";
print "volume ",$c->volume;
print ", bass ",$c->bass;
print ", treble ",$c->treble;
print ", flags";
for (qw(mute mutable volume bass treble)) {
print " $_" if eval "\$c->$_";
}
print ", name ",$c->name;
print ", mode ",$c->mode;
print ", balance ",$c->balance;
print ", step ",$c->step;
print "\n";
}
sub print_picture {
my $c=shift;
print "Picture Settings: ";
( run in 0.458 second using v1.01-cache-2.11-cpan-99c4e6809bf )