I'm not entirely sure if this is the right thread but I was wondering if anyone has any experience (or could give me the heads up) on how would one go about reading a .wmv or .wma file and retrieving the meta data in java.
I don't want to necessarily want to play it in java Just read the info.
Thanks!
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
On OS X you could use the Flip4Mac Windows Media components for QuickTime, and then get that information through Quicktime for Java. I'm not aware that a similar component exists for Windows, but I haven't looked.
There'a also a plugin for JMF (FOBS), which uses the ffmpeg library to add support for multiple formats, including Windows Media.
How much experience do you have with reading binary file formats? If sufficient, you might find it easiest (and most optimised) to write code to directly examine the ASF headers in the file. The ASF format is available openly from Microsoft here:
They technically stipulate that if you implement any of the spec. you must also implement all mandatory sections, which would include all the audio decoding too - which is a bit of a pain when you only want the metadata. However, if you were to only implement the headers, who are we to stop you?
You probably want to look at the Content Description Object (section 3.10 in the ASF spec.), and skip over all the other data in the file. You might also want to use java.nio classes to help with the decoding (e.g. byte order).
That would give you a 100% pure Java optimised implementation.
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.