gnosticdev commited on
Commit
242754c
·
verified ·
1 Parent(s): a8bc284

Create video_module.py

Browse files
Files changed (1) hide show
  1. video_module.py +10 -0
video_module.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from moviepy.editor import TextClip, concatenate_videoclips
2
+
3
+ def generate_video(text):
4
+ clips = []
5
+ for sentence in text.split("."): # Dividir el texto en oraciones
6
+ clip = TextClip(sentence.strip(), fontsize=24, color="white", bg_color="black").set_duration(2)
7
+ clips.append(clip)
8
+
9
+ final_clip = concatenate_videoclips(clips)
10
+ return final_clip