Adiciona vars faltantes
This commit is contained in:
@@ -6,7 +6,8 @@ from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
|
|||||||
from moviepy import TextClip
|
from moviepy import TextClip
|
||||||
|
|
||||||
font = "./Montserrat.ttf"
|
font = "./Montserrat.ttf"
|
||||||
|
font_size = 70
|
||||||
|
video_codec = "libx264"
|
||||||
|
|
||||||
def auto_wrap_text(text, font, font_size, max_width):
|
def auto_wrap_text(text, font, font_size, max_width):
|
||||||
if not text:
|
if not text:
|
||||||
@@ -33,7 +34,7 @@ def auto_wrap_text(text, font, font_size, max_width):
|
|||||||
return "\n".join(lines)
|
return "\n".join(lines)
|
||||||
|
|
||||||
def cut_video_new_clip(input_path: str, start: float, end: float, output_path: str):
|
def cut_video_new_clip(input_path: str, start: float, end: float, output_path: str):
|
||||||
video_codec = "libx264"
|
|
||||||
|
|
||||||
with VideoFileClip(input_path) as clip:
|
with VideoFileClip(input_path) as clip:
|
||||||
segment = clip.subclipped(start, end)
|
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)
|
video_resized = clip.resized(width=final_width)
|
||||||
y = top_h + (middle_h - video_resized.h) // 2
|
y = top_h + (middle_h - video_resized.h) // 2
|
||||||
video_resized = video_resized.with_position((0, y))
|
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_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)
|
wrapped_bottom_text = auto_wrap_text(bottom_text, font, font_size, final_width - 40)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user