looking for help about python-sane



I m looking for help about python-sane, The follow sample code try to grab the image from the webcam through a /dev/video0 on linux, it works fine for the first 185 times, but it freeze the computer when i ~ 185, I dont know why?

The computer become very busy when i > 160, very strange?

I m using Ubuntu 5.10 Linux

Thanks


-----------------------code start------------------

#! /usr/bin/python

import sane, time, Image

def grabImage(_webcam):
_webcam.mode='color'
_webcam.start()
img=_webcam.snap()
return img



for i in range(200):
print 'i=', i
sane.init()
webcam = sane.open('v4l:/dev/video0')
grabImage(webcam)
webcam.close()
sane.exit()
time.sleep(1)
----------------------code end-------------------

---------------------output--------------------
i=0
i=1
i=2
.....


i= 182
i= 183
i= 184
i= 185
Traceback (most recent call last):
File "testSane.py", line 17, in ?
grabImage(webcam)
File "testSane.py", line 7, in grabImage
_webcam.start()
File "/usr/lib/python2.4/site-packages/sane.py", line 201, in start
return self.dev.start()
_sane.error: Error during device I/O
.



Relevant Pages

  • Re: good webcam for Linux (low light, mic, just works)
    ... I am looking to buy a good webcam for linux. ... Logitech Quickcam Connect Webcam ... Optia AF (uvcvideo driver too), ...
    (Debian-User)
  • Re: Why Im going back to windows from Suse.
    ... > 3) NO Webcam recording software for linux such as Aloecam, ... Works fine with easygprs on windows. ... > 5) It took a major act of God to get my wireless card working in Suse ...
    (alt.os.linux.suse)
  • Re: Linux Laptop
    ... The built in webcam quiality is quite poor and one of the things that won't be supported in Linux, can be better to spend a few bucks on an USB webcam that has Linux drivers. ... High resolution is expensive and it usually means that you will have to look at a machine with a high end graphics card, even if lesser cards would manage to deliver the needed resolution, but it's something that usually is matched together, good LCD and High End Graphics card. ...
    (alt.os.linux)
  • Re: Why Im going back to windows from Suse.
    ... NO Webcam recording software for linux such as Aloecam, ... Works fine with easygprs on windows. ... > winprinter so partially my fault but still a frustration) ...
    (alt.os.linux.suse)
  • Removing WebCam Device
    ... I am running RH9 and am not too experienced with Linux. ... interfere wiith my onboard sound chip. ... If I unplug the USB webcam and reboot, Kudzu finds four "unknown sound card" ... When RH finishes the mixer has all its ...
    (alt.os.linux.redhat)