Writing AVI videos in pure Java
Since writing QuickTime videos in pure Java turned out to be relatively easy, I gave today a try at an AVI encoder for PNG and Motion-JPEG encoded videos.
The AVIOuputStream class is freely available as part of my CubeTwister source code. You can download a small demo which only contains the AVIOutputStream and all necessary sources here: AVIDemo.jar. Running the demo will create a Motion JPEG-encoded and a PNG-encoded AVI video.
I am not sure, if AVI supports PNG-encoded videos at all, because Microsoft Media Player 11 can’t play them. The QuickTime player works fine with them though.
The source code is available under the terms of the Creative Commons Attribution 3.0 license.
Update 2012-02-04: The demo code described in this article is obsolete. The latest version of the code is available on the following page: http://www.randelshofer.ch/monte
Update 2011-01-17: AVIOutputStream can now also write RLE-encoded videos with a depth of 8-bits per pixel.
Update 2009-08-30: AVIOutputStream can now also write RAW-encoded video.