justadudewhohacks / justadudewhohacks/opencv4nodejs

Help needed - Get valid camera indexes

Open
#731 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

I am looking for a way to get valid camera indexes for usage with `VideoCapture`. I am using Raspberry Pi 4 with 2 USB webcams, currently I can open them using `new cv.VideoCapture(0)` and `new cv.VideoCapture(2)`.

There's a gap between the indexes and if I try `new cv.VideoCapture(1)` I get an error, so iterating through indexes until an error is thrown may not be the best approach.

Is there a method of determining which indexes are valid?

*OpenCV* version 3.4.6
*OS*: Raspberry Pi OS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.