mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 15:25:44 +00:00
feat: raise mp4 export bitrate for color fidelity
This commit is contained in:
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
|
||||
import { getMp4ExportBitrate, getSourceQualityBitrate } from "./exportBitrate";
|
||||
|
||||
describe("export bitrate policy", () => {
|
||||
it("keeps the legacy source-quality bitrate unchanged", () => {
|
||||
it("keeps source-quality exports at a fuller screen-recording bitrate", () => {
|
||||
expect(getSourceQualityBitrate(1920, 1080)).toBe(30_000_000);
|
||||
expect(
|
||||
getMp4ExportBitrate({
|
||||
@@ -12,7 +12,16 @@ describe("export bitrate policy", () => {
|
||||
quality: "source",
|
||||
encodingMode: "quality",
|
||||
}),
|
||||
).toBe(27_000_000);
|
||||
).toBe(30_000_000);
|
||||
expect(
|
||||
getMp4ExportBitrate({
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
frameRate: 30,
|
||||
quality: "source",
|
||||
encodingMode: "balanced",
|
||||
}),
|
||||
).toBe(22_500_000);
|
||||
});
|
||||
|
||||
it("raises high-resolution 60fps source-quality exports above the 30fps budget", () => {
|
||||
@@ -32,9 +41,9 @@ describe("export bitrate policy", () => {
|
||||
frameRate: 60,
|
||||
});
|
||||
|
||||
expect(thirtyFpsBitrate).toBe(45_000_000);
|
||||
expect(thirtyFpsBitrate).toBe(50_000_000);
|
||||
expect(sixtyFpsBitrate).toBeGreaterThan(thirtyFpsBitrate);
|
||||
expect(sixtyFpsBitrate).toBe(63_639_610);
|
||||
expect(sixtyFpsBitrate).toBe(70_710_678);
|
||||
});
|
||||
|
||||
it("keeps modern native static-layout source exports high enough for screen text", () => {
|
||||
@@ -47,7 +56,7 @@ describe("export bitrate policy", () => {
|
||||
encodingMode: "balanced",
|
||||
useModernNativeStaticLayout: true,
|
||||
}),
|
||||
).toBe(22_000_000);
|
||||
).toBe(22_500_000);
|
||||
expect(
|
||||
getMp4ExportBitrate({
|
||||
width: 1920,
|
||||
@@ -57,7 +66,7 @@ describe("export bitrate policy", () => {
|
||||
encodingMode: "quality",
|
||||
useModernNativeStaticLayout: true,
|
||||
}),
|
||||
).toBe(27_000_000);
|
||||
).toBe(30_000_000);
|
||||
});
|
||||
|
||||
it("scales modern native static-layout source exports at 60fps", () => {
|
||||
@@ -78,9 +87,9 @@ describe("export bitrate policy", () => {
|
||||
frameRate: 60,
|
||||
});
|
||||
|
||||
expect(thirtyFpsBitrate).toBe(27_000_000);
|
||||
expect(thirtyFpsBitrate).toBe(30_000_000);
|
||||
expect(sixtyFpsBitrate).toBeGreaterThan(thirtyFpsBitrate);
|
||||
expect(sixtyFpsBitrate).toBe(38_183_766);
|
||||
expect(sixtyFpsBitrate).toBe(42_426_407);
|
||||
});
|
||||
|
||||
it("does not raise fast exports when the requested bitrate is already lower than the cap", () => {
|
||||
|
||||
@@ -9,10 +9,10 @@ export function getEncodingModeBitrateMultiplier(encodingMode: ExportEncodingMod
|
||||
case "fast":
|
||||
return 0.1;
|
||||
case "quality":
|
||||
return 0.9;
|
||||
return 1;
|
||||
case "balanced":
|
||||
default:
|
||||
return 0.5;
|
||||
return 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user