6

I would like to connect 2 usb webcams to a RaspberryPI and be able to get at least 1920 x 1080 frames at 10 fps simultanously. This will be done using OpenCV. Has anyone done this and knows if this is possible? I am worried that the PI has only 1 usb bus?? (usb2) and might get a usb bandwidth problem.

Currently I am using an Odroid and it has a usb2 and usb3 bus so I can connect 1 camera to each without any problemo..

EDIT: I guess my follow up question would be how many USB buses are on the RPI 3 because if there is 2 then I can put 1 camera on each bus.

Lightsout
  • 429
  • 1
  • 5
  • 20

1 Answers1

1

This might not constitute an answer but the Raspberry Pi (any currently existing one) only has one USB 2.0 bus - the ones with more than one USB port provided the extra ports with a Hub chip that also provides the Wired Ethernet on the B models.

The Compute Module might be a little different but as that is often used by hobbyists with its development kit into which it plugs and it is the latter that provides the normal physically ports into which things are plugged I think it has to be excluded from the discussions.

I think you will have to do the maths to estimate whether your requirements are feasible - don't forget that as well as the resolution the colour/greyscale resolution also acts as a multiplier on the data-rate 24 bit colour (using 2^8 levels for each of red/green/blue) uses more than something that uses a lesser number or encodes the video data in a more complex manner in order to reduce the data-rate at the cost of lowering the resolution of the chrominance component of the data (with a split between a luminance (Y) and two colour components (Cr & Cb) and less bits allocated to the latter).

Whilst looking for clues about this I found "What bitrate should I use when encoding my video? How do I optimize my video for the web?" which describes a Kush gauge which is:

pixel count x motion factor x 0.07 ÷ 1000 = bit rate in kbps
(frame width x height = pixel count) and motion factor is 1,2 or 4

applying this to your proposed usage for the worst motion factor:

(1920 x 1080) pixels x (10) frames per second x 4 x 0.07 ÷ 1000 = 5806 kbps

i.e. 5.8Mbps per image. Well USB2 is supposed to be good for 480Mbps but in practice (Wikipedia) with bus access constants this is more like 280Mbps or 35MBytes-per-second. So USB2 should be good enough as far as I can see, for several comeras...

SlySven
  • 3,631
  • 1
  • 20
  • 46