-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (23 loc) · 869 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from moviepy.editor import *
import moviepy.video.fx.all as vfx
from time import sleep
BASE_STRING = "Name\n Day "
VIDEO_FILE = "./input/video.mp4"
RESIZE = 1
START = 1
END = 3
def main(start, end):
for i in range(start,end+1):
video = ( VideoFileClip(VIDEO_FILE)
.resize(RESIZE)
.set_position(("center", "center"))
)
title = ( TextClip(BASE_STRING + str(i),fontsize=90,color='white')
.set_position(('center',0.1), relative=True)
.set_duration(video.duration)
.fx(vfx.fadein, 1)
)
result = CompositeVideoClip([video, title], size = (1080,1920), bg_color = (0, 0, 0))
result.write_videofile(f"./output/result{str(i)}.mp4", bitrate='8000k', threads=8)
if __name__ == "__main__":
main(START, END)