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
grabbing frames only in each second #2211
Comments
You might be able to use setTimestamp() for this. |
@saudet Can you show me example of this usage? |
@saudet I also after about an hour of usage have 100% usage of processor. |
I'd start by calling something like |
Currently I am using function like: |
That should work too. You'll need to make sure you don't keep copies of the images in memory to avoid running out of it |
In my code I only grab a frame and I just put it in another service. Even thou in my component when I'm only grabbing frames I run out of memory. |
Do you run out of memory only with delayedGrab()? Or does it happen with normal grab() as well? |
In any case, if you could provide a small standalone code snippet to reproduce the issue, I would be able to look into this |
private void initialiseFrameGrabber() {
log.info("Starting new stream");
this.frameGrabber = new FFmpegFrameGrabber(RTSP_URL);
this.frameGrabber.setFrameRate(1);
try {
this.frameGrabber.start();
} catch (FrameGrabber.Exception e) {
log.error("error during starting frame grabber {}", e.getMessage());
}
}
// frameGrabber.waitForTimestamp()
// Thread.sleep(1000);
} catch (FrameGrabber.Exception e) {
log.error("Exception during getting new frame! {}", e.getMessage());
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
I want actually to grab frame only on each second. This is not valid code because it grabes frames which are in stream queue. Do you have some code or any solution how to handle getting frames only at each second, or to delay them somehow?
The text was updated successfully, but these errors were encountered: