How that might work?
Vyew's clever desktop sharing to flash player using a Java applet.
If you haven't seen it yet Vyew is an online meeting/desktop sharing web application which for the moment at least is free to use. It's very much a direct competitor to Adobe's own Acrobat Connect (formerly Macromedia Breeze), which much sting a little since it's using Flash as the delivery platform.
What really intrigued me about it was that it was able to do desktop capture. Although this can be done when using Adobe Acrobat Connect, desktop recording is not something that can be done using Flash player alone. Macromedia didn't provide this functionality as part of the Flash player, presumably to prevent Flash based competition to Breeze. From what I gather, the way the Vyew site does it (on my Mac at least) is to work around this issue by using a java applet to do desktop capture.
That java could do this was news to me. It turns out there is a built in class java.awt.Robot that makes it pretty easy to do. I discovered this when I took a look at the source for the open source Screen Recorder by One Stone Soup.
But what do you do with a bit map image of your screen once you have captured it with the Robot class? Well if you want to playback the video through flash like Vyew does then the best way to encode it would be using the Screen Video FLV codec. The FLV video encoder that came with Flash IDE used to allow you to encode video with this codec, but they took away this option with the encoders after Flash MX 2004 I believe. Fortunately there isn't much to the Codec as I found out when I took a look at another opensource project libFLV. From the looks of the implementation in libflv the Screen Video codec just uses zlib style compression. You wouldn't be able to use libFLV out of the can with java though because it is written in C. A java port of it would have to be written, this isn't insurmountable though. Java comes out of the box with compatible compression methods. I had half a mind to take a crack at it myself. With that in mind I started looking for documentation on the FLV format.
Adobe does have documentation on FLV format available for developers, unfortunately the license tied to it restricts it from being used for anything like a screen recording java application, or applet. Fortunately OsFlash.org has some pretty good documentation on the the FLV format.
In theory (or should I say in practice since Vyew is already doing it) it should be possible to write a Java application that can record your desktop and write that data as a stream of data in the FLV format using the Screen Video codec, but how do you get that stream into your friends' the flash players? Unfortunately Flash Media Server does not support the Screen Video codec, at least that's what I read online. I found mention of it supporting it in the beta online, but apparently was removed for the public release. I guess it is only available in the version used for the Acrobat Connect/Breeze server. So even if you could get the FLV stream to the flash communication server, it couldn't stream it to the flash clients.
Enter another opensource project, Red5. Not only does Red5 support streaming of the Screen Video Codec, they also have proof of concept code for a java RTMP client in their SVN repository. With the the Red5 Java based RTMP client and server we have the components necessary for sending a FLV stream to a server, and for relaying in realtime to other the flash player on other peoples computers.
Besides putting the pieces together into a signed java applet, the only thing that is really missing is a Java library that can compress a sequence of images to FLV using the Screen Recording Codec. Sure it would be a bit of work but all the pieces are there.
And what about other FLV codecs? On2 VP6 is proprietary, and there aren't any opensource projects that can create or read FLVs using that codec. However there are a few projects for reading and writing the Sorenson codec, such as FFMPEG. How can they do that you might ask? Well the Sorenson Codec is compatible with the open H.263 codec. Java supports encoding and decoding of H.263 as part of the Java Media Framework. You can also capture video from a webcam using JMF. As for audio, JMF supports MP3, and ADPCM recording encoding and decoding.
So it looks like there are a lot of ways you could use Java to create, manipulate, decode, and even stream FLV video files. As developers continue to put these pieces together I suspect we will see lots of cool applications like Vyew in the near future.
http://blog.onepixeloff.com/trackback.cfm?1888286F-ADC7-0FEB-A75AD074E7854203
As we are working on something similar, you should check once in a while www.streamingbase.com for the desktop sharing stuff.
Once again, thanks for the valuable info.
There is though another way one could record the screen and send it to server. Assoon as I make all the tests I will write here my idea.
Kind regards,
SoniX