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: 2407
posted
0
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
posted
0
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: 2407
posted
0
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
posted
0
is there any other way apart from jmf to find video features???
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.