Python ZED Fusion Script Halts with "Data Source Timeout" Warning (Windows)

Hi Stereolabs Community,

I am working on a project using the ZED SDK Fusion API with two ZED cameras on Windows using Python. I have successfully implemented camera initialization, loading calibration data from a JSON file, and subscribing the cameras to the Fusion API.

However, my script seems to halt or stop shortly after entering the main processing loop, specifically around the first call to fusion.process(). I am not getting any explicit Python errors, but the console shows the following repeated ZED SDK warning right before it stops:

[2025-04-23 04:16:46 UTC][ZED][WARNING] The current data source timeout is set to 50. However, this value falls short of the source period (66.66666412353516 milliseconds) required for efficient synchronization. To ensure optimal synchronization, we strongly recommend increasing this value significantly.
[2025-04-23 04:16:46 UTC][ZED][WARNING] The current data source timeout is set to 50. However, this value falls short of the source period (66.66666412353516 milliseconds) required for efficient synchronization. To ensure optimal synchronization, we strongly recommend increasing this value significantly.

My setup involves:

  • Operating System: Windows
  • Programming Language: Python
  • ZED SDK Version: 5.0.0
  • Cameras: 2 x ZEDi, running at HD720@15
  • Goal: Use Fusion for pose tracking and potentially fused object detection (using custom YOLO detections ingested per camera).

Based on the warning, the default Fusion data source timeout (50ms) is too short compared to my camera frame period (~66.7ms). I suspect this is causing fusion.process() to block or fail internally due to synchronization issues. Even if I set manually the value to 200ms it will get the default value as the print line is sayin 50ms after setting it:
init_fusion_params.synchronization_parameters.data_source_timeout = 200 print(f"[Fusion] data_source_timeout set to " f"{init_fusion_params.synchronization_parameters.data_source_timeout} ms")

My question is: How can I correctly increase this data source timeout using the Python API? I looked into sl.InitFusionParameters(), and found documentation mentioning timeout_period_number, but I’m unsure about the correct usage or expected units (milliseconds vs. number of periods).

Could you please provide guidance on how to properly configure the sl.InitFusionParameters to set a sufficient timeout (e.g., > 70ms) for my setup? Or could there be another reason why the script is halting after these warnings?

Thank you for your help!

I’m also interested if the OD(object detection) for python FUSION API have wrappers over python because I don’t know how to call those functions. As I understood in c++ they are existent
fusion.enableObjectDetection(od_params);
fusion.retrieveObjects(fused_objects, runtime_params);

Hi,

Are your cameras connected on USB or via streaming?

I’d strongly recommend not using the python language for multicamera applications. There is no real multithreading (see https://realpython.com/python-gil/), greatly degrading the overall performance. Please run the c++ sample instead and let me know if the issue persists.

Best,
Benjamin V.

Stereolabs Support

Hi Benjamin,

Thanks for the reply. I’m connecting all ZED 2i cameras via USB to a single host. My entire application—including UI, data handling, and post-processing—must be in Python, so switching to a pure C++ codebase isn’t feasible.

Is there a recommended way to integrate the C++ Fusion object-detection sample into my Python app? For example:

  • Building the C++ detection module as a shared library with a C API and calling it from Python via ctypes or pybind11
  • Running the C++ sample as a separate process and exchanging frames/detections over IPC
    My goal is to keep camera capture and the UI in Python while offloading detection to native code for real multithreading. Do you have guidance or examples on any of these integration approaches?

Sending the data over IPC might be the way to go, especially for detection data, that are quite small. I’m not quite sure if sending the full frames is doable efficiently, the data is much larger.

I’d recommend looking into eCal (https://eclipse-ecal.github.io/ecal/stable/index.html) to perform such a task.

Best,

Stereolabs Support

1 Like