fix(engine): flag single-keyframe videos as sparse instead of skipping them - #3762
Open
Abhishek-kumarsingh wants to merge 1 commit into
Open
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3460.
analyzeKeyframeIntervalsreturnedisProblematic: falsewhenever 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
packages/engine/src/utils/ffprobe.test.tscovering: 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@hyperframes/enginesuite passes (1641/1641)oxlintandoxfmt --checkclean on changed filesNote: 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.