Skip to content

feat(timeline): animated card overlays rendered from HTML - #254

Merged
edenreich merged 13 commits into
mainfrom
feat/overlay-cards
Sep 16, 2026
Merged

edenreich merged 13 commits into
mainfrom
feat/overlay-cards

Conversation

@edenreich

@edenreich edenreich commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #251. Content projects get an overlay track: cards written as HTML/CSS, rendered by HyperFrames to a ProRes 4444 MOV with alpha, and composited over the recording in the preview and the export. The video-editing skill gains an "Overlay cards" section with the contract and the render step; how a composition is written is left to the catalog's hyperframes and motion-graphics skills (inference-gateway/skills#132). The export is now always a standard delivery size and lands in <project>/export/.

Decisions worth a look:

  • Prerequisites are reported, never installed by the agent. The hyperframes skill comes from the catalog and the user installs it with infer skills install hyperframes motion-graphics; video-editing checks that skill, Node 22+ and ffmpeg's overlay filter, stops at the first missing one, and tells the user to run npx hyperframes browser ensure themselves if a render fails. prepare_content_tools keeps installing only ffmpeg and whisper.
  • Cards are ProRes 4444 .mov, not VP9 WebM: the webview plays WebM but drops its alpha, so a WebM card showed a black frame in the preview. .mov keeps the alpha in both the preview and the ffmpeg export, and HyperFrames writes it with --format mov. The export still accepts a WebM (decoded with libvpx-vp9 so ffmpeg keeps its alpha) for files dropped by hand.
  • Fixed frame size: the timeline's resolution (1920x1080 by default, 1080x1920 or 1350x1350, picked in the editor). The recording is scaled to fit and padded into it, so the picture is always re-encoded. Overlays are scaled against that frame with a plain scale; scale2ref ignored its size expressions on ffmpeg 9 and stretched cards to the video's aspect. The preview stage has the same aspect, so a card lands in the preview where the export puts it.
  • Exports go to export/<output> so they stay out of the media pool; Reveal opens them there.

Verified in the real app (mock mode, a staged content project): overlay lane above the video with thumbnails, cards shown over the video during playback at the right time and position, and a portrait Export producing a 1080x1920 MP4 in export/ with the recording letterboxed and the cards composited where the preview showed them. CSS-only HyperFrames cards render in 4-6 s each with data-no-timeline (it skips a 45 s GSAP wait), and task e2e -- tests/title-card-overlay.yaml passes.

Changes

  • frontend/lib/timeline.ts: overlay track kind; clip x, y, width, height, html; resolution with the three sizes; overlayCount, laneOrder and frameAspect helpers; tests.
  • backend/src/timeline.rs: export_args scales and pads the recording to the resolution, adds each overlay clip as an input (libvpx-vp9 for webm), shifts it with setpts, scales it to its fraction of the frame, chains overlay with enable=between(...), and writes to export/; a timeline with overlays but no audio clips exports the source audio as is; overlay joins the required-filters check; reveal_project_file accepts export/ and media/ paths; unit tests.
  • frontend/components/TimelineView.tsx: Frame picker; overlay lanes above the video lane with thumbnails; overlay clips move, trim and delete like audio clips; the preview stage has the export's aspect, positions overlay <video> elements over it, shows them only inside their range and syncs them as soon as the video loads; Export enabled when overlays exist.
  • .agents/skills/video-editing/SKILL.md (+ store.tsx prompt): "Overlay cards" section with prerequisites, the overlay contract, resolution, the mov render step and placement rules, and the export directory. The issue's "five templates" are covered by the catalog's motion-graphics skill rather than shipped here.
  • e2e: wait_for.file gains contains; title-card-overlay.yaml has the mock agent write an overlay track and asserts it on disk.

Docs follow-up: inference-gateway/docs#684.

…ositioned preview

An overlay track holds rendered cards (webm with alpha or ProRes 4444)
composited over the recording. Clips carry optional x/y/width/height as
fractions of the frame and the html composition they came from. Overlay
lanes stack above the video lane, show thumbnails, and move, trim and
delete like audio clips; the preview stage plays them over the main video
in step with its clock.
Each overlay clip becomes an ffmpeg input (libvpx-vp9 for webm so the
alpha survives), shifted to its start, scaled against the frame with
scale2ref when width/height are set, and overlaid only inside its range.
The picture is re-encoded with libx264 only when overlays exist; a
timeline with overlays and no audio exports the source audio as is.
Bundled like video-editing and named in the content-project prompt. The
skill checks Node, the HyperFrames Chromium and ffmpeg's overlay filter
and stops at the first missing one, then writes cards/<id>.html from the
catalogue (title, lower third, callout, step, bar chart), renders it with
npx hyperframes to a VP9 WebM with alpha and places it on the overlay
track. Cards animate with CSS only and carry data-no-timeline so the
renderer does not wait for a GSAP timeline.
wait_for.file gains an optional contains string so a test can assert the
timeline the mock agent wrote names an overlay track.
The overlay elements start hidden and were only synced on play or seek,
so a card starting at 0 stayed invisible until the first interaction.
The webview plays VP9 WebM but drops its alpha, so a card showed a black
frame in the preview. ProRes 4444 mov keeps the alpha in both the
preview and the ffmpeg export, and HyperFrames writes it with
--format mov.
The preview stretches a card with no width/height to the video's width;
the export now does the same instead of pasting it at its own pixel size.
…ctory

The export is always a standard delivery size: the timeline's
resolution (1920x1080 by default, 1080x1920 or 1350x1350, picked in the
editor). The recording is scaled to fit and padded into that frame and
overlay cards are scaled against it with a plain scale filter; scale2ref
ignored its size expressions on ffmpeg 9 and stretched cards to the
video's aspect. The preview stage takes the same aspect so cards land
where the export puts them. Exports are written to <project>/export/,
out of the media pool, and Reveal opens them there.
The prerequisites step ran npx hyperframes browser ensure, which
downloads HyperFrames and a Chromium build; that surprised the user
with an approval prompt. The skill now requires the catalog's
hyperframes skill to be installed, checks Node and ffmpeg, and tells
the user to run the browser setup themselves if a render fails.
…on-cards

The catalog's hyperframes and motion-graphics skills own how a card
composition is written; video-editing now owns only where it goes: the
overlay track contract, the frame size, the mov render and the
placement rules. The templates and tokens are gone with motion-cards.
edenreich added a commit to inference-gateway/skills that referenced this pull request Sep 16, 2026
Same file as inference-gateway/desktop#254: media/ layout, voice_sample
rules, the overlay track contract, the export frame size and the
HyperFrames render step.
edenreich added a commit to inference-gateway/skills that referenced this pull request Sep 16, 2026
* feat: add HeyGen HyperFrames and motion-graphics skills

Both entries point at heygen-com/hyperframes pinned to v0.8.43, so
infer skills install hyperframes / motion-graphics work and the skills
can be invoked as /hyperframes and /motion-graphics next to
/video-editing.

* feat: sync video-editing with the desktop's overlay cards section

Same file as inference-gateway/desktop#254: media/ layout, voice_sample
rules, the overlay track contract, the export frame size and the
HyperFrames render step.

* chore: drop the video-editing copy from the catalog

The desktop bundles and installs that skill itself, so the catalog copy
only drifted from it.

* feat: reference video-editing from the desktop repo

The body lives in inference-gateway/desktop; the catalog only points at
it, like desktop-projects.
@edenreich
edenreich marked this pull request as ready for review September 16, 2026 21:55
@edenreich
edenreich merged commit 056744c into main Sep 16, 2026
1 check passed
@edenreich
edenreich deleted the feat/overlay-cards branch September 16, 2026 23:00
@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.39.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Animated card overlays rendered from HTML (HyperFrames-style)

1 participant