Skip to content

Commit 69adf75

Browse files
authored
fix(live-proof): fall back to a single poster frame for short recordings (#1192)
The contact-sheet tile needs about 100 seconds of sampled video before hosted ffmpeg builds emit a frame, so demonstrations shorter than that produced no poster and failed the bundle (openclaw/openclaw#110714 run 32028028690). Short recordings now retry with a single scaled frame near the start of the demo before failing.
1 parent e87fb1f commit 69adf75

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ checkpoint, and status-only commits are intentionally omitted.
1818

1919
### Changed
2020

21+
- Short live-proof recordings fall back to a single poster frame when the contact-sheet tile cannot emit one.
2122
- Terminal recorders flush WebM packets immediately and treat a live ffmpeg session as healthy while the muxer buffers.
2223
- Terminal live-proof recordings tune VP9 for realtime capture and accept the recorder once any payload is written, matching the encoder's bursty muxer output.
2324
- OpenClaw browser live proofs run against the repository's mock control-UI dev server.

‎src/live-proof/execute.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,20 @@ export async function executeLiveProof(
147147
`live proof recording exceeds configured ${liveTest.maxRecordingSeconds}-second cap`,
148148
);
149149
}
150-
const poster = createVideoContactSheet(mp4Path, posterPath, runner);
151-
requireSuccess("ffmpeg", ["contact-sheet", mp4Path], poster);
150+
// The contact-sheet tile needs ~100 seconds of sampled video before some
151+
// ffmpeg builds emit a frame, so short recordings fall back to a single
152+
// poster frame near the start of the demonstration.
153+
createVideoContactSheet(mp4Path, posterPath, runner);
154+
if (!existsSync(posterPath)) {
155+
for (const offset of ["1", "0"]) {
156+
const frame = runner(
157+
"ffmpeg",
158+
["-hide_banner", "-y", "-ss", offset, "-i", mp4Path, "-frames:v", "1", "-vf", "scale=640:-1", posterPath],
159+
{ cwd: checkout },
160+
);
161+
if (frame.status === 0 && existsSync(posterPath)) break;
162+
}
163+
}
152164
if (!existsSync(posterPath)) throw new Error("ffmpeg did not create poster.jpg");
153165

154166
writeFileSync(stepsLogPath, `${JSON.stringify(drive.steps, null, 2)}\n`, "utf8");

0 commit comments

Comments
 (0)