Skip to content

Distributed lambda render: 1-frame black flash at every <video> first-paint (off-by-one in renderChunk framePaths) #1731

Description

@Tzuhany

Rendering through the distributed chunk-lambda path produces a 1-frame black flash at every <video> boundary. For a 3-vid back-to-back composition (v1: 0-4s, v2: 4-8s, v3: 8-12s @ 30fps), frames 0, 121, and 242 all come out as body bg + whatever persistent overlays you have on top — Y≈22 with sparse highlights from text/logo. Local single-process renders are fine, so the bug only shows up after things hit lambda.

rebuildExtractedFramesFromPlanDir in renderChunk.ts builds framePaths with 1-based keys (set(i + 1, ...)), but getFrameAtTime does Math.floor(localTime * fps + 1e-9) which is 0-based. For each video's first-paint frame (localTime === 0frameIndex === 0), framePaths.get(0) returns undefined, the vid drops out of activePayloads, inject never fires, and the BeginFrame screenshot shows whatever's left of the DOM. Every other framePaths construction/consumption site in the repo is 0-based — renderChunk is the odd one out, which is why local tests pass.

Repro: render any multi-<video> composition through chunk-lambda, run ffmpeg -i out.mp4 -vf 'blackdetect=d=0.01:pix_th=0.05' -an -f null -. Black regions land exactly at each data-start boundary.

Fix in #1730 — one line. Opening this as a separate issue mostly so it doesn't get buried under the open PR pile.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions