首先安装python的opencv。
在opencv中可以将图片读取,并构造视频流。视频流可以设置帧率等参数。
代码如下:
'''
import cv2
import os
img=[]
for i in range(0,50000):
filename = "images/pv_insitu_300x300x300_" + str(i).zfill(5) + "-95-88.png"
if ( os.path.isfile(filename)):
print(filename)
img.append(cv2.imread(filename))
height,width,layers=img[1].shape
video=cv2.VideoWriter('video.mp4',-1,40,(width,height))
for j in range(len(img)):
video.write(img[j])
cv2.destroyAllWindows()
video.release()
'''