0

i have been stcuk on this for multible hours now as my computer is not running moviepy i need to know if there is any other way to combine videos and add text in a python script please.

this is my code:

for i in names:
x = 0
Ftd = dird[x]#directory of file 
x = x + 1

clip = VideoFileClip("'"+Ftd+"'")
txt_clip = TextClip(str(i), fontsize = 20, color = 'White')
txt_clip = txt_clip.set_pos('top').set_duration(5)
video =  CompositeVideoClip([clip,txt_clip])
clips.append(video)

final = concatenate_videoclips(clips,method='compose')
final.write_videofile("done.mp4")

please i need help is there any other modules i can use or even cmd code that i can run with my python script.

1 Answers1

1

One way to approach this is to use a Python wrapper for ffmpeg - this will allow you leverage all the video processing functionality of ffmpeg from within Python.

There are several Python ffmpeg wrappers including:

FFMPEG is very feature rich and there are often multiple ways to achieve a particular goal, so it is worth doing some reading or web searching but as a starter for adding text:

And for concatenating video:

For concatenation it is worth looking at the options carefully as the best approach will depend on how similar the two videos are - if they use the same codecs you will likely be able to use a much less processor intensive concatenation approach.

Mick
  • 24,231
  • 1
  • 54
  • 120