mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +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:
@@ -45,6 +45,7 @@ describe("background-removal/pipeline — buildEncoderArgs", () => {
|
||||
const args = buildEncoderArgs("webm", 1920, 1080, 30, "/tmp/out.webm");
|
||||
expect(args).toContain("libvpx-vp9");
|
||||
expect(args).toContain("yuva420p");
|
||||
expect(args[args.indexOf("-cpu-used") + 1]).toBe("4");
|
||||
// The alpha_mode metadata must be present; without it Chrome ignores the alpha plane.
|
||||
const idx = args.indexOf("-metadata:s:v:0");
|
||||
expect(idx).toBeGreaterThan(-1);
|
||||
|
||||
@@ -18,6 +18,7 @@ import { extname } from "node:path";
|
||||
import { findFFmpeg, findFFprobe, getFFmpegInstallHint } from "../browser/ffmpeg.js";
|
||||
import { createSession, type Session } from "./inference.js";
|
||||
import { type Device, type ModelId } from "./manager.js";
|
||||
import { DEFAULT_VP9_CPU_USED } from "@hyperframes/engine";
|
||||
|
||||
export type OutputFormat = "webm" | "mov" | "png";
|
||||
|
||||
@@ -159,6 +160,8 @@ export function buildEncoderArgs(
|
||||
"good",
|
||||
"-row-mt",
|
||||
"1",
|
||||
"-cpu-used",
|
||||
String(DEFAULT_VP9_CPU_USED),
|
||||
"-auto-alt-ref",
|
||||
"0",
|
||||
"-pix_fmt",
|
||||
|
||||
Reference in New Issue
Block a user