Ask Your Question
0

Is there a way to select a specific web cam from USB hub on a Mac or Windows?

asked 2020-11-19 15:22:58 -0600

exnx gravatar image

Hi,

I am using a USB hub splitter for 2 webcams. I am also using other USB ports for other devices.

Right now, I use just an integer value when using VideoCapture(cam_num), but the cam_num integer value changes, and sometimes it's the cam (included) inside my laptop. Not good! I need a way to find a camera specifically and use it.

I see there's a way to select the camera on a linux machine, but is there a way to select a specific cam on a Mac or Windows? Thanks for the help!

Eric

edit retag flag offensive close merge delete

Comments

Check to see number of camera $ls /dev/video*

supra56 gravatar imagesupra56 ( 2020-11-20 06:53:29 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
-1

answered 2020-11-19 20:13:19 -0600

crackwitz gravatar image

probably not. what you can pass for a camera identifier highly depends on the backend (apiPreference parameter). OpenCV docs contains a list of all the backends and some documentation on what each can handle. you can inspect the source code to see any hidden mechanisms.

if you need this functionality, you should use libraries such as ffmpeg, which are cross-platform (but can't hide system-specific naming schemes), or native system APIs.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-11-19 15:22:58 -0600

Seen: 619 times

Last updated: Nov 19 '20