cv2.Videocapture() works fine while using webcam but while trying to read from hard drive it shows error cap.isOpened() returns false
import cv2
import numpy as np
background=cv2.imread('background.png')
cap = cv2.VideoCapture('car video.mp4')
cap.open('car video.mp4')
print cap.isOpened()
while 1:
ret,img=cap.read()
cv2.imshow('a',img)
print img.shape
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
It shows this error
cv2.imshow('a',img)
error: ..\..\..\..\opencv\modules\highgui\src\window.cpp:266: error: (-215) size.width>0 && size.height>0 in function cv::imshow
my opencv version 3.0.0, python 2.7, windows10 32 bit