fix: make subtitle burn-in diagnosable and multilingual - #120
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
A font name containing a comma, apostrophe, backslash, or control character could terminate the force_style argument or inject extra ASS style fields. Reject those up front and cover it with a regression test.
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Only validate the EDL subtitle_font override when subtitles are actually burned in, so --no-subtitles or a missing EDL subtitles path no longer fails on a field that will not be used. Convert the ValueError into a SystemExit so an invalid font override prints a message instead of a traceback, matching the existing libass check.
|
Both flagged, thanks. Handling them separately since one was already closed out: The The second one is fair and is fixed in 591beac. Two problems, both real:
Existing render tests still pass. |
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
A bad font config now fails before the expensive render work, gated on actual burn-in intent so --no-subtitles never trips on it.
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Implemented the remaining review fix. - Non-string `subtitle_font` values now raise a clean validation error before extraction: [helpers/render.py](/Users/mvanhorn/.osc/workspaces/browser-use-video-use-pr120/helpers/render.py:59) - Added helper and preflight regression coverage: [tests/test_render.py](/Users/mvanhorn/.osc/workspaces/browser-use-video-use-pr120/tests/test_render.py:177) ### CODEX STATUS - **PASS:** 13 focused tests. - **PASS:** Scoped Ruff checks and `git diff --check`. - **PASS:** Black check for the modified tests. - **BASELINE_BLOCKED:** Full Ruff/Black checks encounter existing unrelated issues in `helpers/render.py`.
|
Fixed. Non-string 13 focused tests pass, plus scoped Ruff and Black on the touched files. |
Subtitle burn-in currently reaches the final compositing pass before discovering that the selected ffmpeg lacks the libass-backed
subtitlesfilter, so the documented default Homebrew installation wastes the earlier render work and ends in an opaqueCalledProcessError. The same path always forces Helvetica, which prevents a project from selecting a font with glyph coverage for CJK and other non-Latin scripts. The EDL and skill documentation expose a subtitle file but no font override, despite describing subtitle styling as customizable. The issue also proposes language-aware cue chunking, but that distinct segmentation behavior is outside this plan's explicitly declared partial scope.Summary by cubic
Add a production-used ffmpeg capability check in
helpers/render.pyand run it before segment extraction whenever the requested render will burn an existing EDL subtitle file or build subtitles, while preserving--no-subtitlesand subtitle-free renders; on failure, exit cleanly with the missing-libass diagnosis and installation/PATH guidance. Replace the fixed font portion of the force style with an EDL-levelsubtitle_fontoverride that retains the current Helvetica default and all proven geometry, color, and safe-zone values, then pass the resolved style through the existing final-composite call path. Document the new EDL field and require projects with non-Latin captions to choose an installed, script-compatible font rather than relying on a platform-specific global default.Test
--build-subtitleswith an ffmpeg filter listing that lacks an exactsubtitlesentry exits before segment extraction and reports that a libass-enabled ffmpeg is required, including actionable macOS PATH guidance rather than a traceback.--no-subtitles, an EDL with no subtitle request, and an EDL whose configured subtitle file is absent retain their current skip/warning behavior without requiring libass.subtitlesfilter passes capability detection without being confused by unrelated text, and a failed ffmpeg capability probe produces the same controlled diagnostic.subtitle_fontproduces the existing Helvetica force style byte-for-byte, preserving FontSize, bolding, colors, alignment, and MarginV=90.Heiti SCchanges onlyFontNamein the final subtitles filter and leaves overlay ordering, subtitle path escaping, and all other style fields intact.install.md, and the EDL contract inSKILL.mdconsistent about libass availability,ffmpeg-fullPATH precedence, and per-project font selection.Closes #118
Summary by cubic
Fail‑fast, multilingual subtitle burn‑in. Previously, burn‑in failed late at final compositing with an opaque error and always forced Helvetica; now we preflight
ffmpegfor libass and allow an EDLsubtitle_fontoverride. Subtitle‑free renders are unchanged.ffmpegfor an exactsubtitlesfilter before extraction when burn‑in will occur (including--build-subtitles); on failure, exits cleanly with install/PATH guidance for macOS (brew install ffmpeg-full, put it first onPATH, verify withffmpeg -hide_banner -filters | grep -w subtitles).--no-subtitles, EDLs without subtitles, and missing subtitle files; no libass required in those modes.subtitle_font; validates only when burn‑in is active and exits cleanly on invalid values (rejects non‑strings and commas, apostrophes, backslashes, or control characters to preventforce_styleinjection). Default remains Helvetica with existing colors and geometry (MarginV=90); onlyFontNamechanges.README.md,SKILL.md,install.md) with the capability check, PATH precedence forffmpeg-full, and guidance to setsubtitle_fontfor non‑Latin captions.Closes #118
Written for commit a05bd95. Summary will update on new commits.