Skip to content

Periodic near-black frame in chunk-lambda renders (first video inject per session) #2007

Description

@varo-yang

Chunk-lambda renders drop a periodic near-black frame — one bad frame every chunk_frames / worker_count frames. On a single-video 4-worker chunk that's every 60 frames, and signalstats catches it cleanly: YAVG ~22 against YMAX ~240. Local single-process renders never show it, since they don't run under BeginFrame.

It comes from the isNewImage branch in injectVideoFramesBatch. The first time a session paints a given videoId there's no __render_frame__ sibling yet, so it creates the <img> on the spot — createElement + insertBefore. captureFrameCore fires beginFrameCapture right after, and the paint flush in frameCapture.ts is skipped whenever we're in beginframe mode. So under HeadlessExperimental.BeginFrame the compositor hasn't pulled the freshly-inserted layer into its tree by the time we capture — it lands a tick later, and that frame comes out as body background plus whatever was already composited (the YAVG ~22 signature). Each lambda worker is its own session, so it recurs at every worker boundary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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