Skip to content

Commit 44216e1

Browse files
committed
test(engine): cut the comments the frame extractor test split carried over
1 parent 338b3fe commit 44216e1

4 files changed

Lines changed: 4 additions & 42 deletions

File tree

‎packages/engine/src/services/videoFrameExtractor.format.test.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ vi.mock("../utils/runFfmpeg.js", async (importOriginal) => {
1717
return { ...real, runFfmpeg: vi.fn(real.runFfmpeg) };
1818
});
1919

20-
// ffmpeg is not preinstalled on GitHub's ubuntu-24.04 runners. The producer
21-
// regression test at packages/producer/tests/vfr-screen-recording/ runs inside
22-
// Dockerfile.test (which does include ffmpeg) and is the primary CI signal
23-
// for this bug. Locally and in any CI job with ffmpeg on PATH, the tests
24-
// below run too — they exercise the extractor in isolation against a
25-
// synthesized VFR fixture.
2620
const HAS_FFMPEG = spawnSync("ffmpeg", ["-version"]).status === 0;
2721
const FFMPEG_ENCODERS = HAS_FFMPEG
2822
? spawnSync("ffmpeg", ["-hide_banner", "-encoders"]).stdout.toString()

‎packages/engine/src/services/videoFrameExtractor.hdr.test.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ vi.mock("../utils/runFfmpeg.js", async (importOriginal) => {
1919
return { ...real, runFfmpeg: vi.fn(real.runFfmpeg) };
2020
});
2121

22-
// ffmpeg is not preinstalled on GitHub's ubuntu-24.04 runners. The producer
23-
// regression test at packages/producer/tests/vfr-screen-recording/ runs inside
24-
// Dockerfile.test (which does include ffmpeg) and is the primary CI signal
25-
// for this bug. Locally and in any CI job with ffmpeg on PATH, the tests
26-
// below run too — they exercise the extractor in isolation against a
27-
// synthesized VFR fixture.
2822
const HAS_FFMPEG = spawnSync("ffmpeg", ["-version"]).status === 0;
2923
const HAS_ZSCALE =
3024
HAS_FFMPEG &&

‎packages/engine/src/services/videoFrameExtractor.sampling.test.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ vi.mock("../utils/runFfmpeg.js", async (importOriginal) => {
1717
return { ...real, runFfmpeg: vi.fn(real.runFfmpeg) };
1818
});
1919

20-
// ffmpeg is not preinstalled on GitHub's ubuntu-24.04 runners. The producer
21-
// regression test at packages/producer/tests/vfr-screen-recording/ runs inside
22-
// Dockerfile.test (which does include ffmpeg) and is the primary CI signal
23-
// for this bug. Locally and in any CI job with ffmpeg on PATH, the tests
24-
// below run too — they exercise the extractor in isolation against a
25-
// synthesized VFR fixture.
2620
const HAS_FFMPEG = spawnSync("ffmpeg", ["-version"]).status === 0;
2721

2822
// Each output slot shows the frame on screen at its time, as the preview does.

‎packages/engine/src/services/videoFrameExtractor.vfr.test.ts‎

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,17 @@ vi.mock("../utils/runFfmpeg.js", async (importOriginal) => {
3232
return { ...real, runFfmpeg: vi.fn(real.runFfmpeg) };
3333
});
3434

35-
// ffmpeg is not preinstalled on GitHub's ubuntu-24.04 runners. The producer
36-
// regression test at packages/producer/tests/vfr-screen-recording/ runs inside
37-
// Dockerfile.test (which does include ffmpeg) and is the primary CI signal
38-
// for this bug. Locally and in any CI job with ffmpeg on PATH, the tests
39-
// below run too — they exercise the extractor in isolation against a
40-
// synthesized VFR fixture.
4135
const HAS_FFMPEG = spawnSync("ffmpeg", ["-version"]).status === 0;
4236

43-
// Regression test for the VFR (variable frame rate) freeze bug.
44-
// Screen recordings and phone videos often have irregular timestamps.
45-
// When such inputs hit `extractVideoFramesRange`'s `-ss <start> -i ... -t <dur>
46-
// -vf fps=N` pipeline, the fps filter can emit fewer frames than requested —
47-
// e.g. a 4-second segment at 30fps would produce ~90 frames instead of 120.
48-
// FrameLookupTable.getFrameAtTime then returns null for out-of-range indices
49-
// and the compositor holds the last valid frame, which the user perceives as
50-
// the video freezing. extractAllVideoFrames now routes VFR sources through
51-
// FFmpeg's one-pass `-fps_mode cfr -r` extraction path to fix this without a
52-
// separate normalization encode.
37+
// Irregular timestamps once made the fps filter emit too few frames, so the video froze;
38+
// VFR sources now extract through one `-fps_mode cfr -r` pass.
5339
describe.skipIf(!HAS_FFMPEG)("extractAllVideoFrames on a VFR source", () => {
5440
const FIXTURE_DIR = mkdtempSync(join(tmpdir(), "hf-vfr-test-"));
5541
const VFR_FIXTURE = join(FIXTURE_DIR, "vfr_screen.mp4");
5642

5743
beforeAll(async () => {
58-
// 10s testsrc2 at 60fps, ~40% of frames dropped via select filter and
59-
// encoded with -fps_mode vfr so timestamps are irregular. Declared fps 60,
60-
// actual average ~36 — well over the 10% threshold used by isVFR.
61-
// The select expression drops four 1-second windows (frames 30-89,
62-
// 180-239, 330-389, 480-539) to simulate static segments in a screen
63-
// recording where no pixels changed.
64-
// -g/-keyint_min 600 forces a single keyframe so mid-segment seeks in the
65-
// mediaStart=3 test don't snap to an intermediate IDR and drift the count.
44+
// 10 s at 60 fps minus frames 30-89, 180-239, 330-389, 480-539: about 36 fps on average, past
45+
// isVFR's 10% threshold. One keyframe (-g 600) so the mediaStart=3 seek cannot snap to an IDR.
6646
const result = await runFfmpeg([
6747
"-y",
6848
"-hide_banner",

0 commit comments

Comments
 (0)