Skip to content

fix(engine): flag single-keyframe videos as sparse instead of skipping them - #3762

Open
Abhishek-kumarsingh wants to merge 1 commit into
heygen-com:mainfrom
Abhishek-kumarsingh:fix/single-keyframe-sparse-check
Open

fix(engine): flag single-keyframe videos as sparse instead of skipping them#3762
Abhishek-kumarsingh wants to merge 1 commit into
heygen-com:mainfrom
Abhishek-kumarsingh:fix/single-keyframe-sparse-check

Conversation

@Abhishek-kumarsingh

Copy link
Copy Markdown

Summary

Fixes #3460. analyzeKeyframeIntervals returned isProblematic: false whenever a video had fewer than two keyframes, treating a single-GOP video the same as a still image. But a video with exactly one keyframe is the worst case for the failure mode the check exists to catch: every seek past 0 lands inside a single GOP spanning the whole file. A 10s single-GOP video went unreported while a video with a 5s max interval triggered the warning.

Fix

When exactly one keyframe is found, the effective interval is now the stream duration (fetched via the already-available extractMediaMetadata), not zero — matching the fix suggested in the issue. Still images and single-frame assets keep their current (non-problematic) behavior, since their duration is at or below the 2s threshold. Zero-keyframe handling is unchanged.

Test plan

  • Added regression tests to packages/engine/src/utils/ffprobe.test.ts covering: a long-duration single keyframe (now flagged problematic), a short single keyframe (still not flagged), and zero keyframes (unchanged, not flagged) — confirmed the long-duration case failed before the fix
  • Full @hyperframes/engine suite passes (1641/1641)
  • oxlint and oxfmt --check clean on changed files

Note: the issue also raises a "side note" about whether the warning targets render's decode path at all, based on the reporter's own frame-accuracy measurements — that's a separate scoping question I've left alone; this PR only fixes the single-keyframe detection gap.

…g them

analyzeKeyframeIntervals bailed out with isProblematic: false whenever a
video had fewer than two keyframes, treating a single-GOP video the same
as a still image. But one keyframe is the worst case for the failure mode
the check exists to catch: every seek past 0 lands inside a single GOP
spanning the whole file. A 10s single-GOP video went unreported while a
5s-interval video triggered the warning.

When exactly one keyframe is found, the effective interval is now the
stream duration (via extractMediaMetadata), not zero. Still images and
single-frame assets keep their current behaviour since their duration is
at or below the 2s threshold.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQXJUdfkq6CGWh6KNfVXyw
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.

Sparse-keyframe check silently skips single-keyframe videos — the worst case goes unreported (0.8.10)

1 participant