commit 845d8610f5ee967525c1d70750aff0997087b7c6
parent 2e31019b05906051ad525f9621ba6a0d2c8cd2c9
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 10 Nov 2026 09:10:43 -0500
umtool: a twocrop clip's frame is crop one padded to the frame, never an endless colour source under an overlay
The real-data vertical preview was OOM-killed at its 8 GB cap encoding the twocrop segment: the colour source
filled the overlay faster than the picture drained it. Padded, the 10 s segment encodes in 540 MB.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/umtool/report-to-video/vertical-deck.mjs b/umtool/report-to-video/vertical-deck.mjs
@@ -244,12 +244,12 @@ export function twoCropGraph({ crops, srcW, srcH, render, blur = [], fps = 30, i
const a = cropToBox(crops[0], srcW, srcH, t.crop1);
const b = cropToBox(crops[1], srcW, srcH, t.crop2);
const lead = [...blur, "setsar=1"].join(",");
+ // The ground is crop one PADDED to the frame -- never an endless colour source under an overlay, which the
+ // filtergraph fills faster than the picture drains it (the real-data preview was OOM-killed at 8 GB, 9 Nov).
return [
`${lead},split=2[${p("a")}][${p("b")}]`,
- `color=c=${bg}:s=${W}x${H}:r=${fps}[${p("g")}]`,
- `[${p("a")}]crop=${a.w}:${a.h}:${a.x}:${a.y},scale=${t.crop1.width}:${t.crop1.height}:flags=lanczos,setsar=1[${p("1")}]`,
+ `[${p("a")}]crop=${a.w}:${a.h}:${a.x}:${a.y},scale=${t.crop1.width}:${t.crop1.height}:flags=lanczos,setsar=1,pad=${W}:${H}:0:${t.crop1.y}:color=${bg}[${p("g1")}]`,
`[${p("b")}]crop=${b.w}:${b.h}:${b.x}:${b.y},scale=${t.crop2.width}:${t.crop2.height}:flags=lanczos,setsar=1[${p("2")}]`,
- `[${p("g")}][${p("1")}]overlay=x=0:y=${t.crop1.y}:shortest=1[${p("g1")}]`,
`[${p("g1")}][${p("2")}]overlay=x=0:y=${t.crop2.y}:format=auto,setsar=1,fps=${fps}`,
].join(";");
}
diff --git a/umtool/report-to-video/vertical-deck.test.mjs b/umtool/report-to-video/vertical-deck.test.mjs
@@ -107,7 +107,8 @@ test("a crop is cut to its band's aspect about its centre; the enlargement is sa
assert.ok(a < ENLARGE_WARN);
assert.ok(b > ENLARGE_WARN);
const graph = twoCropGraph({ crops: [[0, 0, 0.6, 0.6], [0.6, 0.6, 0.4, 0.4]], srcW: 1920, srcH: 1080, render: r, fps: 30 });
- assert.ok(graph.includes(`overlay=x=0:y=${stackedGeometry(r).twocrop.crop1.y}`));
+ assert.ok(graph.includes(`pad=1080:1920:0:${stackedGeometry(r).twocrop.crop1.y}`));
+ assert.ok(!graph.includes("color=c="), "no endless colour source under an overlay");
assert.ok(graph.includes(`overlay=x=0:y=${stackedGeometry(r).twocrop.crop2.y}`));
assert.ok(graph.startsWith("setsar=1,split=2"));
});