openxc/android-webcam

Multiple cameras

Closed this issue · 3 comments

How many cameras can be connected at same time?

I don't know if there's a limit in the kernel, I'd guess not, but the device might have a hard time processing multiple streams simultaneously. Let me know if you get it working!

On normal Linux kernel that uses V4L this is limited to the USB I/O throughput depending on the currently used camera device streaming format. For example, RGB VGA data requires 640x480x3 bytes for every frame (3 bytes for every pixel), so when one would like to stream 30 FPS, the necessary throughput will be 26.3 MB/s for a single camera and RGB HD 720p will require 80.1 MB/s.

From the USB Description at Wikipedia you can found that the following are the USB limits:

  • 1.5 MB/s for USB 1.1,
  • 60 MB/s for USB 2.0,
  • 650 MB/s for USB 3.0.

Therefore, if one needs to stream RGB VGA from 2 cameras using USB 2.0 (which is most common), the simultaneous active connections number will be limited to only 2 cameras. I tested this on my Ubuntu Linux and indeed I cannot stream from more that 2 cameras with RGB VGA format at the same time. With lower resolution and/or with better format (e.g. MJPEG) I can actively stream from more.

EDIT: Just a note, even the cheapest UVC devices supports YUV and/or RGB, and some better ones has support for MJPEG which increase the estimated limit to many more devices connected at once.

Thank you Sarxos.
I had to give up of this project, but your information is very useful.