Skip to content

fix(demo): align frame naming between capture and encoder#4782

Merged
gregpriday merged 2 commits intodevelopfrom
bugfix/issue-4774-fix-frame-naming-mismatch-demo
Apr 2, 2026
Merged

fix(demo): align frame naming between capture and encoder#4782
gregpriday merged 2 commits intodevelopfrom
bugfix/issue-4774-fix-frame-naming-mismatch-demo

Conversation

@gregpriday
Copy link
Copy Markdown
Collaborator

Summary

  • The capture pipeline wrote frames as frame-000001.png (hyphen, 6-digit) while the encoder regex and ffmpeg pattern both expected frame_0001.png (underscore, 4-digit), so encode() always threw immediately after a real capture run
  • Updated the encoder regex, ffmpeg input pattern, and the "no frames found" error message to all use frame-NNNNNN.png consistently
  • Fixed the unit test mock (was returning frame_0001.png filenames, masking the bug) and added a regression test that confirms the old underscore format is correctly rejected

Resolves #4774

Changes

  • electron/ipc/handlers/demo.ts: updated framePattern regex to /^frame-\d{6}\.png$/, updated ffmpeg -i input to frame-%06d.png, updated error message text
  • electron/ipc/handlers/__tests__/demo.handlers.test.ts: corrected mock filenames to frame-000001.png format, added assertion on ffmpeg -i argument, added regression test verifying old frame_NNNN.png names throw

Testing

Unit tests pass with the corrected mocks. The regression test covers the previously-broken path and confirms the old format is rejected as expected.

- Update framePattern regex from frame_NNNN to frame-NNNNNN format
- Update ffmpeg input pattern from frame_%04d.png to frame-%06d.png
- Update error message to reflect correct frame naming convention
- Fix test mock to return capture-format filenames
- Add ffmpeg -i argument assertion to spawn test
- Verify encoder rejects frame_NNNN.png files that no longer match the pattern
@gregpriday gregpriday force-pushed the bugfix/issue-4774-fix-frame-naming-mismatch-demo branch from 4c5fa84 to a46ab53 Compare April 2, 2026 04:25
@gregpriday gregpriday merged commit 6004550 into develop Apr 2, 2026
2 checks passed
@gregpriday gregpriday deleted the bugfix/issue-4774-fix-frame-naming-mismatch-demo branch April 2, 2026 04:26
@gregpriday
Copy link
Copy Markdown
Collaborator Author

gregpriday commented Apr 7, 2026

Fixes regression from #4785. Frame naming convention changed in capture but not in encoder.

Regression audit for training data.

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.

Fix frame naming mismatch in demo capture pipeline

1 participant