package com.izouma.wenlvju.utils;

import ws.schild.jave.MultimediaObject;
import ws.schild.jave.info.MultimediaInfo;

import java.io.File;

public class VideoUtils {
    public static Long getVideoTime(File file) {
        try {
            MultimediaObject instance = new MultimediaObject(file);
            MultimediaInfo result = instance.getInfo();
            return result.getDuration() / 1000;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 0L;
    }
}
