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'.
I've tried both in ubuntu
and 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:
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