@@ -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.
4135const 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.
5339describe . 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