From 85b571759579af51823741503b669ceaca67fbb6 Mon Sep 17 00:00:00 2001 From: Leonardo Mortari Date: Mon, 4 Aug 2025 09:04:51 -0300 Subject: [PATCH] Adiciona vars faltantes --- components/video.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/video.py b/components/video.py index 7a0658d..9e62eac 100644 --- a/components/video.py +++ b/components/video.py @@ -6,7 +6,8 @@ from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip from moviepy import TextClip font = "./Montserrat.ttf" - +font_size = 70 +video_codec = "libx264" def auto_wrap_text(text, font, font_size, max_width): if not text: @@ -33,7 +34,7 @@ def auto_wrap_text(text, font, font_size, max_width): return "\n".join(lines) def cut_video_new_clip(input_path: str, start: float, end: float, output_path: str): - video_codec = "libx264" + with VideoFileClip(input_path) as clip: segment = clip.subclipped(start, end) @@ -67,7 +68,6 @@ def process_segment(input_path: str, top_text: str = "", bottom_text: str = "", video_resized = clip.resized(width=final_width) y = top_h + (middle_h - video_resized.h) // 2 video_resized = video_resized.with_position((0, y)) - video_codec = "libx264" wrapped_top_text = auto_wrap_text(top_text, font, font_size, final_width - 40) wrapped_bottom_text = auto_wrap_text(bottom_text, font, font_size, final_width - 40)