import cv2
vc = cv2.VideoCapture(0)
fps = 20000
size = (int(vc.get(cv2.CAP_PROP_FRAME_WIDTH)),
int(vc.get(cv2.CAP_PROP_FRAME_HEIGHT)))
vw = cv2.VideoWriter('test2-7out.avi',
cv2.VideoWriter_fourcc('X', 'V', 'I', 'D'),
fps, size)
success, frame = vc.read()
while success:
vw.write(frame)
cv2.imshow('MyCamera', frame)
key = cv2.waitKey()
if key == 27:
break
success, frame = vc.read()
vc.release()
开启摄像头(python)
原创lizhao1688 博主文章分类:代码老猫 ©著作权
©著作权归作者所有:来自51CTO博客作者lizhao1688的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:open cv图像修补
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
网络监控摄像头通过OBS取流变身电脑摄像头
OBS 网络摄像头接入腾讯会议
Windows 视频流 用户名