当前位置: 代码迷 >> 综合 >> jave 1.0.3 视频解析 工具
  详细解决方案

jave 1.0.3 视频解析 工具

热度:49   发布时间:2023-12-28 04:18:13.0

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