• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

reading .WMV files through Java

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic