pyorbbecsdk icon indicating copy to clipboard operation
pyorbbecsdk copied to clipboard

Two program run two device in same pc problem

Open MFpizza opened this issue 6 months ago • 1 comments

I'm trying to use the same program to control different devices by specifying a different index, like this:

ctx = Context() self.device_list = ctx.query_devices() self.device = self.device_list.get_device_by_index(0) self.pipeline = Pipeline(self.device)

My program can run directly on different devices. However, I can't run two programs simultaneously. I don't get any error messages when running the programs.

Let me explain in more detail. I have two identical programs, named A_program and B_program, and two Femto Bolt cameras, named A_camera and B_camera.

It works when I use A_program to get data from A_camera. After I stop that program, I can run B_program to get data from B_camera, and that also works.

However, when I run both programs simultaneously, I only get data from the first program that was opened. For example:

Run A_program -> Run B_program -> only A_program gets data.

It seems running example/two_devices_sync.py can work.

Why does this happen? How can I use two different programs to control different cameras on the same PC?

MFpizza avatar Aug 01 '25 01:08 MFpizza

You could try something like this: self.device = self.device_list.get_device_by_index(device_index)

By changing the device index, you can run different devices in different programs on the same PC. By default, get_device_by_index(0) always selects the first camera in the device list. Changing the index allows different programs to control different cameras.

gongye2 avatar Aug 28 '25 08:08 gongye2