Cannot load k4arecord.dll
Hello, thank you for integrating Azure Kinect SDK to Open3D.
Describe the bug
I followed the way that you described in the document, but Azure Kinect SDK does not work on my two laptops.
It looks like LoadLibrary function can not read k4arecord.dll file. So I checked the path of the SDK and print the type of error using GetLastError function. It printed 126. I think the path and the version of SDK (1.2.0) are fine. I don't know why LoadLibrary can't read Kinect SDK. Do you know why it happened?
To Reproduce Installed the recent Open3d (0.8) and run the file using "python examples/Python/ReconstructionSystem/sensors/azure_kinect_mkv_reader.py --input d:\data\book10.mkv" and ".\AzureKinectMKVReader.exe --input c:\data\test.mkv" in the this repo.
Environment (please complete the following information):
- OS: window 10
- Python version: 3.6
- Open3D version: 0.8
- Is this remote workstation?: no
- How did you install Open3D?: pip
@yxlao is this a compatibility issue with k4a v1.2?
FYI, I tested with both 1.2 and 1.3 versions
@taeinkwon Yes, v1.2 shall have been tested. Probably it's missing some other dependencies, e.g. the depth engine library.
For error code 126, have you tried the methods described in https://stackoverflow.com/a/14362289/1255535, to trace all files while your dll is trying to load?
You might want to refer to my comment at https://github.com/intel-isl/Open3D/issues/1314#issuecomment-580590274 if it helps.
I have the same problem. I have SDK installed version 1.2 and the depth engine dll is there as well. Also azure_kinect_viewer.py gives me this error:
`[Open3D INFO] AzureKinectSensor::Connect
[Open3D INFO] sensor_index 0
[Open3D INFO] Serial number: 000021492512
[Open3D INFO] Firmware build: Rel
[Open3D INFO] > Color: 1.6.102
[Open3D INFO] > Depth: 1.6.75[6109.7]
Sensor initialized. Press [ESC] to exit.
[2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000
[2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t
[2020-02-10 14:56:32.078] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000
[2020-02-10 14:56:32.080] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t
[2020-02-10 14:56:32.081] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000
[2020-02-10 14:56:32.081] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t
[2020-02-10 14:56:32.115] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000
[2020-02-10 14:56:32.115] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t
[2020-02-10 14:56:32.117] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000
[2020-02-10 14:56:32.119] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t
[2020-02-10 14:56:32.120] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000
[2020-02-10 14:56:32.121] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t
Traceback (most recent call last):
File "Open3D\examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py", line 72, in
Invoked with: VisualizerWithKeyCallback with name viewer `
If I rename the folder "C:\Program Files\Azure Kinect SDK v1.2.0" to something else I get: RuntimeError: [Open3D ERROR] Cannot load k4a.dll. This probably means the DLLs are loaded from the correct location.
Any update on this one on Azure Kinect SDK v1.3 and open3d 0.9.0? I am getting issue for these versions.
@yxlao do you have any information about this?
I am also having this problem. I can load k4a.dll and depthengine_2_0.dll without any problems even on SDK 1.4.0. (so the viewer and recorder work). The only DLL that cannot be loaded is k4arecord.dll. I tried downgrading to 1.2.0 and had the exact same behavior (only mkv reader does not work)
I am also having this problem. I can load k4a.dll and depthengine_2_0.dll without any problems even on SDK 1.4.0. (so the viewer and recorder work). The only DLL that cannot be loaded is k4arecord.dll. I tried downgrading to 1.2.0 and had the exact same behavior (only mkv reader does not work)
I am having the exact same problem. Windows 10

Adding the K4A_LIB_DIR system variable worked for me when using c++ verison of the mkv reader.
Issue fixed : https://github.com/intel-isl/Open3D/issues/1314#issuecomment-634971437
I have the same problem. I have SDK installed version 1.2 and the depth engine dll is there as well. Also
azure_kinect_viewer.pygives me this error:`[Open3D INFO] AzureKinectSensor::Connect [Open3D INFO] sensor_index 0 [Open3D INFO] Serial number: 000021492512 [Open3D INFO] Firmware build: Rel [Open3D INFO] > Color: 1.6.102 [Open3D INFO] > Depth: 1.6.75[6109.7] Sensor initialized. Press [ESC] to exit. [2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.078] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.080] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.081] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.081] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.115] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.115] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.117] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.119] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.120] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.121] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t Traceback (most recent call last): File "Open3D\examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py", line 72, in v.run() File "Open3D\examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py", line 36, in run vis.update_geometry() TypeError: update_geometry(): incompatible function arguments. The following argument types are supported:
- (self: open3d.open3d.visualization.Visualizer, arg0: open3d.open3d.geometry.Geometry) -> bool
Invoked with: VisualizerWithKeyCallback with name viewer `
If I rename the folder "C:\Program Files\Azure Kinect SDK v1.2.0" to something else I get:
RuntimeError: [Open3D ERROR] Cannot load k4a.dll. This probably means the DLLs are loaded from the correct location.
Having the same issue,is it solved ?
Having the same issue
I also have the same issue...
Adding the K4A_LIB_DIR system variable worked for me when using c++ verison of the mkv reader.
This works for me. In Windows 10, I set the K4A_LIB_DIR to the the ""C:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\bin"", the azure_kinect_viewer.py can show the color and depth map. However, it still have the error message like this
I have the same problem. I have SDK installed version 1.2 and the depth engine dll is there as well. Also
azure_kinect_viewer.pygives me this error: `[Open3D INFO] AzureKinectSensor::Connect [Open3D INFO] sensor_index 0 [Open3D INFO] Serial number: 000021492512 [Open3D INFO] Firmware build: Rel [Open3D INFO] > Color: 1.6.102 [Open3D INFO] > Depth: 1.6.75[6109.7] Sensor initialized. Press [ESC] to exit. [2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000
@schen119 we will look into this as soon as we have some bandwidth. @yxlao will try to help as soon as he is free.
On Windows, the Open3D Kinect plugin will look for the Kinect K4A library located in the default installation paths:
https://github.com/intel-isl/Open3D/blob/3c6e66419a0f5669b27503f1e30dd4960b1aa4ba/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.cpp#L76-L79
Currently, it supports 1.2.0 to 1.4.1. So first, check if the dll files are are found in the paths above.
If the K4A library is not in the default location, you'll need to set the K4A_LIB_DIR environment variable to point to the directory containing the K4A's *.dll files.
Some of the fixes we have are in the master branch, we'll be updating the python packages in the next release.
Hey, i still have the same problem with azure_kinect_mkv_reader.py
Traceback (most recent call last):
File "D:/TUM/IFL/Open3D-master/Open3D-master/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py", line 135, in <module>
reader = ReaderWithCallback(args.input, args.output)
File "D:/TUM/IFL/Open3D-master/Open3D-master/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py", line 27, in __init__
self.reader.open(self.input)
RuntimeError: [Open3D ERROR] Cannot load k4arecord.dll
My environment is Win 10, python 3.7.7, open3d 0.10.0, azure sdk v.1.4.1 Even after adding path as @wearenocomputer suggested it does not work. But I can run all of the pyk4a examples https://github.com/etiennedub/pyk4a Please help, I want to get an intrinsic matrix from my kinects and seems like its the only way you can do it :(
Hey, i still have the same problem with azure_kinect_mkv_reader.py
Traceback (most recent call last): File "D:/TUM/IFL/Open3D-master/Open3D-master/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py", line 135, in <module> reader = ReaderWithCallback(args.input, args.output) File "D:/TUM/IFL/Open3D-master/Open3D-master/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py", line 27, in __init__ self.reader.open(self.input) RuntimeError: [Open3D ERROR] Cannot load k4arecord.dllMy environment is Win 10, python 3.7.7, open3d 0.10.0, azure sdk v.1.4.1 Even after adding path as @wearenocomputer suggested it does not work. But I can run all of the pyk4a examples https://github.com/etiennedub/pyk4a Please help, I want to get an intrinsic matrix from my kinects and seems like its the only way you can do it :(
Hello, you solve it?