0

I'd like to open 720p streams of two Canyon CNE-CWC3 webcams on a single USB controller (using an USB 2.0 hub) with OpenCV. It works in a rather unpredictable way; sometimes it succeeds, but most of the times it cannot open the second stream. I have checked the streams' bandwidth usage in VLC, it tops at 150-160 Mbps per stream, so the two streams should fit in the 480 Mbps USB bandwidth without a problem. I guess the driver allocates more space for a stream during initialization and this is the reason why the second stream fails.

Is there a workaround for this problem (either in Win or Linux), or should I switch to different webcams? Do you know of any "reliable" type for which this problem surely does not come up?

dlpyth
  • 33
  • 5
  • There is no 480 Mbps; just 192... – Roman R. Jul 05 '16 at 11:03
  • Taking down the data rate by changing resolution does not solve the problem (as mentioned below) so even if it's not 480 Mbps but 192, this does not explain the behavior. Could you please clarify why this setup works sometimes flawlessly nonetheless? Also, do you think changing webcam types could solve the problem? The posts you marked answer none of these questions. Thanks! – dlpyth Jul 05 '16 at 13:28
  • The question as you asked it (with focus on bandwidth) indeed duplicates many other questions. And 480/192 comment is still in good standing too. There are cameras out there which work fine being two or more connected to the same USB hub provided that combined bandwidth is not exceeding the limit. In your specific case it might be driver problem as you suggested (grabbing too much of bandwidth not looking at low res?) which again takes you to 192 Mbps problem, or it can be something else hardware specific. FYI - I relatively recently saw a setup with 2 Logitech C930 running fine side by side. – Roman R. Jul 05 '16 at 13:51
  • Also one thing you might want to try with Windows is to uninstall vendor specific webcam driver. If the camera is UVC-compliant and stock MS driver (esp. in more recent versions of Windows) picks it up then I would expect the driver to handle the bandwidth accurately. – Roman R. Jul 05 '16 at 13:57
  • Thanks for your detailed answer, much appreciated. – dlpyth Jul 05 '16 at 14:05

1 Answers1

0

I faced this problem in Linux. The possible solution depends on the driver; it's quite common that the driver allocates more bandwidth than necessary. In my case I solved the problem tweaking the driver, but it is not guaranteed to work. To estimate necessary bandwidth, VLC values may give you some estimation but often the camera chip needs more peak bandwidth because it supplies data in bursts. Reducing camera resolution for one of the cameras may help.

  • Thanks for the suggestion. I've tried to lower the resolutions to as low as 160x120, but didn't solve the problem. – dlpyth Jul 05 '16 at 10:47