title: OpenCV error: (-215) scn == 3 || scn == 4 in function ipp_cvtColor
body: <p>I tried playing a video from a file, as given in the tutorials. My program was as follows:</p>
  
  <pre><code>import numpy as np
  import cv2
  
  cap = cv2.VideoCapture('output.avi')
  
  while(cap.isOpened()):
      ret, frame = cap.read()
      frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
      cv2.imshow('outVideo',frame)
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>But I got the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "playVideo.py", line 8, in &lt;module&gt;
      frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  cv2.error: /home/hp/opencv/modules/imgproc/src/color.cpp:7456: error: (-215) scn == 3 || scn == 4 in function ipp_cvtColor
  </code></pre>
  
  <p>I checked ret and it turned out to be False.
  So the actual problem is with saving video. I used the following code to save 'output.avi' using VideoWriter function:</p>
  
  <pre><code>import numpy as np
  import cv2
  
  cap = cv2.VideoCapture(0)
  fourCc = cv2.VideoWriter_fourcc(*'XVID')
  out = cv2.VideoWriter('output.avi',fourCc,20.0,(640,480))
  
  while(cap.isOpened()):
      ret, frame = cap.read()
      if ret==True:
          frame = cv2.flip(frame,0)
          out.write(frame)
          cv2.imshow('frame',frame)
          if cv2.waitKey(1) &amp; 0xFF == ord('q'):
              break
      else:
          break
  
  cap.release()
  out.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>I am not able to open 'output.avi', even using VLC</p>