PriNet has asked for the wisdom of the Perl Monks concerning the following question:

This question has been probably asked 1000 times...

Is there a win32 compliment to the v4l module so I can write a perl program to capture (all 4 ports) of my bt8x video capture card so I can manipulate the video? (yes, i'm using win32-perl) I've found the POGL (w/GLUT) approach, but, not any REAL information on how to install in windows. Also, there does not appear to be any VFW CPAN module available. So, again, my question is; is there a windows equivalant to the linux v4l that I can use without having to learn linux (or C for that fact)?

Thanx in advance for any direction *heh*

you mean there's any easier way?

Replies are listed 'Best First'.
Re: video capture card
by Corion (Patriarch) on Nov 04, 2011 at 18:17 UTC

    I had some limited access in using the ffmpeg executable to capture video on Windows and piping the capture as raw frames into Perl. But it never was what I'd call reliable, but that also was in 2008 (App::VideoMixer). I think that VFW went out of style in or before 2008 and WDM capture never was accessible to me, and I'm unaware of any modules for it either.

    my $pid = open my $capture, 'ffmpeg -r 15 -f vfwcap -i 0 -f rgba -o - +|' or die "$! / $?"; binmode $capture; # assume rgba my $frame_size = $width * $height * 4; $/ = \$frame_size; while (my $frame = <$capture>) { ... };
Re: video capture card
by zentara (Cardinal) on Nov 05, 2011 at 11:59 UTC
    I havn't tried it on Windows, but there are binaries for Windows Mplayer Mplayer for Windows.

    As with ffmpeg, you can capture frames with

    mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 +-frames 10 -vo jpeg
    also see ztk-v4l-video-bloger/recorder for how to capture video with mplayer in a Tk window. It uses V4l, but updating it to V4l2 would be easy.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh