Answers for "python script to create video from images"

0

python create video from images

import cv2
import numpy as np
import glob

img_array = []
for filename in glob.glob('C:/New folder/Images/*.jpg'):
    img = cv2.imread(filename)
    height, width, layers = img.shape
    size = (width,height)
    img_array.append(img)


out = cv2.VideoWriter('project.avi',cv2.VideoWriter_fourcc(*'DIVX'), 15, size)
 
for i in range(len(img_array)):
    out.write(img_array[i])
out.release()
Posted by: Guest on May-26-2021

Code answers related to "python script to create video from images"

Python Answers by Framework

Browse Popular Code Answers by Language