Код: Выделить всё
@app.route("/Record" , methods=['GET', 'POST'])
def Record():
cv2.namedWindow("preview")
vc = cv2.VideoCapture(0)
if vc.isOpened(): # try to get the first frame
rval, frame = vc.read()
else:
rval = False
while rval:
cv2.imshow("preview", frame)
rval, frame = vc.read()
key = cv2.waitKey(20)
if key == 27: # exit on ESC
break
vc.release()
cv2.destroyWindow("preview")
return render_template('record.html')
Подробнее здесь: https://stackoverflow.com/questions/777 ... ing-python
Мобильная версия