Repository navigation
Skip MJPEG frames the camera cut short - #40
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; both previous findings are fixed. SummarySkips incomplete MJPEG frames before they reach the preview or recording. Other frame formats pass unchanged.
Reviews (2) · Last reviewed commit: "Let only whole frames count as the camer..." · Reviewed by Greptile |
…full 64 bytes of padding Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #24.
The C920 delivers about 4% of its 1080p MJPEG frames incomplete. uvcvideo flags them with
V4L2_BUF_FLAG_ERROR, but Qt's V4L2 camera ignores the flag and passes them on as ordinary frames. They decode as a full-screen colour grid in the preview and in the recording. #19 made MJPEG 1080p the C920's default, so this now shows up for anyone with that camera.Monologue can't see the flag, but it can see the damage: a cut-short JPEG never reaches its end-of-image marker.
Backend::receiveVideonow skips aFormat_Jpegframe unless it starts with SOI (FF D8) and ends with EOI (FF D9), allowing up to 64 bytes of padding after it. A skipped frame doesn't reach the preview or the writer, so the recording holds the previous frame for that slot. Frames in any other format pass untouched. The check reads only the first two and last 64 bytes.On a Logi 4K Pro, whose MJPEG frames end exactly in
FF D9, takes keep the same number of frames as master.🤖 Generated with Claude Code