Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Updates webcam capture negotiation to prefer MJPEG when the selected resolution supports 30 fps.
Changes:
- Parses V4L2 capabilities for matching MJPEG modes.
- Adds MJPEG and fallback negotiation tests.
- Preserves automatic format selection when probing fails.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-capture-screenrecording |
Adds MJPEG capability negotiation. |
test/shell.d/screenrecording-test.sh |
Tests supported modes and fallbacks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Tested this branch's negotiation logic on real hardware and it fixes the problem. Lenovo Performance Camera (uvcvideo) on 4.0.0.r1849. Same shape as the issue: MJPG offers 1280x720 at 30fps, YUYV caps 720p at 10fps, and this camera has no 640x360 mode at all, so the resolution loop lands on 1280x720. Checked with Also ran a full recording with the patched negotiation. The overlay is smooth and the output is clean 60fps CFR with audio in sync. One note on the parser: the tests stub v4l2-ctl output with space indentation, but I ran the awk against the real tab-indented output from this camera and it matched fine. |
|
Hardware data point from an iMac18,3 (FaceTime HD camera, It shows in the recording too: with the 10 fps YUYV overlay up, gpu-screen-recorder dropped to 55 fps here, so the video played back fast ( I haven't run this branch itself yet; happy to, if a hardware check helps it land. (#9306 covers the same ground.) |
Both this branch and omacom#8374 appended tests to the end of screenrecording-test.sh. The resolution keeps both blocks, quattro's first and this branch's webcam negotiation tests after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed by Claude Opus 5.5. The configured second opinion (Codex Medium) did not run on this pull request: it answered a ping, but its daily review budget was already spent, so this review is one model's reading. Merged What was checked, on a disposable Omarchy VM:
The change is proportionate: one parser and one extra option, leaving autodetection alone whenever MJPEG cannot do 30 fps at the chosen size or probing returns nothing. Nothing wrong was found. What it waits on. This is a hardware fix, and a stubbed Related: #13373 addresses a different cause of a slow webcam (the auto-exposure priority control stretching frames in dim light) and complements this rather than competing with it. #9306 made the same change and was closed as a duplicate of this one. |
|
|
@btsouth @ahmadtv thanks again for the earlier hardware checks, they were really useful. omarchybot merged Adjust |
|
The second opinion that could not run on the last review has now run. Codex Medium reviewed the head, ec6e6cf, against It raised two points that are not defects but are worth knowing before this merges:
What it waits on. Confirmation on a real camera at ec6e6cf, as described in the review above. Re-runs from @btsouth and @ahmadtv at this head are welcome and help the maintainer decide. But #7300 was opened by this pull request's author, so the confirmation that lets it be marked verified has to come from a maintainer. |
|
Re-ran the check at ec6e6cf on two machines. Desktop: Logitech C920 ( The recording is 60 fps CFR, and the overlay stopped cleanly. Streamed directly in that mode, the camera delivers 30.0 fps. Laptop: Dell Inspiron 3501, integrated Microdia camera ( It works as described on both. One caveat for whoever marks this verified: both cameras list 640x360, so the loop stops there, and neither one exercises the #7300 case (no 360p mode, so 720p is chosen). @btsouth's Lenovo has that shape. On the second review's point about cameras that already do 30 fps raw: both of these do (YUYV 640x360 at 30), so here the change is YUYV 360p → MJPG 360p at the same size. Overlay mpv CPU, one 30 s round each: stock (YUYV) 3.9% vs this head (MJPG) 5.8% on the desktop (i7-7700), and 3.8% vs 4.3% on the laptop (i5-1135G7). If that's worth avoiding, Tested with Claude Code; I checked the results on both machines myself. |
|
Reviewed by Claude Opus 5.5, with Codex Medium as the second opinion. The head is still ec6e6cf, so the worker results and reviews above still stand. This pass read @phil-bowens's report. Both cameras ran MJPG 640x360 at 30 fps at this head, as expected. Both reviewers read it the same way: this is good evidence that the change does no harm on common cameras, but it does not exercise #7300. Both cameras list 640x360, so the resolution loop stops there. #7300's case is a camera with no 640x360 mode, where 1280x720 is chosen and its raw mode drops to 5-10 fps. The confirmation that lets this be marked verified also has to come from a maintainer, since #7300 was opened by this pull request's author. Neither of those is a fault in the report. The commit on What it waits on. A maintainer's check at ec6e6cf, ideally on a camera without a 640x360 mode, using the commands in the first review above, and a decision on the raw-first follow-up. |
Fixes #7300
Summary
Test plan
bash -n bin/omarchy-capture-screenrecording test/shell.d/screenrecording-test.shgit diff --checkbash test/shell.d/screenrecording-test.sh(30 consecutive runs)./test/allreached and passed the screen-recording tests. Seven unrelated test files failed because this checkout lacks external fixtures/services or cannot write to system/user paths in the restricted environment.