jave获取视频时长(视频信息)

jave下载地址:http://www.sauronsoftware.it/projects/jave/index.php

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();
             System.out.println(s/1000+"秒!");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


你可能感兴趣的:(jave获取视频时长(视频信息))