Help: JMF to extract video clip properties info

R

Ralph

Dear All,

I would like to extract and edit .mpg video clip properties info.
Including

Stream: MPEG
File Name: a.mpg
Last Modified: Sat, 19 Jul 2003 18:59:10 GMT
File Size: 3,401,288 Bytes
Title: a.mpg
Author:
Copyright:
Comments:
Cover Arts:
Duration: 00:48.142
Buffer Time: 1.5 seconds
Max Bit Rate: 734.8 Kbps
Avg Bit Rate: 565.2 Kbps

Currently I am using the following code. but Can't extract all the
info I need.

String file = "file://C:/tmp/8Mile.mp3";

MediaLocator mediaLocator = new MediaLocator(file);
// media Player
Player player = null;
Processor processor = null;
try {
DataSource ds;
ds = new DataSource();
ds.setLocator(mediaLocator);
ds.connect();
processor = Manager.createProcessor(ds);
processor.configure();
System.out.println("getState:" + processor.getState());

processor.realize();

//player = Manager.createRealizedPlayer(mediaLocator);
System.out.println("Duration:" +
processor.getDuration().getSeconds());
System.out.println("Rate:" + processor.getRate());
System.out.println("ContentType:" +
processor.getContentDescriptor().getContentType());;
System.out.println("MediaTime:" +
processor.getMediaTime().getSeconds());
//player = Manager.createPlayer(ds);
//System.out.println("Player Rate:" + player.getRate());

} catch (NoPlayerException ex) {
ex.printStackTrace();
System.out.println(ex.getMessage());
} catch (IOException ex) {
System.out.println(ex.getMessage());
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top