hey,
thanks for your work, helped a lot. Anyway, i faced an error embedding this to my RasPi zero W and so i had to modify your code:
_
VIDEOIO(V4L2:/dev/video0): can't open camera by index
_
I fixed it by rewrite and include cv2.VideoCapture(0) into the video_stream() function:
def video_stream():
video = cv2.VideoCapture(0)
while True:
ret, frame = video.read()
if not ret:
break;
else:
ret, buffer = cv2.imencode('.jpeg',frame)
frame = buffer.tobytes()
yield (b' --frame\r\n' b'Content-type: imgae/jpeg\r\n\r\n' + frame +b'\r\n')
video.release()
after that, it workes as intended.
Best Regards
Fabian
hey,
thanks for your work, helped a lot. Anyway, i faced an error embedding this to my RasPi zero W and so i had to modify your code:
_
VIDEOIO(V4L2:/dev/video0): can't open camera by index
_
I fixed it by rewrite and include cv2.VideoCapture(0) into the video_stream() function:
after that, it workes as intended.
Best Regards
Fabian