This commit is contained in:
gabrielkheisa 2023-03-20 19:50:47 +07:00
parent cae6dbeea6
commit 4a4b7619c5
2 changed files with 11 additions and 18 deletions

View File

@ -12,7 +12,7 @@ bendera = 0
theteks = "" theteks = ""
picture = VideoFileClip("video.mp4") picture = VideoFileClip("video.mp4")
thesize = 25 thesize = 30
def checkindo(): def checkindo():
@ -43,16 +43,9 @@ def checkindo():
tp = theteks.split(",") tp = theteks.split(",")
t1 = textwrap.fill(tp[0].upper(), thesize) t1 = textwrap.fill(tp[0].upper(), thesize)
t2 = textwrap.fill(tp[1].upper(), thesize) t2 = textwrap.fill(tp[1].upper(), thesize)
t3 = textwrap.fill(tp[2].upper(), thesize)
t4 = textwrap.fill(tp[3].upper(), thesize)
t5 = textwrap.fill(tp[4].upper(), thesize)
t6 = textwrap.fill(tp[5].upper(), thesize)
t7 = textwrap.fill(tp[6].upper(), thesize)
t8 = textwrap.fill(tp[7].upper(), thesize)
t9 = textwrap.fill(tp[8].upper(), thesize)
t10 = "10 KETIKA 11" t10 = "10 KETIKA 11"
texts = [t1,t2,t3,t4,t5,t6,t7,t8,t9] texts = [t1,t2]
step = 3 #each 15 sec: 0, 15, 30 step = 3 #each 15 sec: 0, 15, 30
@ -60,16 +53,16 @@ def checkindo():
t = 0 t = 0
txt_clips = [] txt_clips = []
starts = [0,3,6,9,12,15,20,23,26] # or whatever starts = [0,8] # or whatever
durations = [3,3,3,3,3,5,3,3,3] durations = [8,0]
for text,t,duration in zip(texts, starts, durations): for text,t,duration in zip(texts, starts, durations):
txt_clip = TextClip(text, fontsize = 40, color='white', font="Roboto Mono", stroke_color="black") txt_clip = TextClip(text, fontsize = 20, color='white', font="Roboto Mono", stroke_color="black")
txt_clip = txt_clip.set_start(t) txt_clip = txt_clip.set_start(t)
txt_clip = txt_clip.set_pos('bottom').set_duration(duration) txt_clip = txt_clip.set_pos('bottom').set_duration(duration)
txt_clips.append(txt_clip) txt_clips.append(txt_clip)
final_video = CompositeVideoClip([picture,txt_clips[0],txt_clips[1],txt_clips[2],txt_clips[3],txt_clips[4],txt_clips[5],txt_clips[6],txt_clips[7],txt_clips[8]]) final_video = CompositeVideoClip([picture,txt_clips[0],txt_clips[1]])
final_video.write_videofile(str(user_empty)+".mp4") final_video.write_videofile(str(user_empty)+".mp4")
@ -89,12 +82,11 @@ def checkindo():
while True: while True:
mydb = mysql.connector.connect( mydb = mysql.connector.connect(
host="", host="127.0.0.1",
user="", user="dbusr",
password="", password="securepwd",
database="" database="appdb"
) )
checkindo() checkindo()
time.sleep(1) time.sleep(1)

1
ronaldo/teks.txt Normal file
View File

@ -0,0 +1 @@
S0VUSUtBIDEsS0VUSUtBIDIsS0VUSUtBIDMsS0VUSUtBIDQsS0VUSUtBIDUsS0VUSUtBIDYsS0VUSUtBIDcsS0VUSUtBIDgsS0VUSUtBIDks