Need a basic audio & video player library in Java [closed]

By : m35
Source: Stackoverflow.com
Question!

I need to display a series of images (perhaps BufferedImages) with variable frame rates as a video, synchronized with uncompressed audio. I also need the basic media controls of play, pause, seek, audio volume, etc.

Since I don't need to encode, decode, read or write video files, I would prefer to avoid large libraries such as JMF or FMJ. I just need the player. Additionally it would be best to avoid the JNI completely (rules out FMJ), and if the code is open source (rules out JMF).

In essence, I'm looking for the best practices of how to write a Java movie player, or for a library that has already done it. A good example might be Java-only implementation of an uncompressed AVI video player.

Some libraries I've looked at besides JMF and FMJ are: Javid (http://developer.berlios.de/projects/javid/), javampeg1video (http://sourceforge.net/projects/javampeg1video/), java multimedia system (http://sourceforge.net/projects/jmms/) and javavideoplayer (http://sourceforge.net/projects/javavideoplayer/).

Additional detail: I have written a Java decoder for a unique audio/video format (Playstation 1 movies). The project is open source (GPL) and I would like it to be as simple and cross platform as possible. Before saving the decoded video with my simple AVI writer, I want to provide the user with a preview of the decoded video. Thus, as stated above, all I need is the video to sync with played audio as it is all decoded in real-time. It almost seems simple, but I'm sure there are various technical issues of real-time playback in Java that I'm not aware of.

By : m35


Answers

JVLC is quite a good player that uses the ubiquitous VLC player to play all know video formats. However, it breaks the "no JNI" rule you have set.



I don't know if this is what you're looking for, but have you looked at Quicktime for Java here: http://developer.apple.com/quicktime/qtjava/index.html

It says, "QuickTime for Java provides a set of cross-platform APIs which allows Java developers to build multimedia, including streaming audio and video, into applications and applets."



The first possibility to consider is that the compiler's messages are actually right. Surely there were line numbers included in those error messages, so have you looked at the offending lines, and some of the lines preceding them, to try to identify what might really be the cause?

Were there any other messages that came before the ones you've cited? (A missing header, for instance?) Always start addressing compiler messages from the first one; later ones are sometimes just side effects caused by that.

Can you reproduce the problem in a simple project? Is it enough to just write #include <gl.h> in an otherwise empty file and try to compile it? Or is there more about this source code that causes the error to occur?

Remember that you're the one here with access to your code; the questions I'm asking above are the sorts of things you need to consider since you can't always have someone else debug your code for you.



This video can help you solving your question :)
By: admin