I am trying to create a screen recorder to practice my atrophied Java skills (although there are already too many).
However, I ran into a problem when the Robot class was ridiculously slow - at about 15 frames per second even on my computer powered by i7 and scanning 4-5 frames per second on my macbook. I built a working recorder with Python and was able to at least achieve reliable 20-24fps by capturing snapshots using PIL.
So, I'm curious, what is the technical reason for such a slow class?
Next, how do other screen recorders work? Screencast-o-matic is Java and seems to work well. I assume that there is some way to connect to the base OS and pulling everything out of the buffer or something else? I think there must be some ridiculously quick way to get copies of what is drawn on the screen. After all, the operating system is fast enough to draw a screen several times in the end, doing other calculations! Copying an array of colors from one place to another seems to be a relatively cheap operation.
I decided not to give up! I just don’t know what I need to know in order to really plunge into the meat, creating the right recorder.
source
share