Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
make video from pictures
import cv2, glob
import numpy as np
fourcc = cv2.VideoWriter_fourcc(*'mp4v') # choose codec according to needed format
video = cv2.VideoWriter('video.avi', fourcc, 1, (width, height))
for fn in glob.glob('*.png'):
img = cv2.imread(fn)
video.write(img)
cv2.destroyAllWindows()
video.release()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment