mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 23:29:50 +00:00
fix(cli): align video output boundaries (#2490)
* fix(cli): align video output boundaries * test(cli): honor CI ffmpeg fixture path * test(cli): decouple duration precedence from ffmpeg * test(cli): pin half-open video boundaries * test(producer): refresh style 7 boundary golden
This commit is contained in:
@@ -4,7 +4,11 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync
|
||||
import { tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { applyResolutionPreset, injectTailwindBrowserScript } from "./init.js";
|
||||
import {
|
||||
applyResolutionPreset,
|
||||
injectTailwindBrowserScript,
|
||||
resolveVideoDurationSeconds,
|
||||
} from "./init.js";
|
||||
|
||||
const cliEntry = resolve(fileURLToPath(import.meta.url), "..", "..", "cli.ts");
|
||||
const tailwindScript =
|
||||
@@ -177,6 +181,26 @@ describe("hyperframes init flag rename", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("uses the video stream duration when audio outlasts the final video frame", () => {
|
||||
expect(
|
||||
resolveVideoDurationSeconds({
|
||||
streamDuration: 1,
|
||||
frameDuration: 1,
|
||||
formatDuration: 1.2,
|
||||
}),
|
||||
).toBe(1);
|
||||
});
|
||||
|
||||
it("falls through unusable stream durations before using the container duration", () => {
|
||||
expect(
|
||||
resolveVideoDurationSeconds({
|
||||
streamDuration: 0,
|
||||
frameDuration: Number.NaN,
|
||||
formatDuration: 1.2,
|
||||
}),
|
||||
).toBe(1.2);
|
||||
});
|
||||
|
||||
it("--audio with a missing file fails without creating the project directory", () => {
|
||||
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
|
||||
const target = join(dir, "proj");
|
||||
|
||||
Reference in New Issue
Block a user