From 838333160dd854f3b2e428e32b2999bac016d9b1 Mon Sep 17 00:00:00 2001 From: Josh Holly Date: Mon, 8 May 2023 07:12:27 -0500 Subject: [PATCH 1/2] Update final_video.py Fixed opacity so comments will have transparency if the user sets the "opacity" option below 1. --- video_creation/final_video.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 4838574..909c149 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -120,6 +120,7 @@ def make_final_video( # settings values W: Final[int] = int(settings.config["settings"]["resolution_w"]) H: Final[int] = int(settings.config["settings"]["resolution_h"]) + opacity = int(settings.config["settings"]["opacity"]) reddit_id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"]) print_step("Creating the final video 🎥") @@ -242,8 +243,9 @@ def make_final_video( "v" ].filter("scale", screenshot_width, -1) ) + image_overlay = image_clips[i].filter("colorchannelmixer", aa=opacity) background_clip = background_clip.overlay( - image_clips[i], + image_overlay, enable=f"between(t,{current_time},{current_time + audio_clips_durations[i]})", x="(main_w-overlay_w)/2", y="(main_h-overlay_h)/2", @@ -346,8 +348,8 @@ def make_final_video( old_percentage = pbar.n pbar.update(100 - old_percentage) pbar.close() - - save_data(subreddit, filename + ".mp4", title, idx, background_config[2]) + path = r"~/Library/Mobile Documents/com~apple~CloudDocs/reddit/" + save_data(path+subreddit, filename + ".mp4", title, idx, background_config[2]) print_step("Removing temporary files 🗑") cleanups = cleanup(reddit_id) print_substep(f"Removed {cleanups} temporary files 🗑") From 15a17896cadb0cef707060346d6cfc4d1a5918e8 Mon Sep 17 00:00:00 2001 From: Josh Holly Date: Sun, 21 May 2023 07:41:21 -0500 Subject: [PATCH 2/2] Remoted int() wrapper Removed int() around opacity = settings.config["settings"]["opacity"] to fraction numbers (IE 0.5, 0.7, etc) --- video_creation/final_video.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 11804c6..7418931 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -142,7 +142,8 @@ def make_final_video( # settings values W: Final[int] = int(settings.config["settings"]["resolution_w"]) H: Final[int] = int(settings.config["settings"]["resolution_h"]) - opacity = int(settings.config["settings"]["opacity"]) + """Fixed to allow fraction opacity Ea: 0.7""" + opacity = settings.config["settings"]["opacity"] reddit_id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"]) @@ -405,4 +406,4 @@ def make_final_video( print_step("Removing temporary files 🗑") cleanups = cleanup(reddit_id) print_substep(f"Removed {cleanups} temporary files 🗑") - print_step("Done! 🎉 The video is in the results folder 📁") \ No newline at end of file + print_step("Done! 🎉 The video is in the results folder 📁")