The following function works for me:
/**
* Fetches a video's duration in microseconds.
*
* @param videoFile
* @return
*/
public long getVideoDuration(String videoFile) {
// Create a Xuggler container object
IContainer container = IContainer.make();
// Open up the container
if (container.open(videoFile, IContainer.Type.READ, null) < 0) {
throw new IllegalArgumentException("Could not open file: " + videoFile);
}
return container.getDuration();
}
Dilip
--------------------------------------------------
From: "ryan" <sean...@gmail.com>
Sent: Saturday, May 29, 2010 5:10 AM
To: "xuggler-users" <xuggle...@googlegroups.com>
Subject: [xuggler-users] Getting the duration from video stream
> --
> You received this message because you are subscribed to the Google Groups
> "xuggler-users" group.
> To post to this group, send email to xuggle...@googlegroups.com.
> To unsubscribe from this group, send email to
> xuggler-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/xuggler-users?hl=en.
>
>
(container.open(thefile.getStream(),null) < 0){
Sent from my iPhone
On 30 May 2010, at 05:50 p.m., "Dilip Shah" <dilip...@hotmail.com>
wrote: