feat(core): lighter preview copies of heavy videos below full quality (#6365)

* feat(core): tell which video files deserve a lighter preview copy, and at which size

* feat(studio-server): serve lighter copies of heavy playable files, a keyframe every second

* feat(core): the preview plays lighter copies of heavy videos below full quality

* style: shorten two comments

* style: shorten a comment

* style: shorten a comment

* fix(core): format the preview quality files and split the copy sizing for the complexity gate

* style: format the studio-server preview files

* fix(core): type the copy job's level as a preview quality

* chore(producer): raise the package size budget for the preview runtime growth
This commit is contained in:
Miguel Ángel
2026-10-26 03:53:21 +00:00
committed by GitHub
parent c0ddd3228d
commit 38d9aeb5ea
19 changed files with 721 additions and 118 deletions
@@ -451,6 +451,22 @@ describe("resolveProxy", () => {
await expect(resultPromise).resolves.toBe(vp8Path);
});
it("puts a keyframe every second into a copy, so scrubbing lands close", async () => {
const { spawn, calls } = createSpawnSpy();
const { resolveProxy } = await loadModule(spawn, FFMPEG_PATH);
const projectDir = tmpProject();
const sourcePath = join(projectDir, "clip.mov");
writeFileSync(sourcePath, "source-bytes");
const result = resolveProxy(projectDir, sourcePath);
await flush();
const args = calls[0]!.args;
expect(args[args.indexOf("-force_key_frames") + 1]).toBe("expr:gte(t,n_forced*1)");
succeed(calls[0]!);
await result;
});
it("decodes a VP9 alpha source with libvpx-vp9 so the VP8 proxy keeps its alpha", async () => {
const { spawn, calls } = createSpawnSpy();
const { resolveProxy } = await loadModule(spawn, FFMPEG_PATH, false, null, "vp9");