我正在尝试从 Google 云存储 url 打开视频并在云函数中处理它 - 该文件是公开的。但是 v.read()
返回 None
。
示例视频网址:https://storage.googleapis.com/dev-brdu1976/268.mov
v = cv2.VideoCapture(request.json['Source_Storage_Path'])
print(v)
frameNum = -1
while (True):
ret_value,frame = v.read()
if ret_value == False or frame is None:
print('Frame is None')
break
frameNum += 1
#do stuff
最佳答案
我想出了如何让它发挥作用,但我没有深入研究细节。通过 https 请求视频无法打开 - 当我将 url 协议(protocol)更改为 http 时它确实有效。
关于python-3.x - OpenCV 无法将 VideoCapture 与 url 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53482924/