Repository navigation
perf: inline html5 images at the size a scaled bake draws them - #268
Merged
Merged
Conversation
|
🎉 This PR is included in version 2.29.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
A scaled bake inlined ingest images sized for the clip's full output, and every frame's SVG decodes its inlined images again. A 1080p clip baked at half size asked for the 2048 rendition, which ingest doesn't make for a source under 2048 px, so it fell back to the original. In the edit below, that put a 747 KB JPEG into every frame when the 163 KB 1024 rendition was enough.
The bake now passes its scale to the inliner. Stills keep full-size images, because exports read them.
Measured on an edit with 15 html5 clips (4,515 frames at 30 fps), six of which share one photo, in headless desktop Chrome with the GPU. The time from opening the edit until playback is ready went from 117 s to 95 s.
Verify:
npx jest tests/html5-player.test.ts -t "inlines ingest files sized". Then open an html5 clip whose CSS uses an ingested image, in a preview smaller than the output. The bake should fetchhtml5-1024.webp, notsource.*.Risk: low. An image drawn larger than its clip (a zoomed background) is as soft relative to the frame as a full-size bake already makes it.