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

**URL:** <https://community.stereolabs.com/t/python-zed-fusion-script-halts-with-data-source-timeout-warning-windows/8658>\
**Category:** Python\
**Tags:** windows\
**Created:** [April 23, 2025, 9:42am UTC](https://community.stereolabs.com/t/python-zed-fusion-script-halts-with-data-source-timeout-warning-windows/8658 "2025-04-23T09:42:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrian](https://community.stereolabs.com/user_avatar/community.stereolabs.com/adrian/32/4301_2.png) [@adrian](https://community.stereolabs.com/u/adrian)\
**Post date:** [April 23, 2025, 9:42am UTC](https://community.stereolabs.com/t/python-zed-fusion-script-halts-with-data-source-timeout-warning-windows/8658/1 "2025-04-23T09:42:39Z")

</div>

Hi [Stereolabs](https://www.stereolabs.com/) 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!

---

<div class="post-metadata">

**Author:** ![adrian](https://community.stereolabs.com/user_avatar/community.stereolabs.com/adrian/32/4301_2.png) [@adrian](https://community.stereolabs.com/u/adrian)\
**Post date:** [April 23, 2025, 7:24pm UTC](https://community.stereolabs.com/t/python-zed-fusion-script-halts-with-data-source-timeout-warning-windows/8658/3 "2025-04-23T19:24:05Z")

</div>

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);

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [April 24, 2025, 6:55am UTC](https://community.stereolabs.com/t/python-zed-fusion-script-halts-with-data-source-timeout-warning-windows/8658/4 "2025-04-24T06:55:51Z")

</div>

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/](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](https://www.stereolabs.com/) Support

---

<div class="post-metadata">

**Author:** ![adrian](https://community.stereolabs.com/user_avatar/community.stereolabs.com/adrian/32/4301_2.png) [@adrian](https://community.stereolabs.com/u/adrian)\
**Post date:** [April 24, 2025, 7:05am UTC](https://community.stereolabs.com/t/python-zed-fusion-script-halts-with-data-source-timeout-warning-windows/8658/5 "2025-04-24T07:05:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [April 24, 2025, 8:11am UTC](https://community.stereolabs.com/t/python-zed-fusion-script-halts-with-data-source-timeout-warning-windows/8658/6 "2025-04-24T08:11:34Z")

</div>

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](https://eclipse-ecal.github.io/ecal/stable/index.html)) to perform such a task.

Best,

[Stereolabs](https://www.stereolabs.com/) Support
