smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
619 stars 156 forks source link

The frame rate #20

Closed yangwuan55 closed 7 years ago

yangwuan55 commented 7 years ago

I use the demo has a low frame rate.Almost 2fps at macos,why? And how can I include the library to JNI?

smasherprog commented 7 years ago

If you are using the example, make sure you are not saving images to disk. The saving of files to disk is a slow operation. I save images to disk to ensure the program is working properly.

smasherprog commented 7 years ago

Please let me know if that was the issue

yangwuan55 commented 7 years ago

@smasherprog If I don't save images to disk less than 20fps.I use mac pro. image

image

yangwuan55 commented 7 years ago

If I use the objective-c to capture the fps can more than 40fps.

smasherprog commented 7 years ago

There is a limit that is set setFrameChangeInterval set it to 1 and see if that makes it faster

smasherprog commented 7 years ago

take a peek here to see the capture code https://github.com/smasherprog/Screen_Capture/blob/master/src/ios/CGFrameProcessor.cpp

smasherprog commented 7 years ago

also if you want to capture the entire monitor, not the differences, then dont set the callback for onFrameChanged

This will improve performance as well

yangwuan55 commented 7 years ago

Thanks.

smasherprog commented 7 years ago

Did this improve the screen capture rate? I do have some extra work going on inside the capture which I can tune more. It would give a slight bump in performance..

I want to know if this is fast enough, if not, let me know and ill try to make this better.