Hi ππ
In this post, I will share with you Create video from Text Clips using Python and moviepy.
To generate or create video from Text Clips you need to install
imagemagick from here : https://imagemagick.org/script/download.php
and install moviepy from here : pip install moviepy
If this error happend with you :
Moviepy can't detect ImageMagick binary
you can use this code to solve this problem
from moviepy.config import change_settings
IMAGEMAGICK_PATH = r"C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe"
change_settings({"IMAGEMAGICK_BINARY": IMAGEMAGICK_PATH})
Now i will create the video
from moviepy.config import change_settings
IMAGEMAGICK_PATH = r"C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe"
change_settings({"IMAGEMAGICK_BINARY": IMAGEMAGICK_PATH})
import moviepy.editor as mp
clips = [mp.TextClip(f'Text {n}',
size = (450, 320),
align='center',
fontsize = 20,
color='white').set_duration(2) for n in range(5)]
video = mp.concatenate_videoclips(clips)
video.write_videofile('test.mp4', fps = 20)
result
Now we're done π€
Don't forget to like and follow π
Support me on PayPal π€
https://www.paypal.com/paypalme/amr396