title: Is it possible to display an OpenCV video inside the IPython /JuPyter Notebook?
body: <p>When running the examples from the OpenCV video processing python tutorials, they all pop up in a dedicated window. I know that the IPython notebook can display videos from disk and YouTube, so I wonder if there is a way to direct the OpenCV video playback to the Notebook browser and have it play in the output cell instead of a separate window (preferably without saving it to disk and then playing it from there).</p>
  
  <p>Below is the code from the OpenCV tutorial.</p>
  
  <pre><code>import cv2
  
  cap = cv2.VideoCapture('/path/to/video') 
  
  while(True):
      # Capture frame-by-frame
      ret, frame = cap.read()
  
      # Our operations on the frame come here
      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  
      # Display the resulting frame
      cv2.imshow('frame',gray)
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  
  # When everything done, release the capture
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>