Erfan11 commited on
Commit
cbe3ce3
1 Parent(s): 0602100

Create video_generation.py

Browse files
Files changed (1) hide show
  1. video_generation.py +8 -0
video_generation.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from moviepy.editor import TextClip, CompositeVideoClip
2
+
3
+ def generate_simple_video(prompt):
4
+ txt_clip = TextClip(prompt, fontsize=70, color='white')
5
+ txt_clip = txt_clip.set_duration(5) # 5-second video with text
6
+ video = CompositeVideoClip([txt_clip])
7
+ video.write_videofile("output.mp4", fps=24)
8
+ return "output.mp4"