I'm trying to read frames from a
hevc(h265) .avi video in
opencv-python (python3, latest version) but keeps throwing
OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): C:\Users\gabri\Desktop\2019-11-22_13\a.avi in function 'cv::icvExtractPattern'.</blockquote>
I've tried both in
windows 10 using
opencv-python, opencv-contrib-python and opencv-contrib-python-nonfree, but it didn't work.
Thank you in advance.
Code used to read the video:<pre class="lang-py prettyprint-override">
import cv2 import imutils cap = cv2.VideoCapture("C:\\Users\\gabri\\Desktop\\2019-11-22_13\\a.avi") while True: ret,frame = cap.read() if not ret: break frame = imutils.resize(frame,width = 960) cv2.imshow('image',frame) k = cv2.waitKey(1) & 0xff if k == 27: break
I had the same problem, compilation and linking ok, but the same cryptic error occurs at running.
It happened (with Windows) when
opencv_videoio_ffmpeg430_64.dll was not accessible (it seems to be silently called by another opencv lib). Either you did not build opencv with the
-DWITH_FFMPEG=ON, or alternatively your dll is not in the path.