fix(content): crop NASA burned-in captions off the cosmos Orion clip

The cosmos primary is NASA/JPL's "Orion: Dust and Death" — an annotated
visualization with lower-third captions ("DUST FILAMENT", "BLUE BUBBLE", …)
burned in throughout, so trimming can't avoid them (only ~4s of our window is
caption-free). The candidate-pool doc wrongly called it text-free.

- build_pool_manifest.decaption_cosmos(): crops the cosmos base/master to the
  top 66% of frame height (16:9 preserved, center-x, ~1.5x tighter framing),
  re-fit to 1920x1080 — the recorded, reproducible form of the fix (media is
  gitignored). Applied in place; re-ran generate_media() so the cosmos-orbit /
  abyss-cosmos transitions use the cropped base.
- docs/content-candidate-pool.md: correct the "text-free" note; document the crop.

269 passed, 2 skipped. De-caption verified by-eye on both caption moments;
final look to be confirmed by the operator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BenStullsBets
2026-06-25 09:16:57 -07:00
parent 0201690ce0
commit 53cb89b4c6
2 changed files with 40 additions and 2 deletions
+29
View File
@@ -408,6 +408,35 @@ def generate_media() -> None:
print(f"generated transitions/{a}-{b}.mp4 (+ .rev) from real bases")
# Fraction of frame HEIGHT kept (from the top) to drop the NASA burned-in
# lower-third captions on the cosmos Orion clip ("DUST FILAMENT", "BLUE BUBBLE",
# …). The "Orion: Dust and Death" visualization is captioned throughout, so
# trimming can't avoid them — we crop past them instead. ~1.5x tighter framing.
COSMOS_CAPTION_KEEP = 0.66
def decaption_cosmos() -> None:
"""Re-crop the cosmos Orion base/master IN PLACE to remove NASA's burned-in
lower-third caption band, keeping 16:9 (crop width to match, center-x, top-
anchored) then re-fitting to 1920x1080. Run ONCE after (re)sourcing the Orion
clip — re-running would crop again. Media is gitignored, so this is the
recorded, reproducible form of the operation."""
ff = _ffmpeg()
f = COSMOS_CAPTION_KEEP
vf = f"crop=iw*{f}:ih*{f}:iw*{(1 - f) / 2}:0,scale=1920:1080"
for name, crf in (("base", "20"), ("master", "18")):
p = MEDIA / "cosmos" / f"{name}.mp4"
if not p.exists():
continue
tmp = p.with_suffix(".decap.mp4")
subprocess.run([
ff, "-y", "-i", str(p), "-vf", vf,
"-c:v", "libx264", "-crf", crf, "-pix_fmt", "yuv420p", "-an", str(tmp),
], check=True, capture_output=True)
tmp.replace(p)
print(f"de-captioned cosmos/{name}.mp4 (kept top {int(f * 100)}%)")
def main(argv: list[str]) -> None:
manifest = build_manifest()
MANIFEST.write_text(json.dumps(manifest, indent=2, ensure_ascii=False) + "\n")