Spaces:
Running
Running
| from moviepy.editor import TextClip | |
| from .config import FONT_PATH | |
| def word_clip(word): | |
| duration = word["end"] - word["start"] | |
| clip = TextClip( | |
| word["text"], | |
| font=FONT_PATH, | |
| fontsize=80, | |
| color="white", | |
| stroke_color="black", | |
| stroke_width=4, | |
| method="caption", | |
| size=(900, None), | |
| ) | |
| return ( | |
| clip.set_start(word["start"]) | |
| .set_duration(duration) | |
| .set_position(("center", "center")) | |
| ) |