title: redirect a live stream page to other pages in Flask
body: <p>I'm working on a project on an IoT device based on Flask and OpenCV. I found that when I visited the live stream page, there <strong>was not any response</strong> when I clicked the hyperlinks(these hyperlinks point to other pages) or submit a form.The only thing I can do is to go back. And then, sometimes the camera cannot be released properly and throws the errors</p>
  
  <pre><code>HIGHGUI ERROR: libv4l unable to ioctl S_FMT
  libv4l2: error setting pixformat: Device or resource busy
  </code></pre>
  
  <p>The code I use:</p>
  
  <pre><code>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()
  </code></pre>
  
  <p>Could anyone tell me how to submit a form on a live stream page? And how to make sure that the camera has been released properly? Thanks</p>