Created
June 14, 2024 18:32
-
-
Save talhaahussain/88fdaeda48dc5e4f13ee74db54293324 to your computer and use it in GitHub Desktop.
image_seq_to_video.py -- A Python function to convert a sequence of images to video. Depends on OpenCV. See the original and an application here: https://github.com/talhaahussain/grappling-pose-identification/
This file contains 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 | |
def concat_frames_into_video(filename, frames, fps): | |
height, width, channels = frames[0].shape | |
fourcc = cv2.VideoWriter_fourcc(*'mp4v') | |
out = cv2.VideoWriter(filename, fourcc, fps, (width, height)) | |
for frame in frames: | |
out.write(frame) | |
out.release() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment