Repository navigation
fix(studio): the thumbnail capture page loads media near the playhead like the preview - #6146
Merged
Merged
Conversation
… like the preview
miguel-heygen
force-pushed
the
fix/capture-page-loads-media-near-playhead
branch
from
October 23, 2026 16:05
3e0ae5b to
ba5b5a3
Compare
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 159 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (2)
|
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head ba5b5a3d
Only timedClipHide and compositionReadiness read the preview mark, so adding it to the capture page has no other effect. The capture page still loads every image. Once a forward seek on a reused page shows a clip at preload="none", media sync arms it and holds the seek barrier, and that is the path your 0.5 s → 20.3 s → 45.1 s md5 check runs through.
Scope / CI
- Audited: the whole diff, all readers of
STUDIO_PREVIEW_MARK_META, the thumbnail route and its page reuse (thumbnailPages.ts,studioServer.generateThumbnail),holdSeekBarrierUntilVideoLands, andscanPendingCompositionAssets. - Ran locally:
init.test.tspasses 249/249. The new preview-mark and capture-mark cases fail on the base runtime and pass on this head. I did not runpreview.test.tslocally because it needs a workspace build; CI covers it. - CI: the optional
Studio: timeline viewport gatefails on a perf-ratchet decrease (theindex.html t=3.00thumbnail is no longer requested: 14→13 renders, 15→14 requests). #6142, which does not touch the capture path, fails the same way at the same time. It is not a required check. The required checks have no failures so far; some are still running.
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 23, 2026
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The hidden page Studio uses to screenshot thumbnails and posters now loads video and audio near the playhead, as the live preview does. A 163-clip film cut from one source needs 1.35 GB and 140 threads to make its thumbnails instead of 6.2 GB and 737, and the thumbnails are byte-identical.
Why
The live preview page already defers media: only clips on screen or about to start load, the rest stay at
preload="none". The capture page (/preview?hf-capture=1, loaded by the thumbnail route) got no preview mark, so none of that applied and the runtime's eager pass setpreload="auto"on and loaded every clip. Chrome keeps one decoder per element, so a film cut into many pieces mounts them all at once.Measured on the devbox, headless Chrome, a project of 163 timed pieces cut from one 1080p source:
Whole thumbnail server (browser, renderers, node), three thumbnails at 0.5 s, 20.3 s and 45.1 s, peak:
The three PNGs have the same md5 before and after.
Related work
#4682 and #5716 added the preview's near-playhead load. #6142 is the render-side equivalent and does not touch this path.
How
One mark, one owner of "this is a Studio preview page": the page keeps
meta[name=hyperframes-studio-preview]and the capture page now carries it withcontent="capture".routes/preview.ts: the capture page gets the mark (still without lazy images, so its screenshot has every image).timedClipHide.ts:defersMedia()is true under the mark; the hidden-image skip stays off in capture mode.preloadMedia.tsandinit.tsusedefersMedia()for media, and keepskipsHiddenImages()for images.__hfWaitForSeekCompletion), so a clip that is only loaded once the seek lands on it is ready before the screenshot.Test plan
init.test.ts"loads media near the playhead" (a preview mark and a capture-mode mark hold the clips off the playhead atpreload="none"; no mark keeps today's eager load) andpreview.test.ts(the capture page carries the capture-mode mark and no lazy images). Both fail on main and pass; core runtime 2342/2342 and the preview route file 114/114, three runs in a row.tsc --noEmitclean in core and studio-server;oxfmt,oxlint, comment checks clean.