recording streams from multiple kinects using pykinect

Sep 16, 2013 at 3:46 PM
Hello

I am trying to build a system to record streams from several kinects on one computer.

For the moment my setup is constituted by 2 kinect and one computer and I am using pykinect to get the streams for the two kinects.
To get access to the kinect devices, I am using the following code:
kinect0 = nui.Runtime(index=0)
kinect1 = nui.Runtime(index=1)
But when the 2nd line is run I get the following error:
kinect1 = nui.Runtime(index=1) # to instantiate a Nui.Runtime object in order to configure applications to read the depth, color and skeleton streams
  File "C:\Python27\lib\site-packages\pykinect-1.0-py2.7.egg\pykinect\nui\__init__.py", line 115, in __init__
    raise KinectError('Unable to create Kinect runtime '+ traceback.format_exc()) 
pykinect.nui.KinectError: Unable to create Kinect runtime Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pykinect-1.0-py2.7.egg\pykinect\nui\__init__.py", line 110, in __init__
    self._nui.NuiInitialize(nui_init_flags)
  File "C:\Python27\lib\site-packages\pykinect-1.0-py2.7.egg\pykinect\nui\_interop.py", line 155, in NuiInitialize
    _NuiInstance._NuiInitialize(self, dwFlags)
  File "_ctypes/callproc.c", line 936, in GetResult
WindowsError: [Error -2097086457] Windows Error 0x83010007
On the other side, when I print out the number of active kinect with the following line:
nui.Device().count
I get the value 2 which means that there are 2 active kinects.

I cannot figure out what is the problem which do not allow the use of the 2 kinects.
Could anyone help me please?

Thank you for your attention,
Aymeric
Coordinator
Sep 16, 2013 at 4:13 PM
This post may be relevant - basically it says that if you have multiple Kinects connected then they need to be on separate USB host controllers. Though they seem to suggest that you won't see "2" for Device.count unless they're already connected correctly, so maybe this doesn't apply here.

I guess you've tried each one individually and they work fine? If you swap those two lines is it still the second one that gives an error?
Sep 16, 2013 at 4:56 PM
Hello Zooba,
  • I guess you've tried each one individually and they work fine?
Yes, I tried each one individually, which means only one kinect is connected and I am using the following line:
kinect0 = nui.Runtime(index=0)
or
kinect0 = nui.Runtime()
And it works fine.
  • If you swap those two lines is it still the second one that gives an error?
When I connect 2 kinects to the computer and I try to access only the second kinect by running the following line:
kinect1 = nui.Runtime(index=1)
I get the same error as above.
Coordinator
Sep 16, 2013 at 5:02 PM
Have you checked the USB connections?
Sep 16, 2013 at 5:26 PM
You are right, I skip this check before.
I change the USB connections of one of the kinects and now it is working!
Thank you Zooba!