From 420bac9a5a16d7d5ea22e4f24dfd5a8dabf1eeef Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 14 Jul 2022 22:44:13 -0400 Subject: [PATCH] fix: typo reverted temp change --- TTS/engine_wrapper.py | 2 +- utils/video.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/TTS/engine_wrapper.py b/TTS/engine_wrapper.py index e22c96b..213defb 100644 --- a/TTS/engine_wrapper.py +++ b/TTS/engine_wrapper.py @@ -13,7 +13,7 @@ from utils.console import print_step, print_substep from utils.voice import sanitize_text from utils import settings -DEFAULT_MAX_LENGTH: int = 5 # video length variable todo change +DEFAULT_MAX_LENGTH: int = 50 # video length variable class TTSEngine: diff --git a/utils/video.py b/utils/video.py index 5c89e3b..03ed88c 100644 --- a/utils/video.py +++ b/utils/video.py @@ -35,14 +35,13 @@ class Video: return ImageClip(path) def add_watermark(self, text, opacity=0.5, duration: int | float = 5, position: Tuple = (0.7, 0.9), fontsize=15): - print(len(text)) compensation = round((position[0] / ((len(text) * (fontsize / 5) / 1.5) / 100 + position[0] * position[0])), ndigits=2) position = (compensation, position[1]) - print(f'{compensation=}') - print(f'{position=}') + #print(f'{compensation=}') + #print(f'{position=}') img_clip = self._create_watermark(text, opacity=opacity, fontsize=fontsize) img_clip = img_clip.set_opacity(opacity).set_duration(duration) - img_clip = img_clip.set_position(position, relative=True) # set position doesn't work for some reason # fixme + img_clip = img_clip.set_position(position, relative=True) # todo get dara from utils/CONSTANTS.py and adapt position accordingly # Overlay the img clip on the first video clip self.video = CompositeVideoClip([self.video, img_clip])