Revert of code

pull/1194/head
RapidStoned 3 years ago
parent 20ad769992
commit c6b969e868

@ -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" }

@ -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

@ -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,

Loading…
Cancel
Save