Created
May 11, 2018 04:11
-
-
Save zxf8665905/01d3ac4b4fc2d6ec63c6ce31ade0f595 to your computer and use it in GitHub Desktop.
image to 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
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