perf(engine): encode high quality with the x264 fast preset (#6640)

* perf(engine): encode high quality with the x264 fast preset

* test(engine): name the NVENC p5 case by its preset, not the high tier
This commit is contained in:
Miguel Ángel
2026-10-29 06:40:21 +00:00
committed by GitHub
parent 17f5d67643
commit be05c86932
3 changed files with 5 additions and 5 deletions
@@ -130,8 +130,8 @@ describe("ENCODER_PRESETS", () => {
expect(ENCODER_PRESETS.draft.codec).toBe("h264");
});
it("high uses slow preset with low CRF for better quality", () => {
expect(ENCODER_PRESETS.high.preset).toBe("slow");
it("high uses the fast preset with low CRF for better quality", () => {
expect(ENCODER_PRESETS.high.preset).toBe("fast");
expect(ENCODER_PRESETS.high.quality).toBeLessThan(ENCODER_PRESETS.standard.quality);
expect(ENCODER_PRESETS.high.codec).toBe("h264");
});
@@ -1071,7 +1071,7 @@ describe("buildEncoderArgs GPU preset mapping", () => {
expect(presetArg(args)).toBe("p4");
});
it("translates the high slow preset to NVENC p5", () => {
it("translates the slow preset to NVENC p5", () => {
const args = buildEncoderArgs(
{ ...baseOptions, codec: "h264", preset: "slow", quality: 15, useGpu: true },
inputArgs,
+1 -1
View File
@@ -55,7 +55,7 @@ export type { EncoderOptions, EncodeResult, MuxResult } from "./chunkEncoder.typ
export const ENCODER_PRESETS = {
draft: { preset: "ultrafast", quality: 28, codec: "h264" as const },
standard: { preset: "medium", quality: 18, codec: "h264" as const },
high: { preset: "slow", quality: 15, codec: "h264" as const },
high: { preset: "fast", quality: 15, codec: "h264" as const },
};
export interface EncoderPreset {
@@ -684,7 +684,7 @@ describe("assemble()", () => {
it("cfr re-encode keeps the chunks' rate control", () => {
expect(cfrRateControlArgs({})).toEqual(["-preset", "medium", "-crf", "18"]);
expect(cfrRateControlArgs({ quality: "high" })).toEqual(["-preset", "slow", "-crf", "15"]);
expect(cfrRateControlArgs({ quality: "high" })).toEqual(["-preset", "fast", "-crf", "15"]);
expect(cfrRateControlArgs({ quality: "standard", crf: 12 })).toEqual([
"-preset",
"medium",