Skip to content

fix(producer): align frame coverage with extraction rounding#2770

Open
jrusso1020 wants to merge 1 commit into
mainfrom
fix/one-frame-video-coverage
Open

fix(producer): align frame coverage with extraction rounding#2770
jrusso1020 wants to merge 1 commit into
mainfrom
fix/one-frame-video-coverage

Conversation

@jrusso1020

Copy link
Copy Markdown
Collaborator

What

  • model expected video-frame counts using the same rounding contract as the extraction branch:
    • CFR -vf fps=<fps>: nearest output-frame boundary
    • VFR -fps_mode cfr -r <fps>: ceil
  • retain fail-closed ceil behavior when extraction metadata is missing
  • keep positive sub-frame clips at a minimum of one expected frame
  • preserve the existing 95% truncation gate and source-duration credit

Why

The coverage gate universally used ceil(duration * fps), but FFmpeg's CFR fps filter rounds to the nearest boundary. This made successfully extracted short CFR clips such as 0.616666s at 30 fps look truncated (18 captured vs 19 expected).

In the dashboard window, 124 of 335 video-coverage failures were exactly one frame short. Historical logs do not include isVFR, so that is the maximum addressable cohort rather than a guaranteed reduction. Zero-frame and materially truncated extraction failures remain fail-closed.

Safety

  • VFR still uses ceil and the existing strict coverage threshold.
  • Missing extraction metadata still uses ceil.
  • No retry, fallback, Temporal workflow, or render-plan behavior changes.
  • Intended rollout is through the producer sidecar canary with explicit internal in-process jobs before dev and production promotion.

Test

  • bunx vitest run packages/producer/src/services/render/videoFrameCoverage.test.ts (28 passed)
  • bun run --filter @hyperframes/producer typecheck
  • bunx oxlint ...videoFrameCoverage.ts ...videoFrameCoverage.test.ts
  • bunx oxfmt --check ...videoFrameCoverage.ts ...videoFrameCoverage.test.ts
  • bunx fallow audit --base origin/main --fail-on-issues
  • repository pre-commit gates

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.

1 participant