Python JPEG to movie

前端 未结 4 1142
再見小時候
再見小時候 2020-12-29 10:20

I am looking for a way to concatenate a directory of images files (e.g., JPEGs) to a movie file (MOV, MP4, AVI) with Python. Ideally, this would also allow me to take multip

4条回答
  •  Happy的楠姐
    2020-12-29 10:32

    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, , 
                            , 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.

提交回复
热议问题