Add libv4l-dev to support USB camera#6062
Merged
Conversation
🐳 Docker image sizes
|
📊 Test coverage report
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves USB camera support in the application runtime by ensuring the container has V4L2 userspace dependencies and that OpenCV uses an appropriate capture backend for USB cameras.
Changes:
- Add V4L2 userspace dependency installation (and video-group membership) in the runtime Docker image.
- Extend
BaseOpenCVStreamto accept an OpenCVapi_preferencebackend parameter. - Select an OS-appropriate OpenCV capture backend for
USBCameraStream.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| application/recipes.justfile | Updates install-uv version parsing/comparison logic. |
| application/docker/Dockerfile | Adds video group membership and installs libv4l package(s) for USB camera support. |
| application/backend/app/stream/usb_camera_stream.py | Chooses an OpenCV backend per OS for USB camera capture. |
| application/backend/app/stream/base_opencv_stream.py | Adds api_preference plumbing into cv2.VideoCapture(...). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
leoll2
reviewed
Apr 13, 2026
| _USB_CAMERA_BACKENDS: dict[str, int] = { | ||
| "Linux": cv2.CAP_V4L2, | ||
| "Windows": cv2.CAP_MSMF, | ||
| "Darwin": cv2.CAP_AVFOUNDATION, |
Contributor
There was a problem hiding this comment.
Did you by chance test all 3?
Contributor
Author
There was a problem hiding this comment.
I cannot test on Darwin.
leoll2
approved these changes
Apr 13, 2026
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
Adds libv4l to the docker image to support USB cameras
How to test
Checklist