JAVIDHugg's Projects

JAVa VIDeo. Get it? Ha ha.

Back in the infant days of Java, this was my attempt to make Java do video natively (without a plugin).

Since Java is too slow for traditional codecs, I designed a custom "block copying codec". This method breaks each frame up into 8x8 blocks. For a set of frames, the codec tries to organize a set of the most dissimilar blocks, and place it into a 512x512 bitmap. It then outputs instructions on how to take the 512x512 bitmap and move the blocks onto the screen in order to create video. Since the bitmap is JPEG-compressed, we get that part of the compression for "free" ... in other words, the JPEG decompression is in native code, already written, and we don't have to worry about it. So the decoder is really tiny, about 300 lines, and it runs as fast as your network and graphics card can keep up.

The problem with this is that the video quality really sucked. To get effective bitrates, you really need something like MPEG with the subpixel motion compensation and all the nifty features. Still, this was enough for "talking head" video at 30 FPS.

But on the subject of talking heads ... where's Java's sound support? It's not really documented, is it? I ended up writing a simple ADPCM decoder and writing it to the sun.audio.AudioStream class, but that's an undocumented (and therefore dangerous) way to do things. Synchronization between video and audio is nearly impossible with this approach.

Eventually, CPUs and JVMs got faster, and the Java Multimedia Framework was integrated into the JDK. Thus better approaches became feasible, and this experiement was terminated.

Downloads

javiddmo.zip (258605 bytes) - The JAVID demo

Instructions:

  1. Unzip this file to a directory, setting the option to retain directory structure.
  2. Follow the directions in the README.TXT file.


Steven E. Hugg / email