<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-all-deps</artifactId>
<version>2.5.1</version>
</dependency>
try {
URL url = new URL(fileUrl);
// File file = new File();
MultimediaObject multimediaObject = new MultimediaObject(url);
long duration = (multimediaObject.getInfo().getDuration())/1000;
} catch (EncoderException | MalformedURLException | UnsupportedEncodingException e) {
logger.info(e.toString());
}