Created
August 4, 2022 19:52
-
-
Save munzz11/57a8d8752e0131222bf3cb5b04fa2123 to your computer and use it in GitHub Desktop.
Turn daily screenshot log into video
This file contains hidden or 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 | |
| import numpy as np | |
| import glob | |
| import os | |
| path = '2022-07-30/' # path to file containing days images | |
| output_file = 'output_video.mp4' # output file name | |
| width = 3846 # width of the input images | |
| height = 2160 # height ofthe input images | |
| list_dir = os.listdir(path) | |
| list_dir = [f.lower() for f in list_dir] | |
| list_dir = sorted(list_dir) | |
| #print (list_dir) | |
| frameSize = (width, height) | |
| out = cv2.VideoWriter(output_file,cv2.VideoWriter_fourcc(*'MP4V'), 1, frameSize) | |
| for filename in list_dir: | |
| img = cv2.imread(path + filename) | |
| print('[INFO] Reading: ' + path + filename) | |
| out.write(img) | |
| out.release() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment