bytedeco/javacv

FFmpegFrameGrabber grabber long time consuming

Open

#1,429 opened on May 14, 2020

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
help wantedquestion

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I had a problem making the recording screen. When I capture the screen and execute grabber.grab(), it takes me about 80 milliseconds. The capture is 1920 * 1080, 30 frames. My computer CPU is i9, The time-consuming code is

   grabber = new FFmpegFrameGrabber("desktop");
   grabber.setImageWidth(1920);
   grabber.setImageHeight(1080);
   grabber.setFrameRate(30);
   grabber.setFormat("gdigrab");

   capturedFrame = grabber.grab();   //execute this code takes me about 80 milliseconds

.What's the solution?

Contributor guide