title: playing video in Centos using opencv python
body: <p>I am following this tutorial from openCV to play back a video on centos .</p>
  
  <p><a href="http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html" rel="nofollow noreferrer">openCV tutorial</a></p>
  
  <p>see the code below , it doesn't throw any errors but does not show any videos being played.  If I use the image display program it works fine which tells me the X11 forwarding part is working fine .</p>
  
  <pre><code>[root@hadoop1 basic-motion-detection]# more demo1.py
  import numpy as np
  import cv2
  
  cap = cv2.VideoCapture('/home/admin/example_02.mp4')
  
  while(cap.isOpened()):
      ret, frame = cap.read()
  
      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
      cv2.startWindowThread()
      cv2.namedWindow("preview")
      cv2.imshow('preview',gray)
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>