Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How to use camerax 1.3.0-alpha04 to open two cameras #564

Open
lodgkk opened this issue Nov 14, 2023 · 7 comments
Open

How to use camerax 1.3.0-alpha04 to open two cameras #564

lodgkk opened this issue Nov 14, 2023 · 7 comments

Comments

@lodgkk
Copy link

lodgkk commented Nov 14, 2023

How to use camerax 1.3.0-alpha04 to open two cameras

@kailianc
Copy link
Contributor

Do you want to open front + rear cameras at the same time?
https://developer.android.com/reference/androidx/camera/lifecycle/ProcessCameraProvider#getAvailableConcurrentCameraInfos%28%29

Before that, you need to check this flag to see if device is supporting this feature: https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_CAMERA_CONCURRENT

@lodgkk
Copy link
Author

lodgkk commented Nov 17, 2023

I get an error Concurrent camera is not supported on the device , but I can open two cameras at the same time when using camera1. How can I solve this?

@lodgkk
Copy link
Author

lodgkk commented Nov 17, 2023

Do you want to open front + rear cameras at the same time? https://developer.android.com/reference/androidx/camera/lifecycle/ProcessCameraProvider#getAvailableConcurrentCameraInfos%28%29

Before that, you need to check this flag to see if device is supporting this feature: https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_CAMERA_CONCURRENT

I get an error Concurrent camera is not supported on the device , but I can open two cameras at the same time when using camera1. How can I solve this?

@kailianc
Copy link
Contributor

Are you opening the front and rear cameras? It's possible that some OEMs don't advertise this feature but you are still be able to try, but the stability is not guaranteed. From framework's perspective, we treat this flag as the source of truth.

@lodgkk
Copy link
Author

lodgkk commented Nov 20, 2023

Are you opening the front and rear cameras? It's possible that some OEMs don't advertise this feature but you are still be able to try, but the stability is not guaranteed. From framework's perspective, we treat this flag as the source of truth.

My project is an access control project. When using camera1, it is possible to simultaneously turn on the rgb camera and infrared camera. When using camerax, I have tried turning on the rgb camera and infrared camera separately, and both worked without issue.

@kailianc
Copy link
Contributor

CameraX Concurrent camera API only refers to opening front + rear camera on the device at the same time. Opening rgb camera and infrared camera is different. If you want to open front + rear camera, you could use concurrent camera API.

@iamwilliamli
Copy link

@kailianc Is it possible to turn on two rear camera for video recording at same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants