reverted temp change
pull/998/head
Jason 2 years ago
parent d5d8cb1721
commit 420bac9a5a

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

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

Loading…
Cancel
Save