Ask Your Question
0

SimpleCV - IO error when running IP camera

asked 2013-02-23 17:57:08 -0600

decrot gravatar image

updated 2013-02-23 17:57:53 -0600

So I tried this simplecv example using a ipcamera from my iphone and a app called ipcam

from SimpleCV import JpegStreamCamera, Display
import time

# initializes the IP Camera
cam = JpegStreamCamera('ipcamera address')

display = Display()
img = cam.getImage()
img.save(display)
while not display.isDone():

    img = cam.getImage()
    img.drawText(time.ctime())
    img.save(display)
    time.sleep(1)

It works for the first minute, but leaving it on too long will error out

Traceback (most recent call last):
File "/home/user/ipcameraexample.py", line 12, in <module>
  img = cam.getImage()
File "/usr/lib/pymodules/python2.7/SimpleCV/Camera.py", line 904, in getImage
  return Image(pil.open(StringIO(self.camthread.currentframe)), self)
File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 1980, in open
  raise IOError("cannot identify image file")
IOError: cannot identify image file

anyone know why I'm getting this error and more importantly, how to fix it? the video feed from a browser still works so it seems specific to simpleCV

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-02-25 09:15:16 -0600

kscottz gravatar image

Hi,

Sorry you are having issues with SimpleCV. I was trying to use the JpegStreamCamera last night with my FIRST robotics team and ran into very similar issues. We are using an Axis M1011 camera for our robot. I am going to try to debug those issues tonight. I will probably have a blog post soon on we are working around them. If you check my personal twitter account and the dev github repo there should be a fix and a tutorial in the next few days. In the meantime this wiki lists the known IP camera configurations.

edit flag offensive delete link more
0

answered 2013-02-25 17:29:49 -0600

xamox gravatar image

You may also need to verify your camera feed IP address. Typically it needs to be in the form of:

http://username:pass@my.ipcam.ipaddress/stream.cgi

The last part may not necessarily be /stream.cgi, you can test by loading in a browser such as firefox or chrome that support that form of JpegStream.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-02-23 17:57:08 -0600

Seen: 3,926 times

Last updated: Feb 25 '13