Stop drawing teaser text in rendered intro while keeping metadata teaser

This commit is contained in:
hbrain 2026-06-01 05:34:40 +00:00
parent f43f6f3ef4
commit 5b39cc6891

View file

@ -1066,7 +1066,7 @@ def build_video(
filters.append(f"[{current}]" + ",".join(fade_parts) + f"[{fade_label}]") filters.append(f"[{current}]" + ",".join(fade_parts) + f"[{fade_label}]")
current = fade_label current = fade_label
title_lines = [x for x in [data.title, data.teaser, data.date, data.place] if x] title_lines = [x for x in [data.title, data.date, data.place] if x]
final_label = "vout" final_label = "vout"
title_label = "titled" title_label = "titled"
title_font = str(Path.home() / ".local/share/fonts/google/BebasNeue-Regular.ttf") title_font = str(Path.home() / ".local/share/fonts/google/BebasNeue-Regular.ttf")
@ -1075,10 +1075,7 @@ def build_video(
if title_lines: if title_lines:
title_font_size = max(60, height // 10) title_font_size = max(60, height // 10)
subtitle_font_size = max(40, height // 18) subtitle_font_size = max(40, height // 18)
teaser_font_size = max(30, height // 24)
meta_font_size = max(24, height // 30)
main_title = data.title or title_lines[0] main_title = data.title or title_lines[0]
teaser = strip_unsupported_caption_chars((data.teaser or "").strip())
subtitle = " | ".join(x for x in [data.date, data.place] if x) subtitle = " | ".join(x for x in [data.date, data.place] if x)
fade_in_start = INTRO_TITLE_START_OFFSET fade_in_start = INTRO_TITLE_START_OFFSET
fade_in_enabled = INTRO_TITLE_FADE_IN_ENABLED and INTRO_TITLE_FADE_LENGTH > 0 fade_in_enabled = INTRO_TITLE_FADE_IN_ENABLED and INTRO_TITLE_FADE_LENGTH > 0
@ -1122,18 +1119,10 @@ def build_video(
) )
title_next_label = "title0b" title_next_label = "title0b"
if teaser:
teaser_y = f"(h-text_h)/2+{subtitle_font_size}"
filters.append(
f"[{title_next_label}]drawtext=fontfile='{title_font}':{textfile_arg(teaser)}:x=(w-text_w)/2:y={teaser_y}:"
f"fontsize={teaser_font_size}:fontcolor=0xF2F2EE:borderw=0:shadowcolor=black@0.75:shadowx=2:shadowy=2:"
f"alpha='{title_alpha}':{title_enable}[title_teaser]"
)
title_next_label = "title_teaser"
if subtitle: if subtitle:
subtitle_y_offset = subtitle_font_size if not teaser else (subtitle_font_size + teaser_font_size + 8) subtitle_y_offset = subtitle_font_size
subtitle_size = subtitle_font_size if not teaser else meta_font_size subtitle_size = subtitle_font_size
filters.append( filters.append(
f"[{title_next_label}]drawtext=fontfile='{title_font}':{textfile_arg(subtitle)}:x=(w-text_w)/2:y=(h-text_h)/2+{subtitle_y_offset}:" f"[{title_next_label}]drawtext=fontfile='{title_font}':{textfile_arg(subtitle)}:x=(w-text_w)/2:y=(h-text_h)/2+{subtitle_y_offset}:"
f"fontsize={subtitle_size}:fontcolor=white:borderw=0:shadowcolor=black@0.75:shadowx=2:shadowy=2:" f"fontsize={subtitle_size}:fontcolor=white:borderw=0:shadowcolor=black@0.75:shadowx=2:shadowy=2:"