Python JPEG to movie

You could use the Python interface of OpenCV, in particular a VideoWriter could probably do the job. From what I understand of the doc, the following would do what you want:

w = cvCreateVideoWriter(filename, -1, <your framerate>, 
                        <your frame size>, is_color=1)

and, in a loop, for each file:

cvWriteFrame(w, frame)

Note that I have not tried this code, but I think that I got the idea right. Please tell me if it works.


here's a cut-down version of a script I have that took frames from one video and them modified them(that code taken out), and written to another video. maybe it'll help.

import cv2

fourcc = cv2.cv.CV_FOURCC(*'XVID')
out = cv2.VideoWriter('out_video.avi', fourcc, 24, (704, 240))

c = cv2.VideoCapture('in_video.avi')

while(1):
  _, f = c.read()
  if f is None:
    break

  f2 = f.copy() #make copy of the frame
  #do a bunch of stuff (missing)

  out.write(f2)  #write frame to the output video

out.release()
cv2.destroyAllWindows()
c.release()

If you have a bunch of images, load them in a loop and just write one image after another to your vid.