首页 > 编程 > Python > 正文

python opencv读mp4视频的实例

2020-01-04 13:54:35
字体:
来源:转载
供稿:网友

如下所示:

#获得视频的格式videoCapture = cv2.VideoCapture('/home/lw/3661.mp4') #获得码率及尺寸fps = videoCapture.get(cv2.CAP_PROP_FPS)size = (int(videoCapture.get(cv2.CAP_PROP_FRAME_WIDTH)),  int(videoCapture.get(cv2.CAP_PROP_FRAME_HEIGHT)))fNUMS = videoCapture.get(cv2.CAP_PROP_FRAME_COUNT)  #读帧success, frame = videoCapture.read()while success : cv2.imshow('windows', frame) #显示 cv2.waitKey(1000/int(fps)) #延迟 success, frame = videoCapture.read() #获取下一帧 videoCapture.release()

以上这篇python opencv读mp4视频的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持VEVB武林网。


注:相关教程知识阅读请移步到python教程频道。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表