tags:

views:

392

answers:

3

Im trying to create an app to control a pc remotely using java , i want to use red5 to let the admin control desktops using a flash movie so i need to find java classes to :

  • capture desktop as live video
  • -control mouse and keyboard
+1  A: 

TightVNC has a Java viewer so you can easily manage your server through VNC protocol and use a Java client (usable as an applet too).

There are tools, though not in Java, such as vncrec to record VNC sessions. I don't know if this is exactly what you are looking for since to distribute video a better choice would be to set up a streaming server.

Fernando Miguélez
+1  A: 

I don't believe Java libraries exist that will give you what you want. Capturing the screen and controlling the mouse/keyboard require hooking into the OS in ways that Java doesn't do. You'd need to write a native DLL that uses JNI and exposes the functionality you need, and then load that in java. Then you'd have to convert the image data you get into a format that Flash can understand.

Creating a live video stream probably wouldn't be the most effective. Generally streamed video is fairly lossy (which generally isn't that great when screen sharing), and is at smaller resolutions than you'd probably be dealing with. I'm not sure you could create a video that would both stream fast enough and have high enough image quality to be usable.

You're probably better off using a pre-existing product for this (like TightVNC, as Fernando suggested). Unfortunately, that would require a java applet (or native application) to view, not Flash.

(Full Disclosure: I've written screen sharing applications that use Java on both ends, both the server and the viewer, and we've looked at trying to make a Flash viewer a number of times.)

Herms
Good answer, just like the asker I must implement a remote desktop share/control solution. Your answer gave me some insights. The flash video stream is totally possible tough, this part I think I already know how to do.
Cameigons
A: 

Just use VNC. You can call the VNC server executable from Java. On the client you can use the Java VNC Viewer. I'm sure there's source code somewhere if you really need to make changes to it. You could use AppletWindow from BlueJ to launch the VNC viewer applet inside a JFrame in any Java app.

sjbotha