如何在moviepy中创建包含多个文本的textClip?

时间:2019-01-21 03:19:49

标签: python python-3.x moviepy

如何创建包含多个文本的TextClip 例如,文字同时显示在顶部附近,同时又显示在底部?

1 个答案:

答案 0 :(得分:0)

只需使用多个TextClip,然后通过类似的操作将它们合并为CompositeVideoClip

import moviepy.editor as mp

text_1 = mp.TextClip("text1", color='white', align='West', fontsize=40, font='Arial', method='label').set_position(("center", "top"))
text_2 = mp.TextClip("text2", color='white', align='West', fontsize=40, font='Arial', method='label').set_position(("center", "bottom"))
full_text = mp.CompositeVideoClip([text_1, text_2])