mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 18:26:17 +00:00
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:
@@ -50,6 +50,15 @@ const baseSdr: StreamingEncoderOptions = {
|
||||
useGpu: false,
|
||||
};
|
||||
|
||||
const baseVp9 = {
|
||||
...baseSdr,
|
||||
codec: "vp9" as const,
|
||||
preset: "good",
|
||||
quality: 18,
|
||||
pixelFormat: "yuva420p",
|
||||
imageFormat: "png" as const,
|
||||
};
|
||||
|
||||
function getX265ParamsValue(args: string[]): string | undefined {
|
||||
const idx = args.indexOf("-x265-params");
|
||||
return idx === -1 ? undefined : args[idx + 1];
|
||||
@@ -166,6 +175,21 @@ describe("buildStreamingArgs", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("VP9 cpu-used", () => {
|
||||
it("emits the default speed/quality tradeoff for streaming WebM", () => {
|
||||
const args = buildStreamingArgs(baseVp9, "/tmp/out.webm");
|
||||
|
||||
expect(args[args.indexOf("-c:v") + 1]).toBe("libvpx-vp9");
|
||||
expect(args[args.indexOf("-cpu-used") + 1]).toBe("4");
|
||||
});
|
||||
|
||||
it("honors the resolved engine override for streaming WebM", () => {
|
||||
const args = buildStreamingArgs({ ...baseVp9, vp9CpuUsed: 2 }, "/tmp/out.webm");
|
||||
|
||||
expect(args[args.indexOf("-cpu-used") + 1]).toBe("2");
|
||||
});
|
||||
});
|
||||
|
||||
describe("fps rational forwarding", () => {
|
||||
// Regression for the fps fraction-syntax feature: both `-framerate`
|
||||
// (input timestamping) and `-r` (output framerate) must carry the
|
||||
|
||||
Reference in New Issue
Block a user