- 浏览: 8181 次
- 性别:
- 来自: 上海
文章分类
最新评论
java读取视频时长
最近需要用java处理视频文件,读取视频的时长,在网上查,没找到合适的方法,用JMF吧,支持的格式太少,用JNI去读取其他语言写的API,但比较麻烦。无意中找到了jave这个开源的项目,看了看介绍,是用java来处理多种视频格式之间的转换的,下载了下来,看了看,还真找到了获取视频时长的方法。记录下来,给需要朋友做个参考。
下载jave的网址http://www.sauronsoftware.it/projects/jave/index.php
总共只有一个jar包,API也非常简单,不说了,贴代码:
package com.jave;
import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.MultimediaInfo;
import java.io.File;
public class ReadVideo {
<wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">public static void main(String[] args){</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">File source = new File("E:\\测试视频\\R41.avi");</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">Encoder encoder = new Encoder();</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">try {</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">MultimediaInfo m = encoder.getInfo(source);</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">long ls = m.getDuration();</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">System.out.println("此视频时长为:"+ls/60000+"分"+(ls`000)/1000+"秒!");</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">} catch (Exception e) {</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">e.printStackTrace();</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">jave支持的格式很多,有几十种,有兴趣的朋友可以试试。</span> </wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
下载jave的网址http://www.sauronsoftware.it/projects/jave/index.php
总共只有一个jar包,API也非常简单,不说了,贴代码:
package com.jave;
import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.MultimediaInfo;
import java.io.File;
public class ReadVideo {
<wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">public static void main(String[] args){</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">File source = new File("E:\\测试视频\\R41.avi");</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">Encoder encoder = new Encoder();</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">try {</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">MultimediaInfo m = encoder.getInfo(source);</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">long ls = m.getDuration();</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">System.out.println("此视频时长为:"+ls/60000+"分"+(ls`000)/1000+"秒!");</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">} catch (Exception e) {</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">e.printStackTrace();</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">}</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(248,236,216)">jave支持的格式很多,有几十种,有兴趣的朋友可以试试。</span> </wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
相关推荐
125分50秒---162.81M---LabView01---第10章数据的显示.wmv---F:/Resource/video/硬件/AltiumDesigner/LabView01-第10章数据的显示.wmv 92分2秒---143.46M---LabView02---第11章文件的IO及保存.wmv---F:/Resource/...
Java 获取视频时长、格式、大小需要的jar jave-1.0.2
在java中上传视频时根据需求,使用FFMpeg获取视频的时长
JAVA获取本地视频或者网络URL的时长。附代码和Jar包
java调用ffmpeg转换视频,并读取转换后视频的分辨率、大小以及时长。主要参考http://blog.sina.com.cn/s/blog_a5116c670102wiwj.html 的代码方式。步骤: 1.研究java如何调用外部程序 2.研究ffmpeg转换视频格式的...
java使用Xuggler获得视频时长,分辨率,高宽,码率等信息,其中包括xuggle-xuggler-5.4.jar这个jar包,使用该jar包可直接获取视频的各种信息
这里有视频时长和截取视频封面所需要的Jar包以及代码,供大家学习下载。
Java读取资源文件时内容过长与换行的处理
java 读取视频文件计算播放时长,非常简单
java实现可以获取视频中某一帧的图片,并将图片保存至本地,自定义设置截取图片的宽度和高度,获取视频的总帧数,视频总时长。
java获取网络音乐文件时长,自己整理的三种方法
Java获取视频文件时长,为后面根据视频时长随机获取缩略图做铺垫
Java 处理视频 、音频文件(读取视频时长等) - JAVE-附件资源
计算视频时长所必需的jar包
主要为大家详细介绍了JavaCV获取视频文件时长的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
工程已经打包,很详细的描述,所有工具都已打包好,这里主要是做了视频截图,视频播放时长的获取,其他的内容如果要获取自己可以重新添加命令获取。
该java代码实现了将获取到的语音计算出其长度,方便在页面上播放
官网下载的有用文档,避免访问不了参考用 博文链接:https://gdp8.iteye.com/blog/1535993
这个文件中包含测试的Demo和需要的jar包,Demo中有两种方式来获取视频的分辨率,大小等基本信息,简单易上手,亲测有效,没效你顺着网线过来da我