I'd like to create a video from still images, but instead of using a static FPS, I have a specific timestamp for each image (the images are not exactly evenly spaced in time).
How could I go about doing this?
My current code, with a static FPS, is as follows
import cv2
import os
image_folder = '/Users/alex/Dropbox/Apps/CCTV-AE/rasp2/saved/movies/'
video_name = '/Users/alex/Dropbox/Apps/CCTV-AE/rasp2/saved/movies/video.avi'
images = sorted([img for img in os.listdir(image_folder) if img.endswith(".jpg")])
frame = cv2.imread(os.path.join(image_folder, images[0]))
height, width, layers = frame.shapevideo = cv2.VideoWriter(video_name, 0, 9, (width,height))
for image in images:
print(os.path.join(image_folder, image))
video.write(cv2.imread(os.path.join(image_folder, image)))
cv2.destroyAllWindows()
video.release()