Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
631 B
2
Indexable
Never
video_clip.write_videofile("soulful_inspiration.mp4")
from moviepy.editor import *
import requests

# Download the image
img_url = "https://www.pexels.com/photo/silhouette-of-tree-near-body-of-water-during-golden-hour-36717/"
img_data = requests.get(img_url).content
with open("image.jpg", "wb") as f:
    f.write(img_data)

# Create a video clip from the image and music
image_clip = ImageClip("image.jpg").set_duration(30)
music_clip = AudioFileClip("soothing_meditation.mp3")
video_clip = image_clip.set_audio(music_clip)

# Export the video clip to a file
video_clip.write_videofile("soulful_inspiration.mp4")