From 28d933c916233f967fb96c4be6cdd3266921584d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastjan=20Arti=C4=8D?= Date: Tue, 28 Apr 2026 17:40:48 +0000 Subject: [PATCH] Subtitles: UPPERCASE + position lower (MarginV=320 for 1080x1920) + bigger font --- scripts/subtitle.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/subtitle.py b/scripts/subtitle.py index 0ff1391..5156175 100644 --- a/scripts/subtitle.py +++ b/scripts/subtitle.py @@ -40,11 +40,12 @@ def transcribe(video, lang=None, model_size="small"): return f"{h:02d}:{m:02d}:{sec:06.3f}".replace(".", ",") # Generiramo word-level chunked podnapise: 3-5 besed naenkrat + # Vse v VELIKIH TISKANIH ÄŚRKAH za reels stil idx = 1 for seg in segments: words = seg.words or [] if not words: - srt_path.write(f"{idx}\n{fmt_ts(seg.start)} --> {fmt_ts(seg.end)}\n{seg.text.strip()}\n\n") + srt_path.write(f"{idx}\n{fmt_ts(seg.start)} --> {fmt_ts(seg.end)}\n{seg.text.strip().upper()}\n\n") idx += 1 continue @@ -55,14 +56,14 @@ def transcribe(video, lang=None, model_size="small"): if len(group) >= 4 or w.word.strip().endswith((".", "?", "!")): start = group[0].start end = group[-1].end - text = "".join(g.word for g in group).strip() + text = "".join(g.word for g in group).strip().upper() srt_path.write(f"{idx}\n{fmt_ts(start)} --> {fmt_ts(end)}\n{text}\n\n") idx += 1 group = [] if group: start = group[0].start end = group[-1].end - text = "".join(g.word for g in group).strip() + text = "".join(g.word for g in group).strip().upper() srt_path.write(f"{idx}\n{fmt_ts(start)} --> {fmt_ts(end)}\n{text}\n\n") idx += 1 @@ -73,19 +74,19 @@ def transcribe(video, lang=None, model_size="small"): SUBTITLE_STYLES = { "reels": ( - "FontName=Arial,FontSize=18,Bold=1," + "FontName=Arial,FontSize=22,Bold=1," "PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,BackColour=&H80000000," - "Outline=2,Shadow=0,Alignment=2,MarginV=180,BorderStyle=1" + "Outline=3,Shadow=0,Alignment=2,MarginV=320,BorderStyle=1" ), "yellow": ( - "FontName=Arial,FontSize=20,Bold=1," + "FontName=Arial,FontSize=22,Bold=1," "PrimaryColour=&H0000FFFF,OutlineColour=&H00000000," - "Outline=3,Shadow=0,Alignment=2,MarginV=200,BorderStyle=1" + "Outline=3,Shadow=0,Alignment=2,MarginV=320,BorderStyle=1" ), "minimal": ( - "FontName=Arial,FontSize=14," + "FontName=Arial,FontSize=16," "PrimaryColour=&H00FFFFFF,OutlineColour=&H80000000," - "Outline=1,Shadow=0,Alignment=2,MarginV=80,BorderStyle=1" + "Outline=2,Shadow=0,Alignment=2,MarginV=200,BorderStyle=1" ), }