0

There is a function that adds text to a video clip. But when you specify the font style parameter, it does not change. What could be the problem?

Cod:

vid = VideoFileClip(name_video)
text1 = TextClip(text_for_video,  fontsize=size, font='Courier', color=color)
txt_clip = text1.set_pos(("right", "top"), relative=True).set_duration(text_end_time-text_start_time)

text2 = TextClip(text_for_video, fontsize=size, font='TimesNewRoman', color=color)
txt_clip_2 = text2.set_pos(("right", "top"), relative=True).set_duration(5)
video = CompositeVideoClip([vid, txt_clip.set_start(text_start_time), txt_clip_2.set_start(10)])
video.write_videofile('video_res.mp4', codec='libx264')

1 Answers1

3

May be the font name would be different just check the font available using the code

from moviepy.editor import TextClip
        print ( TextClip.list("font") )
Elango Sk
  • 51
  • 4
  • Please don't add "thank you" as an answer. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation), you will be able to [vote up questions and answers](https://stackoverflow.com/help/privileges/vote-up) that you found helpful. - [From Review](/review/late-answers/30504714) – user11717481 Dec 05 '21 at 05:46