Subtitles: UPPERCASE + position lower (MarginV=320 for 1080x1920) + bigger font
This commit is contained in:
parent
d36893bf2d
commit
28d933c916
@ -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"
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user