Pure-Java Screen Recorder (obsolete)
I am working on a new AVIWriter class, which provides a higher level API than the AVIOutputStream class.
There is still a long way to go, so I decided to write a screen recorder as a demo for the upcoming class.
This recorder uses java.awt.Robot to capture the screen, and java.awt.MouseInfo for capturing the mouse cursor.
Screen changes are captured with a frame rate of up to 15 fps. Mouse cursor movements with up to 30 fps.
For encoding the videos with AVI, I have implemented the Techsmith Screen Capture Codec in pure Java. This codec is essentially the Microsoft RLE encoder with ZIP compression applied to each video frame.
To play back a recorded video, you may have to install the free codec from www.techsmith.com.
For QuickTime, the videos are encoded with the Apple Animation codec, which I already had implemented some time ago.
You can download the file ScreenRecorder.jar. Double click the file to start the screen recorder. The .jar file also includes the source code of the recorder. The code is preliminary, and may substantially change in future releases.
A newer version of the screen recorder is available at http://www.randelshofer.ch/monte
The code described in this article is obsolete. Stay tuned for a new recorder which also supports audio capture in AVI files.
The rate of screen and mouse captures can now be adjusted individually.
I have added support for audio capture. This feature is currently only available with QuickTime videos, since AVIWriter is not finished yet. Audio is recorded from line-in. Line-in is usually the microphone of the computer.
I have changed the code so that it will record into the home folder “Videos” on Windows, and into ”Movies” on Mac OS X and everywhere else. In the prior version, recording silently failed if this folder did not exist. Now, an error message is displayed.
I have closed the comment section for this article, because the screen recorder class is obsolete. Take a look at the Monte Media Library for newer versions.