I am trying to open video in openCV but it is not working i found solutions by adding full path i.e "D:/Folder1/Folder2/1.avi", converting video to .avi instead of mp4, copy the dll file from open cv to python folder after changing it is name by opencv version and windows 64 bit ffmpeg opencv_ffmpeg320_64.dll my opencv version 3.2.0 windows 64 python2.7 and Anaconda2
I am beginner in Python and unfortunately nothing of the above solved my problem.
below my code snippet:
import numpy as np
import cv2
cap = cv2.VideoCapture('1.avi')
if cap.isOpened():
print "opend"
else:
print "not opend"
while(cap.isOpened()):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()