【发布时间】:2016-04-18 18:26:00
【问题描述】:
我使用了这个代码。
import cv2
vc = cv2.VideoCapture('test2.mp4')
c=1
if vc.isOpened():
rval , frame = vc.read()
else:
rval=False
print("hello")
while rval:
rval, frame = vc.read()
cv2.imwrite(str(c) + '.jpg',frame)
c = c + 1
cv2.waitKey(1)
vc.release()
它在屏幕上打印出你好,这意味着 vc.isOpened() 没有调用。 我不明白似乎是什么问题,没有错误。
【问题讨论】:
-
您可能缺少所需的驱动程序
-
什么样的驱动程序?
标签: python opencv video frames