From c6b969e86872e252cd3bc31280092c95aa8e045f Mon Sep 17 00:00:00 2001 From: RapidStoned Date: Mon, 22 Aug 2022 18:43:38 +0200 Subject: [PATCH] Revert of code --- utils/.config.template.toml | 3 +-- utils/video.py | 17 ----------------- video_creation/final_video.py | 5 ----- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/utils/.config.template.toml b/utils/.config.template.toml index 31c1027..adbaed0 100644 --- a/utils/.config.template.toml +++ b/utils/.config.template.toml @@ -22,8 +22,7 @@ times_to_run = { optional = false, default = 1, example = 2, explanation = "Used opacity = { optional = false, default = 0.9, example = 0.8, explanation = "Sets the opacity of the comments when overlayed over the background", type = "float", nmin = 0, nmax = 1, oob_error = "The opacity HAS to be between 0 and 1", input_error = "The opacity HAS to be a decimal number between 0 and 1" } transition = { optional = true, default = 0.2, example = 0.2, explanation = "Sets the transition time (in seconds) between the comments. Set to 0 if you want to disable it.", type = "float", nmin = 0, nmax = 2, oob_error = "The transition HAS to be between 0 and 2", input_error = "The opacity HAS to be a decimal number between 0 and 2" } storymode = { optional = true, type = "bool", default = false, example = false, options = [true, false,], explanation = "Only read out title and post content, not yet implemented" } -sub_overlay = { optional = true, type = "bool", default = false, example = false, options = [true, false], explanation = "This will add a subscribe animation overlay to the end of the video" } -sub_overlay_name = { optional = true, default = "youtube", options = ["youtube", "tiktok", "instagram"], explanation = "Choose which overlay you would like"} + [settings.background] background_choice = { optional = true, default = "minecraft", example = "rocket-league", options = ["minecraft", "gta", "rocket-league", "motor-gta", "csgo-surf", "cluster-truck", ""], explanation = "Sets the background for the video based on game name" } diff --git a/utils/video.py b/utils/video.py index 6b9866c..5566cd1 100644 --- a/utils/video.py +++ b/utils/video.py @@ -1,15 +1,12 @@ from __future__ import annotations from ast import Str import re -import math from typing import Tuple -from utils import settings from PIL import ImageFont, Image, ImageDraw, ImageEnhance from moviepy.video.VideoClip import VideoClip, ImageClip from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip -from moviepy.video.io.VideoFileClip import VideoFileClip class Video: @@ -59,17 +56,3 @@ class Video: # Overlay the img clip on the first video clip self.video = CompositeVideoClip([self.video, img_clip]) return self.video - - def add_overlay(self): - # Get duration for the entire video to place the overlay at the correct time - video_duration = self.video.duration - - overlayName = settings.config["settings"]["sub_overlay_name"] - - subOverlayClip = VideoFileClip((f"assets/subOverlay/{overlayName}.mov"), has_mask=True) - subOverlayClip.set_pos('center') - - placeTime = math.floor(video_duration - subOverlayClip.duration) - 3 - - self.video = CompositeVideoClip([self.video, subOverlayClip.set_start(placeTime)]) - return self.video \ No newline at end of file diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 150fd5e..743e561 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -143,11 +143,6 @@ def make_final_video( final = Video(final).add_watermark( text=f"Background credit: {background_config[2]}", opacity=0.4, redditid=reddit_obj ) - - # Add an overlay - if settings.config["settings"]["sub_overlay"]: - final = Video(final).add_overlay() - final.write_videofile( f"assets/temp/{id}/temp.mp4", fps=30,