caelum0x 524f2ddea5 fix(near-hackathon): re-voice false "live on two other chains" claim in pitch demo video
Narration line 2 said Cred402 is "already live on two other chains, and
now native NEAR" — false. Live checks against
cred402-1.onrender.com/v1/x402/{algorand,qie}/status both return
configured:false. The deck was already corrected (4eb21fe); this patches
the video's narration to match.

New line 2: "Cred402 sells credit scores to AI agents over a pay per
call payment protocol, and now it's enforced natively on NEAR." Same
Aura-2 voice (aura-2-asteria-en — re-derived acoustically, since no
voice ID was recorded in the original build: synthesized the real line 1
text in all 5 cataloged voices and compared pitch/spectral-centroid
against the shipped audio; asteria matched an order of magnitude closer
than the next candidate). Same per-line Deepgram nova-3 QC round-trip.

Only the line 2 window (8.9s-17.766s) was touched — confirmed by frame
diff that this whole span is a single static held title card in the
shipped video, so the patch could re-render just that card + new
captions + new audio and splice it between the untouched first 8.9s and
untouched remainder (which includes line 3's unmoved 19.5s start).
Re-transcribed the full final audio with nova-3 to confirm lines 1 and
3-6 are unchanged.

Duration unchanged (70.6s), resolution/fps/codec unchanged (1920x1080,
30fps, h264/aac). Re-mastered loudness: -14.8 LUFS integrated / -1.8
dBTP true peak (both within spec).

Reproducible recipe: media/video-recipe/line2-fix/ (generate_line2_audio.py
-> render_line2_assets.mjs -> build_patch.sh).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-11 02:06:42 +03:00

82 lines
3.4 KiB
JavaScript

// render_line2_assets.mjs — renders the two visual pieces needed to patch
// narration line 2 (see README "Judge-review correction, 2026-11-11" and
// generate_line2_audio.py for why): the still background plate line 2 sits
// on (card2 "what it is", held frame — identical params to the original
// ../render_cards.mjs, just rendered at t=1 instead of the 18-frame ease-in,
// since the whole line-2 window in the shipped video is that card already
// fully held) and the new line's caption pills (same ../caption.html
// template, same 7-word chunking as ../render_captions.mjs), built from
// this fix's own word timings in l2_take.json.
//
// Run: node render_line2_assets.mjs (needs `playwright`, already a repo
// devDependency — this is how ../render_cards.mjs / render_captions.mjs
// were run for the original build).
import { chromium } from "playwright";
import { readFileSync, writeFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
const HERE = dirname(fileURLToPath(import.meta.url));
const RECIPE = join(HERE, "..");
const CARD_HTML = "file://" + join(RECIPE, "card.html");
const CAPTION_HTML = "file://" + join(RECIPE, "caption.html");
// Exact same params as card2-what in ../render_cards.mjs — the background
// line 2 is shown over in the shipped video, unchanged by this fix.
const CARD2 = {
brand: "CRED402 x SPENDGUARD",
tag: "What it is",
title: "A pay-per-call credit score, paid in NEAR.",
sub: "x402 (402 Payment Required) + a real NEAR access-key allowance nearcore itself enforces.",
chips: "near_gateway.ts|spend_guard/*.rs",
};
const CHUNK = 7;
async function main() {
const take = JSON.parse(readFileSync(join(HERE, "l2_take.json"), "utf8"));
const words = take.words;
const cues = [];
for (let i = 0; i < words.length; i += CHUNK) {
const chunk = words.slice(i, i + CHUNK);
cues.push({
start: chunk[0].start,
end: chunk[chunk.length - 1].end,
text: chunk.map((w) => w.w).join(" "),
});
}
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1920, height: 1080 } });
// 1. Background plate: card2, held (t=1 — fully faded in, matches every
// frame of the shipped video from ~8.3s to the 18.5s hard cut).
const qs = new URLSearchParams({ ...CARD2, t: "1" });
await page.goto(`${CARD_HTML}?${qs.toString()}`, { waitUntil: "load" });
await page.screenshot({ path: join(HERE, "plate.png") });
console.log("wrote plate.png");
// 2. Caption pills, one PNG per 7-word cue, transparent background so
// they composite onto the plate exactly like ../render_captions.mjs did.
const manifest = [];
for (let i = 0; i < cues.length; i++) {
const cue = cues[i];
const url = `${CAPTION_HTML}?text=${encodeURIComponent(cue.text)}`;
await page.goto(url, { waitUntil: "load" });
const file = `cue_${String(i).padStart(2, "0")}.png`;
await page.screenshot({ path: join(HERE, file), omitBackground: true });
// Times here are relative to the patched clip's own start (local 0 =
// film-timeline 8.9s, the original, unmoved l2 slot start).
manifest.push({ file, start: cue.start, end: cue.end, text: cue.text });
console.log(`${file} [${cue.start.toFixed(2)}-${cue.end.toFixed(2)}] ${cue.text}`);
}
await browser.close();
writeFileSync(join(HERE, "cues.json"), JSON.stringify(manifest, null, 2));
}
main().catch((e) => {
console.error(e);
process.exit(1);
});