How to set which webcam to use in WebCamConfig #311
-
I'm using the following code to init the webcam:
But when running on notebooks with two webcams (built-in and external) I can't define which webcam I want to use, in some cases even having to disable the built-in webcam for Human be able to detect the external one instead. Is there any way to define the camera label I want to use? I ended up not finding it in the documentation. I would also like to know what the Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
not explicitly, but its a good feature-request, i'll add it. in the meantime, you can try
for example, you may want 500 x 500, but camera does not have that natively, so it may select 1024 x 768 as closest native resolution |
Beta Was this translation helpful? Give feedback.
-
added option to specify which video source to use in example: const devices = await human.webcam.enumerate();
const id = devices[0].deviceId; // use first available video source
await human.webcam.start({ element: videoElement, crop: true, width: 800, id }); code is part of upcoming |
Beta Was this translation helpful? Give feedback.
not explicitly, but its a good feature-request, i'll add it.
in the meantime, you can try
mode: front
ormode: back
if it helps.(that api is not explictly designed to select multiple webcams, but for mobile phones with user-facing or back-facing cameras.)
crop: true
means when width/height are set, it will perform a center-crop to exact specified width/height.if
crop: false
, it will select stream that fits contstraints, but if it doesn't match width/height exactly, it will leave it as-is.for example, you may want 500 x 500, but camera does not have that nati…