import cv2
import numpy
cap = cv2.VideoCapture("test1.avi")
while 1:
ret, frame = cap.read()
cv2.imshow("cap", frame)
if cv2.waitKey(100) & 0xff == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
my code explain in above and its working perfectly in windows.but when in ubuntu 16.04 it gives an error. please explain the solution
Unable to stop the stream: Inappropriate ioctl for device
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/travis/miniconda/conda-bld/conda_1485299288502/work/opencv-3.2.0/modules/highgui/src/window.cpp, line 304
Traceback (most recent call last):
File "opncv_ex4.py", line 7, in <module>
cv2.imshow("cap", frame)
cv2.error: /home/travis/miniconda/conda-bld/conda_1485299288502/work/opencv-3.2.0/modules/highgui/src/window.cpp:304: error: (-215) size.width>0 && size.height>0 in function imshow
Ubuntu 16.04 and opencv 3.2 python 2.7