OpenCV cannot find camera device in wsl2
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
I run opencv python file to open camera in wsl2 ubuntu. But it cannot open camera device first.
Then, i changed the code from
cap = cv2.VideoCapture(0)
to
cap = cv2.VideoCapture(-1)
Still facing issue the message show cannot find camera device.
So, I think wsl2 ubuntu doesn't support webcam access.
Not sure it is a bug or feature for wsl2 ubuntu.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in WSL2 Ubuntu with the OpenCV Python calls shown in the report: cv2.VideoCapture(0) and cv2.VideoCapture(-1). Investigate whether WSL2 exposes webcam devices and whether this is an unsupported capability or an implementation gap. Done means establishing the supported behavior and, if feasible, adding webcam access or documenting the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- opencv, python, ubuntu
- Domain
- computer-vision, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100