Skip to content

Instantly share code, notes, and snippets.

@munzz11
Created August 4, 2022 19:52
Show Gist options
  • Select an option

  • Save munzz11/57a8d8752e0131222bf3cb5b04fa2123 to your computer and use it in GitHub Desktop.

Select an option

Save munzz11/57a8d8752e0131222bf3cb5b04fa2123 to your computer and use it in GitHub Desktop.
Turn daily screenshot log into video
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