0
我正在基于Flask和OpenCV的物联网设备上开展项目。我发现,当我访问实时流页面时,当我点击超链接(这些超链接指向其他页面)或提交表单时,没有任何回应。我唯一能做的就是回去。然后,有时候相机不能正常释放,抛出错误将直播页面重定向到Flask中的其他页面
HIGHGUI ERROR: libv4l unable to ioctl S_FMT
libv4l2: error setting pixformat: Device or resource busy
我使用的代码:
def gen_normal():
cap = cv2.VideoCapture(0)
while True:
success, img = cap.read()
_,frame = cv2.imencode('.jpg',img)
yield (b'--frame\r\n'
b'Content-Type: image/jpeg\r\n\r\n' + frame.tobytes() + b'\r\n\r\n')
cap.release()
谁能告诉我如何提交直播流页面上的表单?以及如何确保相机已正确释放?谢谢