Skip to content

[adapter-hyperframes] Multiple render bugs with frame-light-leak-cinema template — visual effects missing, animation jumps to end-state, multi-scene duration broken #76

Description

@walliai666

Environment

  • OS: macOS 26.5.1
  • Node.js: v25.9.0
  • pnpm: 9.15.0
  • Template: frame-light-leak-cinema
  • Content type: 概念解说短片
  • Adapter: adapter-hyperframes

Problems

1. Visual effects missing in exported MP4

Effects like backdrop-filter, mix-blend-mode, and SVG filters visible in the browser
preview are completely absent in the exported video. The output looks nothing like the
in-browser preview.

2. GSAP animation jumps to end-state at frame 0

On templates using GSAP, the exported video opens with all elements already in their
final state (e.g. fully opaque, already in final position). The entire entrance
animation is skipped — the clip looks like it was recorded starting from the last frame.

3. Multi-scene duration broken (NaN / wrong timing)

When using a multi-composition template, each scene's duration is wrong. Animations
play too fast or get cut off mid-way. Root cause: the __VIDEO_DURATION__ placeholder
inside composition files is never substituted with the actual value, so timelines
receive NaN and timing collapses.

4. Silent failure — blank/black video with no error message

When a page-level JS error occurs during render, the output is a blank or near-black
video with no indication of what went wrong. There is no error surfaced to the user.

Root Causes (investigated)

  1. Missing --disable-gpu / --use-gl=swiftshader flags — Chromium silently drops
    composited effects on headless machines without a GPU.
  2. GSAP pause injected too earlyaddInitScript runs before GSAP's wake()
    reassigns window.gsap, discarding the patch. Initial element states set by
    gsap.set() in DOMContentLoaded are also skipped, causing the jump-to-end-state bug.
  3. prepareSourceHtml hardcoded '15' and did not substitute __VIDEO_DURATION__
    inside child composition files.
  4. No page.on('pageerror') listener and no webm size guard to catch silent crashes.

Fix

I have a fix ready for all four issues in packages/adapter-hyperframes/src/render.ts:

  • Add --disable-gpu + --use-gl=swiftshader to Chromium launch args
  • Move GSAP pause to after DOMContentLoaded + 100ms tick; atomically seek(0) +
    resume() at recording start
  • Pass totalDuration into prepareSourceHtml and substitute placeholders in both
    the entry HTML and all child composition files
  • Add page.on('pageerror') / page.on('console') listeners and a webm size guard
    (< 10 KB → throw with actionable message)

Happy to open a PR with this fix. Let me know if you'd like me to proceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions