Currently Being Moderated

Desktop screen sharing with Openfire

Posted by Dele Olajide on Aug 30, 2007 3:39:23 PM

A few moons ago, there was a request from some Spark users in igniterealtime for a desktop screen sharing plugin. I did mention at that point that I had done something in the past using Red5 and a screen-capture webcam called VH Screen Capture Driver and that I would dig it out of my archives and put it into a future release of the Red5 plugin.

 

I have since discovered that this approach has a few drawbacks. It is not bandwidth efficient, will only work on Windows and although the video driver is free, it is not open source. What we needed was for Flash on the desktop to capture the screen as images, send them to a server and re-assemble them back into a video feed which is then published by Red5. Despite my best efforts, I have since not been able to work out how to do this and if anyone has any tips and clues, please tell me. It will be appreciated.

 

In the meantime I stumbled on Openmeetings in the Openlaszlo community. It is an online meeting collaboration tool developed by Sebastian Wagner with a number of usefull tools like video, white-board and of course screen-sharing. The video sharing is java-based and does not require any software install other than (the java runtime environment) JRE 1.4+. It uses the same java technique (java.awt.Robot class) as Spark to take a screenshot. It goes one step further by pushing the captured screen shots at a regular interval to a web server using the http upload feature. In the spirit of Open Source and re-useability, I have now decided to use Sebatian's approach and keep the images on the web server and allow multiple clients to view with an auto-refreshing webpage instead of my original intention to convert into a video feed for Red5.

 

I have added this feature to the latest version (0.0.10) of the Red5 plugin. It includes the server-side image upload support, the viewer webpage and the Openmeeting screen publisher application as a java webstart application. Both publisher and viewer can be accessed from the Spark red5 plugin and JWChat. You select the publisher from the menu to publish your desktop screen and you right click the roster context menu to view the desktop screens of your contacts.

 

As usual, all feedback is welcome.



Aug 30, 2007 10:46 PM Greg Tangey Greg Tangey    says:

Interested in trying it out, can we get some links to download locations?

Aug 31, 2007 3:14 AM pencoe pencoe    says:

How about using some of the different VNC flavours as a base? There are numerous open source implementations of VNC (TightVNC, UltraVNC, ...).

Maybe you could just use the server and viewer code and just replace the transport (and authentication) by sending XMPP packets?

 

I don't know wether this can be a successful approach, but have a look yourself

Sep 2, 2007 5:19 PM Dele Olajide Dele Olajide    says in response to Greg Tangey:

red5 plugin version 0.0.10 should appear on the beta plugins page soon. I have submitted a copy to Jive to be uploaded. If it does not appear in the next few days, then download from here.

 

-dele

Sep 2, 2007 5:30 PM Dele Olajide Dele Olajide    says in response to pencoe:

It sounds like a geat idea and should work. With enough interest, screen sharing could have an XEP and be supported properly in XMPP by Openfire and Spark.

 

Until then, consider my approach a stop gap.

 

I did not consider VNC because I wanted a solution that was supported by a web client and that meant java or flash for now.

 

-dele

Sep 4, 2007 3:17 PM LG LG    says:

Hi Dele,

 

I did experiment with JMF and the Windows Media Encoder to transfer videos. The Media Encoder runs of course only on Windows and must be installed but it produces good quality and one can use the Media Player to display it which is available on most clients ... with a delay of 5-10 seconds so useless for fine p2p communications.

 

JMF works also fine and Spark uses it for Jingle (at least I think so), so it should be only a small step to use it for video. I'm not sure about the delay.

 

And I'm still hoping for a "Stream Audio" and "Stream Video" button within Spark so one can play something for the other one without the need of transferring the whole file.

 

LG

Sep 5, 2007 9:28 AM bryan webb bryan webb    says:

We could really use this.

When will the red5 plugin version 0.0.10 be available ??? I downloaded from the above link but it appears to be 0.0.9.

 

Where can i get the .10 version ????

 

regards

bryan Webb

Sep 6, 2007 7:16 AM Dele Olajide Dele Olajide    says in response to bryan webb:

you can download from http://red5.4ng.net/red5.war

 

-dele

Sep 7, 2007 2:50 PM Dele Olajide Dele Olajide    says in response to LG:

Hi it200,

 

Thanks for the feedback.

 

>And I'm still hoping for a "Stream Audio" and "Stream Video" button within Spark so one can play something for the other one without the need of transferring the whole file.

 

You can do that right now with Red5 and Flash (outband of course). The Red5 plugin does record/playback video messages. I am thinking of adding a more generic video publish/subscribe feature, but I am short of ideas. I did however come across an interesting red5 application http://www.tjoon.com/ last week.

Sep 11, 2007 9:02 AM opie6373 opie6373    says in response to Dele Olajide:

i click the download link above and it gives me a zip file.  where is the .war that i'm supposed to put in the openfire plugins directory?

Sep 11, 2007 4:21 PM Dele Olajide Dele Olajide    says in response to opie6373:

your browser has renamed it to red5.zip because my web server does not have a mime type for war. It is actually red5.war. Just rename it back.  
 

-dele

Sep 12, 2007 7:04 AM opie6373 opie6373    says in response to Dele Olajide:

great thanks i'll try it

Oct 19, 2007 3:22 PM John Stroy John Stroy    says:

Hi,

 

I stumbled across this while looking for a SIP-Jingle Jabber gateway/transport, but maybe this might help for screen captures:

 

http://java.sun.com/javase/6/docs/api/java/awt/Robot.html

 

It is inefficient, but it works.  It is also possible to encapsulate the output from java.awt.Robot in to VNC frame buffers:

 

http://vncj.com/test.aspx

 

http://sourceforge.net/projects/vncjlgpl

 

(The latter recommends against using Robot to do real work for fairly obvious reasons; nonetheless, there is a demonstration using Robot that does work, albeit very slowly and very inefficiently.  It is buggy, too, from what I recall.)

 

-J

Oct 20, 2007 4:30 PM Dele Olajide Dele Olajide    says in response to John Stroy:

Thanks for info.

 

I downloaded and tried vncjlgpl. Could not figure out how to use it until I found http://www.harpoontech.com/blog/index.php/2007/01/

I however cannot get it working with jre 1.6.

 

-dele

Oct 20, 2007 4:42 PM John Stroy John Stroy    says in response to Dele Olajide:

dele,

 

What happens?  I haven't tried it in 1.6 yet.  Last time I ran across it, I used 1.5.0, and it worked--well, that is, it worked until it crashed and stopped responding to the mouse.

 

-J

Oct 20, 2007 5:07 PM Dele Olajide Dele Olajide    says in response to John Stroy:

I start it with

 

java -cp vncjlgpl.jar gnu.vnc.VNCHost

 

and it throws...

 

Got an exception, shutting down server VNCServer for: VNCj - Lightweight Model Test

java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

 

-dele

Oct 20, 2007 5:41 PM John Stroy John Stroy    says in response to Dele Olajide:

dele,

 

That happens to only apply to the Lightweight Model Test.  VNCj makes a whole slew of tests, including virtual Swing peers in a framebuffer.  That particular test happened to fail; you can try running it again (java -cp vncjgpl.jar gnu.vnc.VNCHost) and then running a VNC client to connect back to:

 

localhost:50

 

That's screen 50, not port 50.  You should get the Robot session.  If that still doesn't work (it worked for me -- JDK 1.6.0_01 HotSpot Client), I can give you the old version that I have, named vncj-full.zip.

 

-J

Oct 20, 2007 5:42 PM John Stroy John Stroy    says in response to Dele Olajide:

Also, the password is "password," sans comma and sans double quotes (as seen on stdout).

Oct 20, 2007 5:51 PM John Stroy John Stroy    says in response to John Stroy:

This is important, too: use a common (i.e. from RealVNC) VNC encoding, like ZlibHex, ZRLE, Hextile, RRE, CoRRE, or even Raw; something like Tight or Ultra may not be supported.  I don't know if it supports CopyRect, Cache, or JPEG, but I doubt it.  As I am running it right now, it does not automatically push updates to the client.  A client pull (refresh) works fine, but full frame buffers are always sent instead of differentials.  Hope that helps.  I'm looking forward to seeing more Java technologies, especially in things like VNC or ssh daemons.

 

-J

Oct 20, 2007 6:49 PM Dele Olajide Dele Olajide    says in response to John Stroy:

Thanks very much for that. It did help!!

 

It throw an exception, but was still running. I didn't pay attention. I have used the windows VNC viewer and was able to to connect to screen 50. I couldn't get the flash vnc viewer (FlashVNC) to work. It uses TightVNC, so that may be why.

 

-dele

Oct 20, 2007 7:12 PM John Stroy John Stroy    says in response to Dele Olajide:

I'm glad to know that it worked.  If you're using this[1] version, I couldn't get it to work, either.  It didn't connect to my UltraVNC server, nor did it connect to any of the vncj hosts--I only saw it send one TCP_SYN packet to UltraNVC in Sysinternals' Process Explorer.

 

1http://osflash.org/fvnc

 

Anyway... I hope you manage to make something useful out of everything.  I'm definitely looking forward to it.

Dec 14, 2007 7:06 PM John Stroy John Stroy    says in response to Dele Olajide:

dele,

 

I nearly forgot I wrote anything about VNC; it's been a long time since I've had anything to do with VNC.  But I noticed all the spam I was getting, and I traced it back to my profile here.  Oddly enough, some stupid harvester took it and spammed it my mail alias to death.  Anyhow, I thought I'd ask: how is the simple desktop sharing stuff for Openfire going?  Nobody has made anything worthy of the title "one click desktop sharing" yet.