isColor = 1
fps = 25
frameW = 256
frameH = 256
writer = cvCreateVideoWriter('video.avi', -1, fps, cvSize(frameW, frameH),
    isColor)
nFrames = 70
for i in range(nFrames):
    img = cvLoadImage('image_number_%d.png' % i)
cvWriteFrame(writer, img)
cvReleaseVideoWriter(writer)
How can I script the creation of a movie from a set of images?