栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

OpenCV从URL加载视频

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

OpenCV从URL加载视频

似乎在或中

cv2.videopre
都不有效。
OpenCV API``OpenCV 2.x``OpenCV 3.x

下面是

OpenCV 3
使用
cv2.VideoCapture
类的示例代码。

import numpy as npimport cv2# Open a sample video available in sample-videosvcap = cv2.VideoCapture('https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_2mb.mp4')#if not vcap.isOpened():#    print "File Cannot be Opened"while(True):    # Capture frame-by-frame    ret, frame = vcap.read()    #print cap.isOpened(), ret    if frame is not None:        # Display the resulting frame        cv2.imshow('frame',frame)        # Press q to close the video windows before it ends if you want        if cv2.waitKey(22) & 0xFF == ord('q'): break    else:        print "frame is None"        break# When everything done, release the capturevcap.release()cv2.destroyAllWindows()print "Video stop"

您可以查看此视频入门教程以获取更多信息。

希望对您有所帮助。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/640509.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号