Textwizai / video_generation.py
Erfan11's picture
Create video_generation.py
cbe3ce3 verified
raw
history blame
334 Bytes
from moviepy.editor import TextClip, CompositeVideoClip
def generate_simple_video(prompt):
txt_clip = TextClip(prompt, fontsize=70, color='white')
txt_clip = txt_clip.set_duration(5) # 5-second video with text
video = CompositeVideoClip([txt_clip])
video.write_videofile("output.mp4", fps=24)
return "output.mp4"