replace downloaded youtube video content with a bold centered text

122 views Asked by At

I have zero experience with python, but it is clear enough (for most of the code).

There is this code:

from moviepy.editor import *

video = VideoFileClip("myHolidays.mp4").subclip(50,60)

# Make the text. Many more options are available.
txt_clip = ( TextClip("My Holidays 2013",fontsize=70,color='white')
         .set_position('center')
         .set_duration(10) )

result = CompositeVideoClip([video, txt_clip]) # Overlay text on video
result.write_videofile("myHolidays_edited.webm",fps=25) # Many options...

What I want to do: replace my whole video with a text centered and bold (maybe with some little effects) and some solid color background How do I do that?

A* if I delete the "subclip(50,60)" part, will that select the whole clip?

B* And if I delete ".set_duration(10)", will the rest of the code work?

C* how do I delete the whole (previous) video content?

D* please suggest a simple pro effect (for text)

1

There are 1 answers

0
Steve Barnes On

If you are trying to create a video of just the text the same length as the original video just find the length of the whole video, set the length of the text clip to the same and then txt_clip.write(...