Skip to content

Fix V4L2 camera capture on Jetson Thor - #1357

Merged
farbod-nv merged 4 commits into
mainfrom
fix/6954253
Oct 30, 2026
Merged

farbod-nv merged 4 commits into
mainfrom
fix/6954253

Conversation

@farbod-nv

@farbod-nv farbod-nv commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

OpenCV 5.0.0 ARM64 wheels lack V4L2 support, causing USB cameras to show a black screen while capture retries indefinitely.

Constrain the camera example’s OpenCV dependencies to <5 and validate V4L2 availability during setup and before capture initialization. Missing backend support now produces an actionable error; disconnected cameras retain normal reconnect behavior.

Summary by CodeRabbit

  • Bug Fixes
    • Camera setup now checks that the V4L2 capture backend is available when V4L2 is enabled and reports an error if it is not.
    • V4L2 and video features now require OpenCV versions from 4.5 up to, but not including, 5. Installation guidance reflects this version range.

Keep OpenCV dependencies below 5 to avoid aarch64 wheels without V4L2. Validate backend availability during setup and before allocating capture resources, with an actionable error instead of indefinite reconnects. Preserve retries for disconnected cameras.

Fixes NVIDIA bug 6954253.

Signed-off-by: Farbod Motlagh <fmotlagh@nvidia.com>
Signed-off-by: Farbod Motlagh <fmotlagh@nvidia.com>
Signed-off-by: Farbod Motlagh <fmotlagh@nvidia.com>
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 23ee7ff and a074401.

Files selected for processing: 7
  • examples/camera_viz/pyproject.toml
  • examples/camera_viz/scripts/_install_deps.sh
  • examples/camera_viz/sources/_v4l2_backend.py
  • examples/camera_viz/sources/v4l2.py
  • examples/camera_viz/sources/video_file.py
  • tests/python/examples/camera_viz/pyproject.toml
  • tests/python/examples/camera_viz/test_v4l2_source.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Walkthrough

The camera visualization example now constrains OpenCV to versions from 4.5 up to, but not including, 5. A new check reports whether OpenCV has V4L2 support. Setup runs this check when V4L2 is enabled. V4l2Source loads the checked backend during initialization. Tests cover setup outcomes, backend availability, and camera capture lifecycle behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant install_deps
  participant v4l2_backend as _v4l2_backend.py
  participant cv2
  install_deps->>v4l2_backend: Run backend check
  v4l2_backend->>cv2: Import OpenCV and check V4L2 availability
  cv2-->>v4l2_backend: Return availability result
  v4l2_backend-->>install_deps: Return check status
Loading
Merge Risk: Minimal · previous review a0744

The V4L2 dependency and availability checks appear ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: fixing V4L2 camera capture on Jetson Thor. It matches the pull request objectives and changes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 5 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Farbod Motlagh <fmotlagh@nvidia.com>
@farbod-nv
farbod-nv enabled auto-merge (squash) October 30, 2026 21:21
@farbod-nv
farbod-nv merged commit 92e1e0e into main Oct 30, 2026
38 checks passed
@farbod-nv
farbod-nv deleted the fix/6954253 branch October 30, 2026 21:54

This branch was successfully deployed

1 active deployment
dev — e4b874c8 Deployed Oct 30, 2026 by farbod-nv via publish-wheel #6341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants