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)..
Try java-screen-recorder, it is a simple screen capturer and converter. It is not very cpu/gpu consuming. Solution based on java.awt.Robot
and repeated capturing of the screen.
I once developed SimRat (A simple screen sharing app like Teamviewer) using Robot & Corba. You might be able to get a basic idea looking at the code. This is not the best possible way to implement screen sharing. Java RMI would be helpfull for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With