feat(overlay): detect libfreetype/drawtext, fail overlays gracefully #9

Merged
hugooconnor merged 0 commits from refs/pull/9/head into main 2026-07-16 13:06:20 +00:00
hugooconnor commented 2026-06-26 09:32:03 +00:00 (Migrated from codeberg.org)

Problem

ffmpeg overlays (REQ-023) are drawn with the drawtext filter, which only exists in libfreetype-enabled ffmpeg builds. Homebrew's core ffmpeg formula now omits libfreetype, so --burn-overlay / play --overlay die mid-render with a cryptic No such filter: 'drawtext'. SPEC-001 assumed drawtext was "built into ffmpeg, no additional deps" — no longer true on common installs.

Change

Keeps drawtext (and its live running timecode) as the overlay path, but makes the libfreetype requirement first-class and self-diagnosing:

  • doctor — probes ffmpeg -filters for drawtext; adds overlay_drawtext to DoctorResult with a platform-specific install hint. ar-edit doctor prints overlay (drawtext) available / MISSING — … brew install homebrew-ffmpeg/ffmpeg/ffmpeg.
  • render — new RenderError::OverlayUnavailable: fail early with an actionable message instead of letting each segment extraction fail cryptically.
  • install.sh — post-install check warns when ffmpeg lacks drawtext (and whisper-cli), with remediation.
  • README — documents the libfreetype requirement for overlays.

No new crates; no behaviour change when ffmpeg has drawtext.

Tests

  • cargo test -p ar-edit-core --lib458 passed, incl. new tests: filter parser (present / absent / name-in-description), install hint, OverlayUnavailable message, doctor serialization with the new field.
  • cargo check + cargo clippy -p ar-edit-core clean.

Note: the full binary build / integration suite weren't run in this environment (disk was full); the core crate — where all the logic lives — is checked and tested.

🤖 Generated with Claude Code

## Problem ffmpeg overlays (REQ-023) are drawn with the `drawtext` filter, which only exists in **libfreetype-enabled** ffmpeg builds. Homebrew's *core* `ffmpeg` formula now omits libfreetype, so `--burn-overlay` / `play --overlay` die mid-render with a cryptic `No such filter: 'drawtext'`. SPEC-001 assumed drawtext was "built into ffmpeg, no additional deps" — no longer true on common installs. ## Change Keeps `drawtext` (and its live running timecode) as the overlay path, but makes the libfreetype requirement **first-class and self-diagnosing**: - **doctor** — probes `ffmpeg -filters` for `drawtext`; adds `overlay_drawtext` to `DoctorResult` with a platform-specific install hint. `ar-edit doctor` prints `overlay (drawtext) available` / `MISSING — … brew install homebrew-ffmpeg/ffmpeg/ffmpeg`. - **render** — new `RenderError::OverlayUnavailable`: fail early with an actionable message instead of letting each segment extraction fail cryptically. - **install.sh** — post-install check warns when ffmpeg lacks `drawtext` (and whisper-cli), with remediation. - **README** — documents the libfreetype requirement for overlays. No new crates; no behaviour change when ffmpeg has `drawtext`. ## Tests - `cargo test -p ar-edit-core --lib` → **458 passed**, incl. new tests: filter parser (present / absent / name-in-description), install hint, `OverlayUnavailable` message, doctor serialization with the new field. - `cargo check` + `cargo clippy -p ar-edit-core` clean. > Note: the full binary build / integration suite weren't run in this environment (disk was full); the core crate — where all the logic lives — is checked and tested. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anuna-research/ar-edit!9
No description provided.