http://www.perlmonks.org?node_id=792178

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

Hi Guys,

I've been trying to access my windows webcam for a little while now, the only way I have been able to do it is by using a standard package to boadcast it on 'localhost' like Broadcam or something. The issue with this is it's very heavy on the CPU and degrades the picture at the same time. Really what I'd like is a bit of Perl code that access the webcam directly, does anyone have something like this?

Regards

Update: What about EZTWAIN? There seems to be a perl module Win32::Scanner::EZTWAIN, but I've not been able to get a clean install.

It depends on Win32::API (note clean install)

C:\Perl>perl -MCPAN -e "install Win32::API" Set up gcc environment - 3.4.5 (mingw special) CPAN: Storable loaded ok (v2.16) Going to read C:\Perl\cpan\Metadata Database was generated on Sun, 30 Aug 2009 06:27:00 GMT Win32::API is up to date (0.59).

But the Win32::Scanner::EZTWAIN gives me:

C:\Perl>perl -MCPAN -e "install Win32::Scanner::EZTWAIN" Set up gcc environment - 3.4.5 (mingw special) CPAN: Storable loaded ok (v2.16) Going to read C:\Perl\cpan\Metadata Database was generated on Sun, 30 Aug 2009 06:27:00 GMT Running install for module 'Win32::Scanner::EZTWAIN' Running make for L/LE/LENNERTO/Win32-Scanner-EZTWAIN-0.01.tar.gz CPAN: Digest::SHA loaded ok (v5.47) CPAN: Compress::Zlib loaded ok (v2.015) Checksum for C:\Perl\cpan\sources\authors\id\L\LE\LENNERTO\Win32-Scann +er-EZTWAIN -0.01.tar.gz ok CPAN: Archive::Tar loaded ok (v1.42) Win32-Scanner-EZTWAIN-0.01/ Win32-Scanner-EZTWAIN-0.01/EZTWAIN.pm Win32-Scanner-EZTWAIN-0.01/README Win32-Scanner-EZTWAIN-0.01/Makefile.PL Win32-Scanner-EZTWAIN-0.01/Changes Win32-Scanner-EZTWAIN-0.01/MANIFEST Win32-Scanner-EZTWAIN-0.01/test.pl CPAN: File::Temp loaded ok (v0.21) CPAN.pm: Going to build L/LE/LENNERTO/Win32-Scanner-EZTWAIN-0.01.tar +.gz Set up gcc environment - 3.4.5 (mingw special) Checking if your kit is complete... Looks good Writing Makefile for Win32::Scanner::EZTWAIN Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. cp EZTWAIN.pm blib\lib\Win32\Scanner\EZTWAIN.pm LENNERTO/Win32-Scanner-EZTWAIN-0.01.tar.gz nmake -- OK Warning (usually harmless): 'YAML' not installed, will not store persi +stent stat e Running make test Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. C:\Perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl 1..1 # Running under perl version 5.008008 for MSWin32 # Win32::BuildNumber 822 # Current time local: Mon Aug 31 15:10:31 2009 # Current time GMT: Mon Aug 31 18:10:31 2009 # Using Test.pm version 1.25 Can't load 'C:/Perl/site/lib/auto/Win32/API/API.dll' for module Win32: +:API: load _file:Invalid access to memory location at C:/Perl/lib/DynaLoader.pm l +ine 229. at blib\lib/Win32/Scanner/EZTWAIN.pm line 17 Compilation failed in require at blib\lib/Win32/Scanner/EZTWAIN.pm lin +e 17. BEGIN failed--compilation aborted at blib\lib/Win32/Scanner/EZTWAIN.pm + line 17. Compilation failed in require at test.pl line 10. BEGIN failed--compilation aborted at test.pl line 10. NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code + '0x2' Stop. LENNERTO/Win32-Scanner-EZTWAIN-0.01.tar.gz nmake test -- NOT OK Warning (usually harmless): 'YAML' not installed, will not store persi +stent stat e Running make install make test had returned bad status, won't install without force