View Full Version : Two USB Cameras
beijing_strbow
29-12-2016, 16:51
We're trying to connect 2 USB cameras to the roborio, and would like to process the images from one, and stream the other to the driver station. We have the streaming working with mjpg-streamer. However, when we try to get images from the other camera, we get an "internal error" (IMAQdxError -1074360319). I'm fairly sure we are accessing the correct camera, because we get a "camera already in use error" otherwise.
The image processing camera is a LifeCam hd-3000, though the streaming camera is something different at t the moment.
SamcFuchs
29-12-2016, 22:47
I was told at an event that the only camera that is tested and confirmed to work is the LifeCam. Anything else, and you're on your own.
Does the 2nd camera show up in the RoboRIO dashboard?
beijing_strbow
30-12-2016, 11:25
The other camera does show up, but it is listed as two devices on the webdashboard, which could be the problem. We may just wait until we can get another LifeCam.
euhlmann
30-12-2016, 13:22
The other camera does show up, but it is listed as two devices on the webdashboard, which could be the problem. We may just wait until we can get another LifeCam.
Could you post a screenshot of the web dashboard?
RufflesRidge
30-12-2016, 13:25
What resolutions and framerates are you trying to get from the two cameras? You may be maxing out the USB bandwidth.
beijing_strbow
30-12-2016, 14:13
I don't have access to the webdashboard at the moment, and won't for a few days, but on USB it shows the LifeCam labeled cam0, the second camera labeled cam1, and again the second camera labeled something like USB0::####::####::NI-VISA-1005::2::RAW, where # is a number or letter that I don't remember.
Both cameras work fine by themselves, but using them together causes an error.
We aren't maxing out the bandwidth, because the error occurs when we call NIVision.IMAQdxOpenCamera(), before any image data is passed to the roboRIO.
Dan Waxman
30-12-2016, 15:18
If I recall correctly, the USBCamera class is implemented as a singleton, and as a result you can't use two cameras in any intuitive way. There's a chance I'm wrong on that, but I recall my team messing around with it and looking at the source code and I believe that was the takeaway. I remember there was a hacky way here on CD not too long ago though. I found it easier to just use an IP Camera and USB camera instead of two USBs, but I'm pretty sure there is a way.
beijing_strbow
30-12-2016, 23:15
According to this post, the error occurs when opening the second camera will use more than the allowable USB bandwidth:
https://www.chiefdelphi.com/forums/showpost.php?p=1449298&postcount=32
I guess I'll try decreasing resolution and FPS once I have access to the robot again.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.