Created
April 6, 2022 21:29
-
-
Save sergiolucero/bb8ae7b62f872029a45702571a4531b1 to your computer and use it in GitHub Desktop.
make video from pictures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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