python opencv读mp4视频的实例
作者:白话先生 时间:2022-04-13 00:32:11
如下所示:
#获得视频的格式
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()
来源:https://blog.csdn.net/liuweizj12/article/details/80235065
标签:python,opencv,mp4
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python简单读取大文件的方法
2021-04-24 04:10:47
django 读取图片到页面实例
2023-02-22 13:30:50
Python3进制之间的转换代码实例
2022-06-13 05:22:35
Python反爬虫技术之防止IP地址被封杀的讲解
2022-05-09 10:44:12
![](https://img.aspxhome.com/file/2023/3/108123_0s.png)
一文详解Python中多进程和进程池的使用方法
2023-12-01 04:10:12
Python的五个标准数据类型你认识几个
2022-08-04 15:23:43
![](https://img.aspxhome.com/file/2023/1/65101_0s.png)
Python3 虚拟开发环境搭建过程(图文详解)
2021-11-19 00:34:51
![](https://img.aspxhome.com/file/2023/2/111872_0s.png)
Python各种扩展名区别点整理
2023-10-14 21:23:01
ASP字符串16进制互转
2008-06-24 12:28:00
python flask开发的简单基金查询工具
2023-10-29 21:35:42
![](https://img.aspxhome.com/file/2023/0/66800_0s.png)
Python标准库之zipfile和tarfile模块的使用
2022-06-08 04:00:11
![](https://img.aspxhome.com/file/2023/4/96464_0s.png)
ie的javascript失效问题
2009-09-21 12:49:00
获取 Textarea 的光标位置
2010-11-30 21:33:00
golang中defer的关键特性示例详解
2023-08-06 06:12:45
ASP技巧:ASP中三个常用语句的使用技巧
2008-10-16 10:56:00
深入了解Python中Lambda函数的用法
2023-02-03 10:09:01
用私有属性来拯救IE7缩放图片的失真
2009-03-03 13:57:00
![](https://img.aspxhome.com/file/UploadPic/20093/3/feed-22s.gif)
python 调用pyautogui 实时获取鼠标的位置、移动鼠标的方法
2021-01-03 05:25:29
![](https://img.aspxhome.com/file/2023/9/101069_0s.jpg)
Python打印“菱形”星号代码方法
2023-02-05 17:34:42
![](https://img.aspxhome.com/file/2023/5/73005_0s.png)
python数据处理——对pandas进行数据变频或插值实例
2021-01-05 19:22:01