Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

❓ Android devices multi-cams support #2058

Closed
3 of 4 tasks
lazarevand1997 opened this issue Oct 20, 2023 · 7 comments
Closed
3 of 4 tasks

❓ Android devices multi-cams support #2058

lazarevand1997 opened this issue Oct 20, 2023 · 7 comments
Labels
💭 question Further information is requested

Comments

@lazarevand1997
Copy link

Question

From 3.0.0 lib supports Multi-cams for android. Could you please tell what devices better to use to test this?

What I tried

I tried One Plus 7T, it has a few cameras, but there is only one single back camera device.

VisionCamera Version

3.4.1

Additional information

@lazarevand1997 lazarevand1997 added the 💭 question Further information is requested label Oct 20, 2023
@lazarevand1997 lazarevand1997 changed the title Android devices multi-cams support❓ ❓ Android devices multi-cams support Oct 20, 2023
@zzz08900
Copy link
Contributor

but there is only one single back camera device.

I feel like there's something wrong with your code. How did you get your device prop for camera view?

@lazarevand1997
Copy link
Author

I use getAvailableCameraDevices to get all devices. And now it returns 2 devices, one front and one single back.

@mrousavy
Copy link
Owner

Hi.

VisionCamera has a very solid Devices API that is capable of detecting all Camera devices on your phone that are available for use in your app. Even USB Cameras. If there's a device missing in that list, it is pretty likely that this device is simply not available for use, and the vendor (Samsung, Huawei, One Plus, ...) just locked this and doesn't allow you to use this specific Camera device. In other words; if VisionCamera can't detect the Camera, there's nothing you can do about it. It's not even available in a native Android app (except for their stock Samsung/Huawei/... Camera app).

To confirm this, download the official Google example for Camera apps; camera-samples/Camera2Video and run it on your phone. If the Camera device is not in there either, then again, nothing you can do.

I'm sure that for specific devices such as telephoto or ultra-wide, they usually don't allow you to use those devices directly, but only in combination with other devices (e.g. a "dual-camera" consisting of a normal wide-angle and the ultra-wide-angle), because they only work like that.

Try logging all devices you get:

const devices = Camera.getAvailableCameraDevices()
devices.forEach((d) => {
  d.formats = null
})
console.log(JSON.stringify(devices, null, 2))

And if there's only one device on the back there then that's the only device third party apps can use. That's OnePlus' fault then.

@mrousavy
Copy link
Owner

See Multi-camera API and Multi-Camera Hardware Support documentation for more information.

@mrousavy
Copy link
Owner

Actually maybe this fixes this: #2073

@mrousavy
Copy link
Owner

Try 3.6.3 and let me know if the multi-cam now shows up for you. If you appreciate my efforts & dedication to VisionCamera, please 💖 consider sponsoring me on GitHub 💖 to say thanks. :)

@Asadaial
Copy link

@mrousavy how can we use front and back cameras at a time when the back camera is open and we want to show our face as well with front camera? I am unable to use it in that way and no documentation is helpful in this

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
💭 question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants