# video_helpers.py import cv2 import logging def write_frames(image, temp_file, fps, frames_per_image, size): logging.info(f'Processing image and writing to {temp_file}') fourcc = cv2.VideoWriter_fourcc(*'mp4v') out = cv2.VideoWriter(temp_file, fourcc, fps, size) for _ in range(frames_per_image): out.write(image) out.release()