Skip to content

Instantly share code, notes, and snippets.

Created March 30, 2020 14:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
frames = os.listdir('frames/')
frames.sort(key=lambda f: int(re.sub('\D', '', f)))
for i in range(len(frames)):
#reading each files
img = cv2.imread('frames/'+frames[i])
height, width, layers = img.shape
size = (width,height)
#inserting the frames into an image array
out = cv2.VideoWriter('28.mp4',cv2.VideoWriter_fourcc(*'DIVX'), 25, size)
for i in range(len(frame_array)):
# writing to a image array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment