Our product team has investigated the requirement on their end. Unfortunately, there is no an easy way to determine the duration of extracted video because different video formats have completely different formats of their metadata. After discussion, we have created an example with use another library in combination with slides.
Code snippet based on Xuggler(http://www.xuggle.com/xuggler/):
static long getVideoDuration(String path)
// first we create a Xuggler container object
IContainer container = IContainer.make();
// we attempt to open up the container
int result = container.open(path, IContainer.Type.READ, null);
// check if the operation was successful
throw new RuntimeException(“Failed to open media file”);
// query for the total duration
long duration = container.getDuration();
The above code will help you in getting the video duration.