Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After running pipeline.start (), will the camera continuously transmit frames to my computer, or will the camera only transmit frames to my computer when I call wait_for_frames ()? #6100

Closed
Dontla opened this issue Mar 20, 2020 · 8 comments
Labels

Comments

@Dontla
Copy link

Dontla commented Mar 20, 2020

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model D435
Firmware Version 05.11.15.00
Operating System & Version Win10
Platform PC
SDK Version 2.29.0
Language python3.6.8
Segment Robot

After I enable pipeline.start (), if I don't call wait_for_frames (), will the camera consume my bandwidth?
Best regards!

@MartyG-RealSense
Copy link
Collaborator

The purpose of wait_for_frames is to block until a frame is available. It helps to ensure that a complete frame is received as soon as one is available. It therefore provides stability by freeing up the CPU until a complete frame is available.

The meaning of wait_for_frames, poll_for_frames, etc and the differences between them is discussed in the link below.

#2422 (comment)

@Dontla
Copy link
Author

Dontla commented Mar 21, 2020

yeah, but if I don't call wait_for_frames (), would the camera consumes the USB bandwidth of my computer after I had called pipeline.start ()?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 21, 2020

I would think that the main factors in bandwidth consumption are frames per second (FPS) and resolution, and use of wait_for_frames is more a matter of helping to reduce the likelihood of a single CPU core's usage going to 109%.

If you feel that you need some kind of frame mechanism in place but do not want a wait, follow Dorodnic's advice in the link above to use poll_for_frames (frames return instantly) and define when the CPU should sleep so the core does not always go to 100% usage.

@dorodnic
Copy link
Contributor

Hi @Dontla
Frames are constantly streamed from the device in the background. They are only passed to you when you call wait_for_frames.

@Dontla
Copy link
Author

Dontla commented Mar 23, 2020

Yeah, my boss wants to connect 9 cameras to one computer, and I told him that according to the official suggestion, under a transmission configuration with a resolution of 1280 × 720 and 30 frames per second, a computer can only support up to 3 cams (https://dev.intelrealsense.com/docs/multiple-depth-cameras-configuration#section-2-multi-camera-considerations), but he thought that we don’t always use cameras at the same time, right? I guess he probably pointed the wait_for_frames (), indeed we only call wait_for_frames () for the next camera after we call wait_for_frames () for one camera, we do not use multithreading to call it, but I told him that even if we did not call wait_for_frames (), as long as we start the pipeline .start () of each camera, the frame set of each camera will be transmitted from the device to our computer through the USB cable constantly, but I was not sure if I am right, so I came here to ask you...

@MartyG-RealSense
Copy link
Collaborator

@Dontla Multiple camera setups do not always need to be hardware synced. Multiple RealSense cam arrangements on the same computer were in use for years before hardware sync was available.

In such systems, the maximum typical recommended number of cameras active at the same time was 4. Through a process of enumeration, tens of cameras could be cycled through in batches of 4 at.a time, taking a snapshot and then turning off those cameras and starting the next batch of 4, until you get back to camera number 1 and start the cycle again.

@MartyG-RealSense
Copy link
Collaborator

This case will be closed after 7 days from the time of writing this message if there are no further comments. Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants