[Gambas-user] web cam

Rob sourceforge-raindog2 at ...94...
Tue Jan 6 14:54:35 CET 2004


On Tuesday 06 January 2004 06:53, Marcelo Duschkin wrote:
> How can I "take a picture" from a web cam to a file, inside
> Gambas? Is it possible?

Depends on the web cam.  Most web cams nowadays have a 
video4linux interface in which case you can just EXEC streamer 
(part of xawtv, but under Mandrake at least it has its own 
package) with the WAIT option and then just open the file to do 
whatever with it.  I think you might even be able to use 
streamer -o - -f jpeg 2>/dev/null and use Gambas' Process_Read 
event to get the jpeg data into Gambas directly without writing 
a file.  Some more obscure webcams have their own tools, or 
(like the $10 USB light with a camera in it by SIIG that I 
bought on clearance) aren't supported at all.

I fully expect that someday down the road Gambas will have native 
components for v4l, sane, imagemagick, all that good stuff.... 
someone with C skills just needs the time and desire to write 
them.  (I'm almost there as regards Imagemagick.)  In the 
meantime, unlike with VB, you can reliably use the output from 
command line tools from Gambas in a supported way.

Rob





More information about the User mailing list