from moviepy.editor import *
from PIL import Image
import numpy as np
# Re-import the image after the environment reset
image_path = "/mnt/data/A_photograph_captures_a_young_couple_of_Southeast_.png"
image = Image.open(image_path)
image_array = np.array(image)
# Create a video clip from the image
clip_duration = 10 # seconds
image_clip = ImageClip(image_array).set_duration(clip_duration).set_fps(24)
# Add a romantic fade-in and fade-out effect
video_clip = image_clip.fadein(2).fadeout(2)
# Export the final video
video_output_path = "/mnt/data/romantic_dinner_video.mp4"
video_clip.write_videofile(video_output_path, codec='libx264')