问题描述
我正在尝试从opencv-python
(python3,最新版本)的hevc(h265)
.avi视频中读取帧,但是不断抛出
I'm trying to read frames from a hevc(h265)
.avi video in opencv-python
(python3, latest version) but keeps throwing
我已经在ubuntu
和windows 10
中使用opencv-python, opencv-contrib-python and opencv-contrib-python-nonfree
进行了尝试,但是没有用.预先谢谢你.
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.
用于读取视频的代码:
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.
(在Windows中)当无法访问opencv_videoio_ffmpeg430_64.dll
时发生(它似乎被另一个opencv库静默调用).您可能没有使用-DWITH_FFMPEG=ON
构建opencv,或者您的dll不在路径中.
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.
这篇关于“找不到起始号码(以文件名)"尝试从opencv中的hevc(h265)视频读取帧时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!