views:

307

answers:

3

I need a media information extraction library (pure Java or JNI wrapper) that can handle common media formats. I primarily use it for video files and I need at least these information:

  1. Video length (Runtime)
  2. Video bitrate
  3. Video framerate
  4. Video format and codec
  5. Video size (width X height)
  6. Audio channels
  7. Audio format
  8. Audio bitrate and sampling rate

There are several libraries and tools around but I couldn't find for Java.

+1  A: 

You don't need a framework for this stuff, for example AVI video container format has a 56 byte header containing all the relevant metadata. There's bunch of other formats on that site too, all of them seem to be quite trivial to implement.

Esko
I am not writing a media informatin extraction tool, so I don't want to learn each media format and implement proper extraction class. Also note that there are numerous container formats that have much more complex structure (and some of them are proprietary), AVI is one of the simplest case.
eyazici
A: 

Try Xuggler. Here's some Xuggler source code that queries a media file and prints out all sorts of useful meta-data.

  • Art
Xuggle
A: 

Have you tried Java Media Framework API http://java.sun.com/javase/technologies/desktop/media/jmf/ but I am not sure if it will have enough support as Xuggle above which uses FFMpeg, the only advantage of using this would be cross platform support.

Archimedes Trajano