How to allow Android app(TV-box) to recognize or access USB web camera?

Kennedy Ho picture Kennedy Ho · Jan 10, 2017 · Viewed 19.4k times · Source

I am currently trying to develop an Android video conference application on a Android TV set-top box. As all of us know, Android TV box does not have a camera and therefore I tried to use a USB web camera but the OS does not recognize the USB camera and is unable to retrieve video feed from it.

Is there anyway to make sure my Android application is able to receive video feed from the USB camera?

Thank you and sorry if I wrote this question inappropriately, it's my first time using Stackoverflow.

Answer

Morrison Chang picture Morrison Chang · Jan 10, 2017

You have two choices:

1) Find a Android TV device which supports external camera(s). From the Android Compatibility Definition Document

Section 7.5.3. External Camera

Device implementations MAY include support for an external camera that is not necessarily
always connected. If a device includes support for an external camera, it:

* MUST declare the platform feature flag
  android.hardware.camera.external and android.hardware camera.any .
* MAY support multiple cameras.
* MUST support USB Video Class (UVC 1.0 or higher) if the
  external camera connects through the USB port.
* SHOULD support video compressions such as MJPEG to enable transfer
  of high-quality unencoded streams (i.e. raw or independently compressed picture streams).
* MAY support camera-based video encoding. If supported, a simultaneous
  unencoded / MJPEG stream (QVGA or greater resolution) MUST be
  accessible to the device implementation.

OR

2) Create your own Custom ROM which would require having the code and drivers to satisfy the above requirement. This is non-trivial and involves creating/integrating/testing your own driver which is too broad for StackOverflow question.