To be written to a file, all the frames must have the same size. Here you frames with Dog are smaller that the frames with CatCat, which spoils the video. A first solution is to use the method "compose" in concatenate_videoclips, this will give the same size to all clips:
import moviepy.editor as mp
messages = ["Dog", "Cat", "Duck", "Wolf"]
clips = [ mp.TextClip(txt, fontsize=170, color='green').set_duration(1)
for txt in messages ]
concat_clip = mp.concatenate_videoclips(clips, method="compose")
concat_clip.write_videofile("texts.mp4")
A second solution is to give the same size (width, height) to all of your text clips:
import moviepy.editor as mp
messages = ["Dog", "Cat", "Duck", "Wolf"]
clips = [ mp.TextClip(txt, fontsize=170, color='green', size=(500,300))
.set_duration(1)
for txt in messages]
concat_clip = mp.concatenate_videoclips(clips)
concat_clip.write_videofile("texts.mp4")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…