Update renderDB.py

This commit is contained in:
Gabriel Kheisa 2023-05-26 10:44:16 +07:00 committed by GitHub
parent b5e9f79f52
commit 8b7ff7463e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,8 @@ import time
import textwrap import textwrap
import mysql.connector import mysql.connector
import shutil
import os
bendera = 0 bendera = 0
@ -12,7 +14,7 @@ bendera = 0
theteks = "" theteks = ""
picture = VideoFileClip("video.mp4") picture = VideoFileClip("video.mp4")
thesize = 30 thesize = 25
def checkindo(): def checkindo():
@ -57,15 +59,37 @@ def checkindo():
durations = [8,0] 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 = 15, color='white', font="DejaVu-Serif-Bold", stroke_color="black") txt_clip = TextClip(text, fontsize = 15, color='white', font="Bebas-Neue-Bold", 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]]) 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")
# Get the current directory
current_directory = os.getcwd()
# Specify the file you want to move
file_to_move = str(str(user_empty)+".mp4")
# Specify the destination directory
destination_directory = os.path.join(current_directory, "output")
# Create the "output" directory if it doesn't exist
if not os.path.exists(destination_directory):
os.makedirs(destination_directory)
# Build the source and destination file paths
source_path = os.path.join(current_directory, file_to_move)
destination_path = os.path.join(destination_directory, file_to_move)
# Move the file
shutil.move(source_path, destination_path)
print("File moved successfully!")
#with open('teks.txt', "w") as myfile: #with open('teks.txt', "w") as myfile:
#myfile.write("S0VUSUtBIDEsS0VUSUtBIDIsS0VUSUtBIDMsS0VUSUtBIDQsS0VUSUtBIDUsS0VUSUtBIDYsS0VUSUtBIDcsS0VUSUtBIDgsS0VUSUtBIDks") #myfile.write("S0VUSUtBIDEsS0VUSUtBIDIsS0VUSUtBIDMsS0VUSUtBIDQsS0VUSUtBIDUsS0VUSUtBIDYsS0VUSUtBIDcsS0VUSUtBIDgsS0VUSUtBIDks")