• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

extracting video features

 
divija sri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2839
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2839
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any other way apart from jmf to find video features???
 
Paul Clapham
Sheriff
Posts: 21114
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic