From 4a4b7619c5854fe8833dd1a1dab8408b461fd515 Mon Sep 17 00:00:00 2001 From: gabrielkheisa Date: Mon, 20 Mar 2023 19:50:47 +0700 Subject: [PATCH] update --- ronaldo/renderDB.py | 28 ++++++++++------------------ ronaldo/teks.txt | 1 + 2 files changed, 11 insertions(+), 18 deletions(-) create mode 100644 ronaldo/teks.txt diff --git a/ronaldo/renderDB.py b/ronaldo/renderDB.py index a5b739f..7da7428 100644 --- a/ronaldo/renderDB.py +++ b/ronaldo/renderDB.py @@ -12,7 +12,7 @@ bendera = 0 theteks = "" picture = VideoFileClip("video.mp4") -thesize = 25 +thesize = 30 def checkindo(): @@ -43,16 +43,9 @@ def checkindo(): tp = theteks.split(",") t1 = textwrap.fill(tp[0].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" - texts = [t1,t2,t3,t4,t5,t6,t7,t8,t9] + texts = [t1,t2] step = 3 #each 15 sec: 0, 15, 30 @@ -60,16 +53,16 @@ def checkindo(): t = 0 txt_clips = [] - starts = [0,3,6,9,12,15,20,23,26] # or whatever - durations = [3,3,3,3,3,5,3,3,3] + starts = [0,8] # or whatever + durations = [8,0] 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_pos('bottom').set_duration(duration) 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") @@ -89,12 +82,11 @@ def checkindo(): while True: mydb = mysql.connector.connect( - host="", - user="", - password="", - database="" + host="127.0.0.1", + user="dbusr", + password="securepwd", + database="appdb" ) - checkindo() time.sleep(1) diff --git a/ronaldo/teks.txt b/ronaldo/teks.txt new file mode 100644 index 0000000..c914be5 --- /dev/null +++ b/ronaldo/teks.txt @@ -0,0 +1 @@ +S0VUSUtBIDEsS0VUSUtBIDIsS0VUSUtBIDMsS0VUSUtBIDQsS0VUSUtBIDUsS0VUSUtBIDYsS0VUSUtBIDcsS0VUSUtBIDgsS0VUSUtBIDks \ No newline at end of file