my dog learned polymorphism
The moose likes Java in General and the fly likes reading .WMV files through Java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "reading .WMV files through Java" Watch "reading .WMV files through Java" New topic
Author

reading .WMV files through Java

Johnny Gara
Ranch Hand

Joined: Mar 09, 2007
Posts: 43
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
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.


Android appsImageJ pluginsJava web charts
Charles Lyons
Author
Ranch Hand

Joined: Mar 27, 2003
Posts: 836
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:

http://www.microsoft.com/windows/windowsmedia/forpros/format/asfspec.aspx

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 / Amazon Amazon 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.
 
subject: reading .WMV files through Java
 
Similar Threads
res.setContentType: what is correct for wmv file type
WMV player for all major platforms
Metadata extractor for Video file
Working with .wmv files
how to embed wmv file in html