From 778d9c0c37bb970492a51b93b6a8977b8542acfa Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 24 Apr 2023 16:35:08 -0300 Subject: [PATCH] changing allow_only_tts to enable_extra_audio --- utils/.config.template.toml | 2 +- video_creation/final_video.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/utils/.config.template.toml b/utils/.config.template.toml index 71dcef7..d9d7582 100644 --- a/utils/.config.template.toml +++ b/utils/.config.template.toml @@ -36,7 +36,7 @@ resolution_h = { optional = false, default = 1920, example = 2560, explantation background_video = { optional = true, default = "minecraft", example = "rocket-league", options = ["minecraft", "gta", "rocket-league", "motor-gta", "csgo-surf", "cluster-truck", "minecraft-2","multiversus","fall-guys","steep", ""], explanation = "Sets the background for the video based on game name" } background_audio = { optional = true, default = "lofi", example = "minecraft", options = ["minecraft","lofi","undertale",""], explanation = "Sets the background audio for the video" } background_audio_volume = { optional = true, type = "float", nmin = 0, nmax = 1, default = 0.15, example = 0.05, explanation="Sets the volume of the background audio. If you don't want background audio, set it to 0.", oob_error = "The volume HAS to be between 0 and 1", input_error = "The volume HAS to be a float number between 0 and 1"} -allow_only_tts = { optional = true, type = "bool", default = false, example = false, explanation="Used if you want to render another video with only TTS audio in a separate folder", input_error = "The value HAS to be true or false"} +enable_extra_audio = { optional = true, type = "bool", default = false, example = false, explanation="Used if you want to render another video without background audio in a separate folder", input_error = "The value HAS to be true or false"} background_thumbnail = { optional = true, type = "bool", default = false, example = false, options = [true, false,], explanation = "Generate a thumbnail for the video (put a thumbnail.png file in the assets/backgrounds directory.)" } background_thumbnail_font_family = { optional = true, default = "arial", example = "arial", explanation = "Font family for the thumbnail text" } background_thumbnail_font_size = { optional = true, type = "int", default = 96, example = 96, explanation = "Font size in pixels for the thumbnail text" } diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 452b128..55e0d39 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -145,7 +145,7 @@ def make_final_video( reddit_id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"]) - allowOnlyTTSFolder: bool = settings.config["settings"]["background"]["allow_only_tts"] \ + allowOnlyTTSFolder: bool = settings.config["settings"]["background"]["enable_extra_audio"] \ and settings.config["settings"]["background"]["background_audio_volume"] != 0 print_step("Creating the final video 🎥") @@ -285,7 +285,7 @@ def make_final_video( subreddit = settings.config["reddit"]["thread"]["subreddit"] if not exists(f"./results/{subreddit}"): - print_substep("The results folder didn't exist so I made it") + print_substep("The 'results' folder didn't exist so I made it") os.makedirs(f"./results/{subreddit}") if not exists(f"./results/{subreddit}/OnlyTTS") and allowOnlyTTSFolder: @@ -352,9 +352,6 @@ def make_final_video( pbar.update(status - old_percentage) path = f"results/{subreddit}" - #path = path + ".mp4" - if(allowOnlyTTSFolder): - processingLength = 2*length with ProgressFfmpeg(length, on_update_example) as progress: ffmpeg.output(