Skip to content

Add libv4l-dev to support USB camera#6062

Merged
A-Artemis merged 3 commits intodevelopfrom
aurelien/usb-camera
Apr 14, 2026
Merged

Add libv4l-dev to support USB camera#6062
A-Artemis merged 3 commits intodevelopfrom
aurelien/usb-camera

Conversation

@A-Artemis
Copy link
Copy Markdown
Contributor

@A-Artemis A-Artemis commented Apr 9, 2026

Summary

Adds libv4l to the docker image to support USB cameras

How to test

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

@A-Artemis A-Artemis self-assigned this Apr 9, 2026
@A-Artemis A-Artemis linked an issue Apr 9, 2026 that may be closed by this pull request
@github-actions github-actions Bot added BUILD Geti Backend Issues related to the Geti application server labels Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

🐳 Docker image sizes

Device Size
cpu 3593.9 MB (3.51 GB)
cuda 11714.8 MB (11.44 GB)
xpu 10562.5 MB (10.31 GB)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

📊 Test coverage report

Metric Coverage
Lines 56.2%
Functions 78.2%
Branches 87.4%
Statements 56.2%

@A-Artemis A-Artemis marked this pull request as ready for review April 13, 2026 07:34
Copilot AI review requested due to automatic review settings April 13, 2026 07:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BaseOpenCVStream to accept an OpenCV api_preference backend 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.

Comment thread application/recipes.justfile
Comment thread application/docker/Dockerfile Outdated
_USB_CAMERA_BACKENDS: dict[str, int] = {
"Linux": cv2.CAP_V4L2,
"Windows": cv2.CAP_MSMF,
"Darwin": cv2.CAP_AVFOUNDATION,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you by chance test all 3?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot test on Darwin.

Comment thread application/recipes.justfile
Comment thread application/docker/Dockerfile Outdated
@A-Artemis A-Artemis added this pull request to the merge queue Apr 14, 2026
Merged via the queue into develop with commit 47ea3ab Apr 14, 2026
35 checks passed
@A-Artemis A-Artemis deleted the aurelien/usb-camera branch April 14, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BUILD Geti Backend Issues related to the Geti application server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot connect to USB camera

3 participants