Ai
1 Star 4 Fork 3

codepp/python-rtsp-multisave

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vw_fourcc_test.py 795 Bytes
一键复制 编辑 原始数据 按行查看 历史
codepp 提交于 2020-12-25 13:12 +08:00 . update vw_fourcc_test.py.
# -*- coding:utf-8 -*-
import cv2
cap = cv2.VideoCapture(0)
# XVID,DVIX
fourcc = cv2.VideoWriter_fourcc(*'X264')
# avi,mp4
out = cv2.VideoWriter('vw_fourcc.mp4',fourcc, 20.0, (1920,1080),True)
def mergeVideo():
fps = 1
width = 518
height = 352
fourcc = cv2.VideoWriter_fourcc(*"mp4v")
video = cv2.VideoWriter('out.mp4', fourcc, fps, (width, height))
for i in range(20, 46):
png_name = './out' + str(i) + '.png'
image = cv2.imread(png_name)
video.write(image)
cv2.waitKey()
while(cap.isOpened()):
res, frame = cap.read()
if res:
cv2.imshow('man',frame)
out.write(frame)
if cv2.waitKey(10) & 0xFF == ord('q'):
break
else:
break
cap.release()
out.release()
cv2.destroyAllWindows()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/codepp/python-rtsp-multisave.git
git@gitee.com:codepp/python-rtsp-multisave.git
codepp
python-rtsp-multisave
python-rtsp-multisave
master

搜索帮助