Skip to content

Commit 91f811d

Browse files
committed
fix(scripts): pass rational fps to capture/render in catalog previews
`scripts/generate-catalog-previews.ts` still called `createCaptureSession` with `fps: 30` and `createRenderJob` with `fps: 24`. Since commit 5dcc89c ("feat(cli): accept ffmpeg-style rational fps") `CaptureOptions.fps` and `RenderConfig.fps` are `Fps = { num, den }` rationals — a plain number yields `options.fps.den === undefined` and: ```ts beginFrameIntervalMs: (1000 * options.fps.den) / Math.max(1, options.fps.num), // = (1000 * undefined) / Math.max(1, undefined) = NaN / NaN = NaN ``` After warmup, `session.beginFrameTimeTicks = (baseTickCount + 10) * NaN = NaN`, and the next `HeadlessExperimental.beginFrame` CDP call fails with: ``` Protocol error (HeadlessExperimental.beginFrame): Invalid parameters Failed to deserialize params.frameTimeTicks - BINDINGS: double value expected ``` This regression didn't surface earlier because the Catalog Previews workflow only re-renders items whose files changed in the PR, so existing components were never exercised against the new fps contract. The vignette addition is the first new item since the refactor. Fix: pass `{ num: 30, den: 1 }` and `{ num: 24, den: 1 }`.
1 parent 0c74f4e commit 91f811d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/generate-catalog-previews.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ async function generateThumbnail(item: CatalogItem, projectDir: string): Promise
243243
const session = await createCaptureSession(fileServer.url, framesDir, {
244244
width,
245245
height,
246-
fps: 30,
246+
fps: { num: 30, den: 1 },
247247
format: "png",
248248
});
249249
await initializeSession(session);
@@ -276,7 +276,7 @@ async function generateVideo(item: CatalogItem, projectDir: string): Promise<voi
276276

277277
const outMp4 = join(outDir, `${item.name}.mp4`);
278278
const job = createRenderJob({
279-
fps: 24,
279+
fps: { num: 24, den: 1 },
280280
quality: "draft",
281281
format: "mp4",
282282
});

0 commit comments

Comments
 (0)