fix(demo): align frame naming between capture and encoder#4782
Merged
gregpriday merged 2 commits intodevelopfrom Apr 2, 2026
Merged
fix(demo): align frame naming between capture and encoder#4782gregpriday merged 2 commits intodevelopfrom
gregpriday merged 2 commits intodevelopfrom
Conversation
- 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
4c5fa84 to
a46ab53
Compare
Collaborator
Author
|
Fixes regression from #4785. Frame naming convention changed in capture but not in encoder. Regression audit for training data. |
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
frame-000001.png(hyphen, 6-digit) while the encoder regex and ffmpeg pattern both expectedframe_0001.png(underscore, 4-digit), soencode()always threw immediately after a real capture runframe-NNNNNN.pngconsistentlyframe_0001.pngfilenames, masking the bug) and added a regression test that confirms the old underscore format is correctly rejectedResolves #4774
Changes
electron/ipc/handlers/demo.ts: updatedframePatternregex to/^frame-\d{6}\.png$/, updated ffmpeg-iinput toframe-%06d.png, updated error message textelectron/ipc/handlers/__tests__/demo.handlers.test.ts: corrected mock filenames toframe-000001.pngformat, added assertion on ffmpeg-iargument, added regression test verifying oldframe_NNNN.pngnames throwTesting
Unit tests pass with the corrected mocks. The regression test covers the previously-broken path and confirms the old format is rejected as expected.