Skip to content

Write HTML. Render video. Built for agents.

fix(producer): point the disk-capture preflight at routes that actually stream

Vance Ingalls457687e77c4f
diff --git a/packages/producer/src/services/render/stages/captureStage.test.ts b/packages/producer/src/services/render/stages/captureStage.test.ts
index 45448f6048..d044c6d0c2 100644
--- a/packages/producer/src/services/render/stages/captureStage.test.ts
+++ b/packages/producer/src/services/render/stages/captureStage.test.ts
@@ -35,6 +35,25 @@ describe("disk capture capacity", () => {
).toThrow(/may need ~0\.8 MB.*0\.8 MB is free.*--low-memory-mode/s);
});
+ it("tells the user which routes still use disk capture, not a dead env var", () => {
+ const landscape = {
+ width: 1920,
+ height: 1080,
+ fps: { num: 30, den: 1 },
+ format: "jpeg" as const,
+ };
+ let message = "";
+ try {
+ assertDiskCaptureHeadroom("/tmp/frames", 9000, landscape, () => 10 * 1e9);
+ } catch (error) {
+ message = error instanceof Error ? error.message : String(error);
+ }
+ expect(message).toContain("Disk capture may need");
+ expect(message).toContain("--workers 1");
+ expect(message).toContain("--low-memory-mode");
+ expect(message).not.toContain("PRODUCER_STREAMING_ENCODE_MAX_DURATION_SECONDS");
+ });
+
it("exposes the same 90% headroom decision to fallback planning", () => {
const estimatedBytes = estimateDiskCaptureBytes(10, captureOptions);
diff --git a/packages/producer/src/services/render/stages/captureStage.ts b/packages/producer/src/services/render/stages/captureStage.ts
index cfa0170462..ed58099681 100644
--- a/packages/producer/src/services/render/stages/captureStage.ts
+++ b/packages/producer/src/services/render/stages/captureStage.ts
@@ -194,8 +194,9 @@ export function assertDiskCaptureHeadroom(
throw new Error(
`Disk capture may need ~${(headroom.estimatedBytes / 1e6).toFixed(1)} MB of temporary frame storage, ` +
`but only ${(headroom.freeBytes / 1e6).toFixed(1)} MB is free at ${framesDir}. ` +
- "Re-run with --low-memory-mode to stream frames, raise " +
- "PRODUCER_STREAMING_ENCODE_MAX_DURATION_SECONDS if streaming is supported, " +
+ "Disk capture stores every frame as raw RGBA; it is used for multi-worker renders " +
+ "and for png-sequence, gif, HDR and shader-transition outputs. " +
+ "Re-run with --workers 1 to stream frames into the encoder, use --low-memory-mode, " +
"or free up disk space.",
);
}