Skip to content

fix(producer): make sparse keyframe advice conditional - #5343

Open
user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/sparse-keyframe-warning
Open

user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/sparse-keyframe-warning

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

What

Make the sparse-keyframe warning explain that long GOPs can slow preview seeking, with re-encoding advice conditional on observed slow seeking.

Why

The warning currently states that sparse keyframes cause seek failures and frame freezing, even when FFmpeg extracts the requested frames correctly. A real 10-second, single-keyframe clip extracted at eight seconds produces all 30 requested frames, with the first frame matching independent FFmpeg frame-240 output pixel for pixel.

Related work

Refs #3460, specifically the maintainer's diagnostic wording follow-up. #3998 already covers single-keyframe classification using video-stream duration. #3573 and #3762 were closed while the warning's scope remained open. No open PR currently covers this diagnostic.

How

Update the compiler warning and its threshold comment to describe an advisory seeking cost. Keep the existing interval calculation and re-encoding command. Add compiler integration tests using FFmpeg-generated media for the conditional warning and for a one-second video with a ten-second audio track, which should remain below the warning threshold.

Test plan

  • Automated tests: 6 compiler media/probe tests, 147 compiler tests, and 133 FFprobe tests passed. The new warning regression fails against main's categorical warning.
  • Manual testing: single-GOP and five-second-GOP clips warn; a short video with longer audio does not. Mid-GOP extraction matches independent frame-240 ground truth. The built CLI renders 30 PNG frames successfully; all three fixture compositions pass lint and browser checks.
  • Engine, producer, and CLI builds; engine and producer type checks; root lint; formatting; producer test classification; test reachability; comment checks; and normal commit hooks passed.
  • Comments explain the advisory threshold and the limit of what GOP length establishes.
  • Documentation: no documentation change is required for this diagnostic.

This branch has not been deployed

No deployments
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