问题描述
在上一个环境变量问题解决后,运行代码又报错:
[ERROR:0] global /io/opencv/modules/videoio/src/cap.cpp (116) open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.1.1) /io/opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): /home/zpj/PycharmProjects/KeyFrame/out.avi in function 'icvExtractPattern'
本以为是很难解决的问题,没想到只是因为读取的视频没有编号...
然后报错的提醒也是找不到视频的起始编号
解决方法
将
capture = cv2.VideoCapture("out.avi")
改为
capture = cv2.VideoCapture("out001.avi")
即可