react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

💭 USB Camera Android

Open rorigger opened this issue 1 year ago • 2 comments

Question

Hey Guys, I need a solution for using an external USB camera I have seen the issues regarding UVC cameras etc. I'm just wondering if anyone has ever successfully used an external camera with this library and if so what specific android/camera device was used? any help would be greatly appreciated!

What I tried

I have tried multiple UVC camera modules and a Microsoft Lifecam with Pixel7 and Galaxy Tab A7 Devices

VisionCamera Version

4.5.0

Additional information

rorigger avatar Jul 31 '24 05:07 rorigger

Guten Tag, Hans here.

[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by @mrousavy in his free time. To support @mrousavy, please consider 💖 sponsoring him on GitHub 💖. Sponsored issues will be prioritized.

maintenance-hans[bot] avatar Jul 31 '24 05:07 maintenance-hans[bot]

I'm also looking for some answer about the usb camera, currently with the camera attached to the simulator but fooling it on having the camera as "front" or "back" (editing the config.ini file in the avd folder) it works but when i build the app and put it on my tablet i can only access the front and back camera, the 'external' one is not even seen by "useCameraDevices()"

x3n0peltis avatar Aug 01 '24 15:08 x3n0peltis

Based on the library code, I noticed that the device list is directly polled from the camera manager. This means if the Android phone doesn't accept the external camera natively, the library won't pick it up. It seems that some devices support this, while others do not, so requiring alternative methods to capture external camera data.

Another good ref: https://stackoverflow.com/questions/57846505/accessing-a-usb-camera-using-android-camera2-api

ppanwin10 avatar Dec 24 '24 08:12 ppanwin10

closing in favor of https://github.com/mrousavy/react-native-vision-camera/issues/3159

mrousavy avatar Feb 17 '25 14:02 mrousavy

Turns out most of the Android builds does not have FEATURE_CAMERA_EXTERNAL kernel feature enabled. So we have two options - use custom Android ROM which is built with such support (ex. Lineage OS) or make your own UVC integration like this example

AssenDimitrov avatar Mar 07 '25 12:03 AssenDimitrov