import cv2
import os
fps = 5
fourcc = cv2.VideoWriter_fourcc('M', 'J', 'P', 'G')
video_writer = cv2.VideoWriter(filename='1.avi', fourcc=fourcc, fps=fps, frameSize=(1920, 1080))
filelist = os.listdir('.test\\')
for item in filelist:
if item.endswith('.jpg'):
item = '.test\\' + item
img = cv2.imread(item)
cv2.waitKey(100)
video_writer.write(img)
print(str(item) + ' done!')
video_writer.release()
图片转视频python
最新推荐文章于 2023-10-12 18:09:10 发布