VideoCapture(0) stuck on my mac(OSX 10.9.5 Python 2.7 OpenCV 2.4)!
I am doing video streaming by using VideoCapture(0).
There are two scripts:main.py(use for get the frame). camera.py(use for return the frame captured by camera)
The system is deployed in Flask.
Here is my camera script:
%camera.py
import cv2
class VideoCamera(object):
def __init__(self):
print 'before video success!'
self.video = cv2.VideoCapture(1) *it stuck at this line!
print 'after video success!'
self.video.set(3,320)
self.video.set(4,240)
self.video.set(15, 0.1)
def __del__(self):
self.video.release()
def get_frame(self):
success, image = self.video.read()
ret, jpeg = cv2.imencode('.jpg', image)
return jpeg.tobytes()
There is no error,just print 'before video success!' and stuck at this line!
I'm having the same problem