Skip to content

fix(producer): accept plain integer fps in createRenderJob#1034

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/retrocompat-fps-input
May 22, 2026
Merged

fix(producer): accept plain integer fps in createRenderJob#1034
miguel-heygen merged 1 commit into
mainfrom
fix/retrocompat-fps-input

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

Summary

  • Adds FpsInput = number | Fps type and toFps() normalizer to @hyperframes/core
  • createRenderJob now accepts both fps: 30 and fps: { num: 30, den: 1 } — plain integers are promoted to { num, den: 1 } at the boundary; RenderConfig.fps stays strict Fps internally
  • Fixes producer docs: removed phantom input/output fields, fixed executeRenderJob signature (was missing projectDir/outputPath args), updated format list
  • Fixes engine docs: corrected fps examples to use the { num, den } form the engine APIs require

Context

The rational Fps refactor in 5dcc89c changed RenderConfig.fps from number to { num, den } but never updated the docs or added input coercion. External callers (like #1031) passing fps: 30 got undefined/undefined as the FFmpeg framerate — a cryptic error.

Test plan

  • bun run build — all packages pass
  • bun run --filter @hyperframes/core test — 984 tests pass
  • bun run --filter @hyperframes/engine test — 612 tests pass
  • Verified createRenderJob({ fps: 30 }) normalizes to { num: 30, den: 1 } at runtime
  • Verified createRenderJob({ fps: { num: 30000, den: 1001 } }) passes through unchanged

Closes #1031

The rational `Fps = { num, den }` refactor in 5dcc89c broke callers
passing `fps: 30` (the form documented in every code example and used
by external consumers). FFmpeg received `undefined/undefined` as the
framerate, causing a cryptic exit-code error.

Add `FpsInput = number | Fps` and `toFps()` normalizer in
@hyperframes/core. `createRenderJob` now accepts both forms —
plain integers are promoted to `{ num, den: 1 }` at the boundary;
`RenderConfig.fps` stays strict `Fps` internally so no downstream
code changes.

Also fixes the producer and engine docs, which showed phantom
`input`/`output` fields on `createRenderJob` and a wrong
`executeRenderJob(job)` signature (missing `projectDir`/`outputPath`
args).

Closes #1031
@miguel-heygen miguel-heygen merged commit c11f715 into main May 22, 2026
26 of 27 checks passed
@miguel-heygen miguel-heygen deleted the fix/retrocompat-fps-input branch May 22, 2026 17:36
@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 22, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hyperframes 🔴 Failed May 22, 2026, 5:46 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@hyperframes/producer err

1 participant