-
Notifications
You must be signed in to change notification settings - Fork 219
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
How to Reduce Streaming Lag Caused by Slow Processing? #152
Comments
Hi @jakobhec ! I'm not sure what we can change. The delay is not caused because the input frames arrive faster than the output frames, we have a queuing mechanism that applies backpressure so the input frames are processed as fast as output frames are produced. So if outputting a frame takes .2 seconds, the output stream will naturally have 5 fps. Let me know if I'm thinking about this incorrectly. |
Some other thoughts:
|
Hi @freddyaboulton! Could you please explain a bit more what you mean by a “queuing mechanism that applies backpressure”? Here’s how I understand it: I would like to avoid optimizing inference performance during prototyping, and I want to use it on a live webcam stream rather than a video. I would love to have an easy option to pass only the latest frame to the handler and drop all intermediate frames. This way, the output stream would still run at 5 FPS but stay in sync with the camera without an increasing delay. |
In this example, the processing function takes 200ms per frame, but the input stream runs at 30 FPS. This means new frames arrive faster than they can be processed, causing increasing delay.
Is there a standard approach for handling this? Are there any examples?
A simple solution could be to always process only the latest input. This would make the output video choppy but keep it in sync.
The text was updated successfully, but these errors were encountered: