Re: Video::Capture example?

From: Stan Brown (stanb_at_panix.com)
Date: 10/31/03


Date: Fri, 31 Oct 2003 00:32:20 +0000 (UTC)

In <4u32qvgthijulq4baguj941i6a9jhr8g7p@4ax.com> zentara <zentara@highstream.net> writes:

>On Wed, 29 Oct 2003 15:15:27 +0000 (UTC), Stan Brown <stanb@panix.com>
>wrote:

>>I'm writing a perl script to capture images from some cameras, and make
>>mpes out of them on Linux.
>>
>>I't basicly working using system() calls to v4lctl, but that is slowing
>>things dow, spawning a seperate task for each capture.
>>
>>I've found the Video::Captur module, and I think it's the way to go.
>>However it has no documentation for the calls, and the example programs
>>have no comments.
>>
>>Could anyone point me to a working example of capturing an image using
>>this? I suspect I jyst need to traslate a couple of v4;ctl commands to the
>>corect syntax for using this module. EG:

>Here is a Tk camera capture program is wrote. The biggest obstacles are
>making sure the camera syncs, and converting the raw BGR data to RGB.
>There are a couple of different ways you can do this, I used a technique
>of reversing the data, then flipping it with Imager. Imager also has a
>more direct matrix method, but I think it was a bit slower that way.
>Read "perldoc Imager::Transformations".

Thanks for the help on this again!

I've managed to integrate major peices of this into my script, and have it
working! But I've got a few questiosn, if some kind soul could enlighten me
a bit further.

First, why do we go through the capture/convert loop twice per grab?

for ( 0 .. 1 ) {
    my $nfr = $grab->capture( 1 - $frame, 640, 480 );

I've been benchmarking, and it seems that the 2nd pass take much longer
than the first.

second, could someone explain these calls to me?

my $channel = $grab->channel(0);
my $tuner = $grab->tuner(0);
$tuner->mode(1);
$channel->norm(1);
$tuner->set;
$channel->set;

It appears to me that first read the chanlel (and tuner ? what's a tuner?)
The set them back?

And finally, if I want to use the 2nd capture card, I pass a 1 to the first
2 calls, right?

Thansk again for all the help on this!

-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
						-- Benjamin Franklin


Relevant Pages

  • Creating a Tuner Object
    ... Just getting started with TV Tuners and Video Capture in DShow and I ... Add Hauppauge Win PVR PCI II TV Audio ... Link Tuner Analog Audio to TV Audio In on the Audio filter ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: tv tuner capture - how
    ... insert a DVD in a PC that is equipped with this reader ... DVD is displayed, try t capture the screen, then paste it into some ... > What brand is the TV tuner? ... > Remember that Google is your friend. ...
    (microsoft.public.vb.general.discussion)
  • Re: Tv tuner card remote: how does it work, at the back of computer
    ... split the cable feeding the STB and your in-PC tuner can then ... Using this method you can tune and capture more than one channel ...
    (alt.tv.tech.hdtv)
  • Re: SlingBox owners?
    ... tv tuner card to capture for instance. ... laptop and deal with cables and such.... ... VLC is a media player/streamer etc. ...
    (rec.arts.tv)
  • Re: Video::Capture example?
    ... >>I't basicly working using systemcalls to v4lctl, ... spawning a seperate task for each capture. ... "They that would give up essential liberty for temporary safety deserve ...
    (comp.lang.perl.misc)