Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Real-time screensharing to Java app (localhost)

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)..

like image 388
Val Avatar asked Jan 23 '15 10:01

Val


2 Answers

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.

like image 115
ancalled Avatar answered Sep 27 '22 18:09

ancalled


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.

like image 21
Rumesh Eranga Hapuarachchi Avatar answered Sep 27 '22 20:09

Rumesh Eranga Hapuarachchi