Update app.py
Browse files
app.py
CHANGED
@@ -365,9 +365,9 @@ def create_subtitle_clip_pil(text, start_time, end_time, video_width, video_heig
|
|
365 |
subtitle_width = int(video_width * 0.8)
|
366 |
aspect_ratio = video_height / video_width
|
367 |
if aspect_ratio > 1.2: # Portrait video
|
368 |
-
subtitle_font_size = int(video_width //
|
369 |
else: # Landscape video
|
370 |
-
subtitle_font_size = int(video_height //
|
371 |
|
372 |
font = ImageFont.truetype(font_path, subtitle_font_size)
|
373 |
|
|
|
365 |
subtitle_width = int(video_width * 0.8)
|
366 |
aspect_ratio = video_height / video_width
|
367 |
if aspect_ratio > 1.2: # Portrait video
|
368 |
+
subtitle_font_size = int(video_width // 22)
|
369 |
else: # Landscape video
|
370 |
+
subtitle_font_size = int(video_height // 24)
|
371 |
|
372 |
font = ImageFont.truetype(font_path, subtitle_font_size)
|
373 |
|