'How to get an input stream through usb connection - Android (USB Camera)

Hey guys i have been trying to read to connecting to my USB camera an get an input stream from it.

I.i tried camera2 api for connecting but it dont recognize external cameras and only shows internal front and back cams.

II.i also work with some libraries but they have so much bug and they are not customizable (like https://github.com/jiangdongguo/AndroidUSBCamera).

III.i also work with usbManager and can get some details about my device like PID and VID but i can't make a successfull connection to get my data from USBcamera.

can anybody help me about this topic?

I appreciate each of your ideas



Solution 1:[1]

While Android devices can support USB webcams directly, it's not a mandatory feature. So most devices do not enable this support. It's fairly common on TV devices, but not on phones or tablets.

If it's not directly supported by the device, the USB camera will not be usable via camera2. So the only option is using the UsbManager APIs directly, but that requires implementing the entirely UVC interface stack in your app code. That's what libraries like AndroidUSBCamera do.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eddy Talvala