jave1.0.3
maven依赖代码
<dependency><groupId>com.github.dadiyang</groupId><artifactId>jave</artifactId><version>1.0.3</version></dependency>
来自阿里云maven仓库
https://maven.aliyun.com/
package com.jave;import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.MultimediaInfo;
import java.io.File;
public class ReadVideo {public static void main(String[] args) {File source = new File("E:\\测试视频\\R41.avi");Encoder encoder = new Encoder();try {MultimediaInfo m = encoder.getInfo(source);long ls = m.getDuration();int second = ls \ 1000;System.out.println("此视频时长为:" + second + "秒!");} catch (Exception e) {e.printStackTrace();}}
原文:https://blog.csdn.net/xie_sining/article/details/79643152