show image to port

asked 2015-11-24 09:49:06 -0500

xiculan gravatar image

hello, some time ago I'm trying to stream the cam output to http port, I can't reach it. I using a usb cam conected to a raspberry, the script is showed bellow:

> """ Set up a streaming server. """
> 
> import time import SimpleCV
> 
> cam = SimpleCV.Camera() js =
> SimpleCV.JpegStreamer('localhost:8080')
> 
> while True:
>     cam.getImage().save(js.framebuffer)
>     time.sleep(0.1)

I get this error:

VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
libv4l2: error setting pixformat: Device or resource busy
HIGHGUI ERROR: libv4l unable to ioctl S_FMT
libv4l2: error setting pixformat: Device or resource busy
libv4l1: error setting pixformat: Device or resource busy
HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT

WARNING: caught exception: SystemError('ioctl(VIDIOC_S_FMT) failure: no supported formats',)
WARNING: SimpleCV can't seem to find a camera on your system, or the drivers do not work with SimpleCV.
ERROR:
Traceback (most recent call last):
  File "stream.py", line 12, in <module>
    cam.getImage().save(js.framebuffer)
  File "/usr/local/lib/python2.7/dist-packages/SimpleCV/Camera.py", line 618, in getImage
    cv.GrabFrame(self.capture)
TypeError: Expected CvCapture for argument 'capture'
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 505, in run
  File "/usr/lib/python2.7/SocketServer.py", line 235, in serve_forever
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'select'

I'm not shure that I'm doing it on the right way, I was searching in various forums but I can't get good results.

please, can anybody helps me?

thanks

edit retag flag offensive close merge delete