fix(engine): tune VP9 cpu-used across render paths (#1614)

* fix(engine): tune VP9 cpu-used across render paths

* fix: address VP9 review feedback
This commit is contained in:
Miguel Ángel
2026-06-20 16:36:59 -04:00
committed by GitHub
parent d6135ca155
commit 8408a44745
30 changed files with 273 additions and 26 deletions
@@ -509,6 +509,7 @@ describe("plan() — codec knob", () => {
) as Record<string, unknown>;
expect(encoder.encoder).toBe("libx264-software");
expect(encoder.pixelFormat).toBe("yuv420p");
expect(encoder).not.toHaveProperty("vp9CpuUsed");
},
TIMEOUT_MS,
);
@@ -706,6 +707,32 @@ describe("plan() — webm format (distributed VP9)", () => {
// keyframe with no alt-ref references reaching back across seams.
expect(encoder.closedGop).toBe(true);
expect(encoder.gopSize).toBe(encoder.chunkSize);
expect(encoder.vp9CpuUsed).toBe(4);
},
TIMEOUT_MS,
);
it(
"locks the resolved VP9 cpu-used value into encoder metadata",
async () => {
const planDir = join(runRoot, "plan-webm-vp9-cpu-used");
mkdirSync(planDir, { recursive: true });
await plan(
projectDir,
{
fps: 30,
width: 320,
height: 240,
format: "webm",
producerConfig: { vp9CpuUsed: 2 },
},
planDir,
);
const encoder = JSON.parse(
readFileSync(join(planDir, "meta", "encoder.json"), "utf-8"),
) as Record<string, unknown>;
expect(encoder.vp9CpuUsed).toBe(2);
},
TIMEOUT_MS,
);