jPSXdec is a cross-platform PlayStation 1 media decoder/converter.
Get the latest version here.

Tuesday, January 27, 2009

Java real-time video playback

Much of the easy changes have already been made to jPSXdec. The biggest and hardest change left is implementing real-time playback. To do this in pure Java is tricky. I've spent a month looking at every kind of Java video player out there.

I want to keep jPSXdec as cross-platform and simple-to-use as possible (Just Work™). So while the JMF has Java-only implementations for playback, it needs a separate installation, has far more functionality that I need, and being closed source doesn't help. It's curious that even though the JMF has plenty of documented bugs, and hasn't been updated in years, it's still the de facto Java media standard. Meanwhile, the FMJ library is open source, but it's even bigger than JMF, and uses JNI to wield each platform's native playing capabilities. I've examined various other small libraries, but nothing met my needs: a simple synchronized audio and video player. So I'm stuck trying to figure out how to do it myself.

Initially I thought to duplicate the general design of JMF/FMJ since it seems to work for them. It would also help someone with greater familiarity with those libs to take the next step and properly integrate PSX decoding into them. However, after several days of tearing apart those massive libraries, and seeing I'd only scratched the surface, I dropped that idea.

Finally went back and took a closer look at SurePlayer. It plays mpeg1 movies great with very little processor use. It's fully cross-platform, and is a much more digestible library, so I'll be using that as a guide for implementation. With this clear direction, I can push forward with more jPSXdec development. Maybe in several years when Java 7 is ubiquitous, jPSXdec can be changed to utilize the new JMC.

Also during my searchings I serendipitously ran across a Java library to handle cross-platform raw CD reading! It's not quite as clean as I would like, but it's a pretty good foundation to build upon.

In other news, we've had a couple translators pop out of the woodwork recently. Will they be the salvation this project so desperately needs?

A man can dream.