Skip to content

Instantly share code, notes, and snippets.

@zxf8665905
Created May 11, 2018 04:11
Show Gist options
  • Save zxf8665905/01d3ac4b4fc2d6ec63c6ce31ade0f595 to your computer and use it in GitHub Desktop.
Save zxf8665905/01d3ac4b4fc2d6ec63c6ce31ade0f595 to your computer and use it in GitHub Desktop.
image to video
video_name = 'out.mp4'
frame = cv2.imread(images[0])
height, width, layers = frame.shape
fourcc = cv2.VideoWriter_fourcc(*'H264’) # may try x264
video = cv2.VideoWriter(video_name, fourcc, 6, (width,height))
for image in images:
video.write(cv2.imread(image))
video.release()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment