Untitled

 avatar
unknown
plain_text
a month ago
1.8 kB
1
Indexable
from moviepy.editor import *

# File paths for the uploaded images
book_cover_path = "/mnt/data/227be42e-4b96-468f-91bf-9b30ed694d49.webp"
author_photo_path = "/mnt/data/IMG_20241229_113241_546.jpg"

# Text for the video
text_intro = "Cross the Rubicon: The Point of No Return"
text_mid = "A powerful book about life's struggles, bold decisions, and the courage to thrive."
text_author = "Written by Effiong Okpo-Abasi"
text_closing = "Coming Soon...\nAre you ready to cross your Rubicon?"

# Duration for each segment
duration = 5

# Create image clips for the book cover and author photo
book_cover_clip = ImageClip(book_cover_path).set_duration(duration).resize(height=720).set_position("center")
author_photo_clip = ImageClip(author_photo_path).set_duration(duration).resize(height=720).set_position("center")

# Create text clips
intro_text = TextClip(text_intro, fontsize=70, color='white', bg_color='black', size=(1280, 720)).set_duration(duration)
mid_text = TextClip(text_mid, fontsize=50, color='white', bg_color='black', size=(1280, 720)).set_duration(duration)
author_text = TextClip(text_author, fontsize=60, color='white', bg_color='black', size=(1280, 720)).set_duration(duration)
closing_text = TextClip(text_closing, fontsize=60, color='yellow', bg_color='black', size=(1280, 720)).set_duration(duration)

# Combine clips into a video sequence
final_video = concatenate_videoclips([
    intro_text,
    book_cover_clip,
    mid_text,
    author_photo_clip,
    author_text,
    closing_text
])

# Output path for the video
output_path = "/mnt/data/Cross_the_Rubicon_Promo_Video.mp4"

# Write the video to a file
final_video.write_videofile(output_path, codec="libx264", fps=24)

output_path
Leave a Comment