• Post Reply Bookmark Topic Watch Topic
  • New Topic

reading .WMV files through Java  RSS feed

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!