aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes extracting video features Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "extracting video features" Watch "extracting video features" New topic
Author

extracting video features

divija sri
Greenhorn

Joined: Mar 23, 2012
Posts: 4
how do i extract video features like size,length,bitrate and other meta tags.i read that JMF API is used for it.i do not have any idea about it.can someone explain it with sample code.thanks in advance
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
The http://www.coderanch.com/how-to/java/OtherOpenSourceProjectsFaq page links to numerous libraries for handling video formats; some of those are bound to work for whatever video formats you're dealing with. They all have example code on their sites or as part of the distribution, or, in the case of JMF, linked from that page as well.
divija sri
Greenhorn

Joined: Mar 23, 2012
Posts: 4
thank you for your reply.i have gone through the articles.i could extract the video length successfully.but i want to get the vduration of the video without actually playing it.how can i do that???
URL url = this.getClass().getResource( resourceName );
Player p = Manager.createPlayer( url );
p.start();
int state = p.getState();
while( state != Controller.Started )
{
try
{
Thread.sleep( 100 );
state = p.getState();
}
catch( Exception e )
{
e.printStackTrace();
}
}
Time duration = p.getDuration();

i tried the above code.but if i do not start the player then it gives an erroneous value 9.223372036854776E9
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Haven't tried it myself. But I'm sure at least some of those APIs provide information without actually playing the file.
divija sri
Greenhorn

Joined: Mar 23, 2012
Posts: 4
is there any other way apart from jmf to find video features???
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Sure, you could read the specifications for the video formats you were interested in, and once you had understood them, you could write code based on those specifications which extracted the metadata you wanted to get.
 
jQuery in Action, 2nd edition
 
subject: extracting video features