IBM's Java MPEG-4 Efforts Bear Fruit
by Chris Adamson
Related link: http://www.alphaworks.ibm.com/tech/tk4mpeg4
In an e-mail to the M4IF technotes mailing-list yesterday, IBM announced a new collection of all-Java MPEG-4 tools. This powerful media standard now has a player and a collection of tools that theoretically runs anywhere. Very, very cool.
Once you download the code, notice that only
.bat files are included. If you are running a non-Windows OS, take the time to groan. Then convert it to a shell script or appropriate. For example, the
M4Play.bat, which looks like this:
java -cp .;IBMToolkitForMpeg4.jar M4Play %*
can be easily rewritten as a unix shell script
java -classpath .:IBMToolkitForMpeg4.jar M4Play $*
Run the batch-file or script with no arguments for an interactive mode, or with the the file path or URL of media to play:
I've only had enough time this morning to play with the decoder client, but it's already a very encouraging improvement over the previous MPEG-4 codec, which could only play MPEG-4 video inside AVI files (a kludgy scheme popularized by DivX), instead of the real .mp4 format. In fact, "where do I get something that this can play?" was a popular comment on the old codec's discussion forum. The new release contains over 100 samples, including 2D graphics, animation, various audio and video codecs, and XMT (MPEG-4's XML-based markup).
And yes, it will play DivX AVI's, real .mp4's, and the AAC files created by the new version of iTunes, if you change their extension from
.mp4 (but it won't play the DRM'ed AAC files from the iTunes Music Store).
If you're on Mac or Windows and have paid for QuickTime Pro, it's easy enough to use the Export menu-item to convert any movie to an ISMA-complient .mp4 file that the IBM player can handle. Here's a shot from a video I made for an upcoming OnJava.com article:
Sharp-eyed readers will notice that:
- The menus on Mac OS X are in the "monolithic" menu bar, suggesting either that IBM made a special Mac-only call to achieve that behavior or, more likely, that this is an AWT application instead of a Swing one.
- My sad little 300 MHz iBook is totally pegged (the green bar at left is my CPU monitor, struggling to keep this video playing). Daddy needs a new G4 PowerBook, pronto.
- My screenshot has a tear in it, meaning I grabbed between frames. Oops.
One other big change from the previous MPEG-4 codec from IBM is that this code does not require the Java Media Framework and indeed, does not seem to use it (a
java -verbose shows which classes are loaded, and JMF's
javax.media package does not appear)
If you've tried out the MPEG-4 package, tell us what you think of it!