I am looking for a way to add an overlay to a running Windows game, like OBS (a game streaming application, used for Twitch).
I though about using the Robot
class to take 25/30 screenshots every seconds and display them, but I'm not sure that's the right solution..
So my question is the following: How can I screenshare a running app to a Java application (localhost, same computer), in order to add an overlay in front of it ?
EDIT: I tried using VLC Streaming but that makes the computer really laggy (i7/8Gb)... I tried with FFMpeg too, using screen-capture-recorder
and gdigrab
, the computer was not laggy, but the video drops like 5/10 FPS in real-time.
In FFMpeg, I used the following command : ffplay -f dshow -f gdigrab -i title="<NAME>" -framerate 30
.
I would like to have a 25/30 FPS with a gaming computer (i7/8Gb)..