我已经编写了一个代码来收集一个文件夹中的所有图像文件,以便我可以制作一个视频。
但在编译时我收到错误"Error creating movie, return code: 4 Try running with --verbose-debug"
#import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import glob, os
from PIL import Image
fig = plt.figure()
#size = 128, 128
ims=[]
#print(len(ims))
#im=Image.open(ims[5])
#im.show()
for infile in glob.glob("*.png"):
file, ext = os.path.splitext(infile)
im = Image.open(infile)
im1=plt.imshow(im)
ims.append([im1])
print(len(ims))
ani = animation.ArtistAnimation(fig, ims)
ani.save('MovWave.mpeg', writer="ffmpeg")
plt.show()