java截取第一帧(Java代码实现上传获取某一帧作为截图封面)
上一个文章讲了Java代码实现上传视频获取视频某一帧作为截图封面的一种方法,现在讲述第二种方法为什么要在这里讲这种方法呢?第一、这种方法生成的图片占用的空间更小第二、这种方法可以获取很多信息,我来为大家科普一下关于java截取第一帧?以下内容希望对你有帮助!
java截取第一帧
上一个文章讲了Java代码实现上传视频获取视频某一帧作为截图封面的一种方法,现在讲述第二种方法。为什么要在这里讲这种方法呢?第一、这种方法生成的图片占用的空间更小第二、这种方法可以获取很多信息
一、跟上一篇文章一样导入Maven项目所需要的依赖,这里不在复制,可以去上篇文章看一下
二、废话不多说直接上代码
package com.basic.common.utils;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.FrameGrabber;
import org.bytedeco.javacv.Frame;
import org.bytedeco.javacv.Java2DFrameConverter;
import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
/**
* @author summer
* @date 2021-11-02 15:42
*/
public class VideoUtils2 implements MultipartFile {
private final byte[] imgContent;
private final String header;
public VideoUtils2(byte[] imgContent, String header) {
this.imgContent = imgContent;
this.header = header;
}
public static String fetchFrame(String videoPath) {
FFmpegFrameGrabber ff = null;
byte[] data = null;
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
ff = new FFmpegFrameGrabber(videoPath);
ff.start();
int lenght = ff.getLengthInFrames();
int i = 0;
Frame f = null;
while (i < lenght) {
// 过滤前5帧,避免出现全黑的图片 这个根据自己的情况来定,这里就以5秒作为测试
f = ff.grabFrame();
if ((i > 5) && (f.image != null)) {
break;
}
i ;
}
BufferedImage bi = new Java2DFrameConverter().getBufferedImage(f);
String rotate = ff.getVideoMetadata("rotate");
if (rotate != null) {
bi = rotate(bi, Integer.parseInt(rotate));
}
ImageIO.write(bi, "jpg", os);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (ff != null) {
ff.stop();
}
} catch (FrameGrabber.Exception e) {
e.printStackTrace();
}
}
BASE64Encoder encoder = new BASE64Encoder();
return "data:image/jpg;base64," encoder.encode(os.toByteArray());
}
public static BufferedImage rotate(BufferedImage src, int angel) {
int src_width = src.getWidth(null);
int src_height = src.getHeight(null);
int type = src.getColorModel().getTransparency();
Rectangle rect_des = calcRotatedSize(new Rectangle(new Dimension(src_width, src_height)), angel);
BufferedImage bi = new BufferedImage(rect_des.width, rect_des.height, type);
Graphics2D g2 = bi.createGraphics();
g2.translate((rect_des.width - src_width) / 2, (rect_des.height - src_height) / 2);
g2.rotate(Math.toRadians(angel), src_width / 2, src_height / 2);
g2.drawImage(src, 0, 0, null);
g2.dispose();
return bi;
}
/**
* 将base64转换成MultipartFile
* @param base64
* @return
*/
public static MultipartFile base64ToMultipart(String base64) {
try {
String[] baseStrs = base64.split(",");
BASE64Decoder decoder = new BASE64Decoder();
byte[] b = new byte[0];
b = decoder.decodeBuffer(baseStrs[1]);
for(int i = 0; i < b.length; i) {
if (b[i] < 0) {
b[i] = 256;
}
}
return new VideoUtils2(b, baseStrs[0]);
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
public static Rectangle calcRotatedSize(Rectangle src, int angel) {
if (angel >= 90) {
if(angel / 90 % 2 == 1) {
int temp = src.height;
src.height = src.width;
src.width = temp;
}
angel = angel % 90;
}
double r = Math.sqrt(src.height * src.height src.width * src.width) / 2;
double len = 2 * Math.sin(Math.toRadians(angel) / 2) * r;
double angel_alpha = (Math.PI - Math.toRadians(angel)) / 2;
double angel_dalta_width = Math.atan((double) src.height / src.width);
double angel_dalta_height = Math.atan((double) src.width / src.height);
int len_dalta_width = (int) (len * Math.cos(Math.PI - angel_alpha - angel_dalta_width));
int len_dalta_height = (int) (len * Math.cos(Math.PI - angel_alpha - angel_dalta_height));
int des_width = src.width len_dalta_width * 2;
int des_height = src.height len_dalta_height * 2;
return new Rectangle(new Dimension(des_width, des_height));
}
@Override
public String getOriginalFilename() {
return null;
}
@Override
public String getName() {
return null;
}
@Override
public String getContentType() {
return header.split(":")[1];
}
@Override
public long getSize() {
return imgContent.length;
}
@Override
public boolean isEmpty() {
return imgContent == null || imgContent.length == 0;
}
@Override
public byte[] getBytes() throws IOException {
return imgContent;
}
@Override
public void transferTo(File dest) throws IOException, IllegalStateException {
new FileOutputStream(dest).write(imgContent);
}
@Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(imgContent);
}
}
切记包一定要导对哦
下面就是测试代码
public void testPic1() throws IOException {
String s = VideoUtils2.fetchFrame("D:\\testdemo\\testdemo.mp4");
VideoUtils2.base64ToMultipart(s).transferTo(new File("D:\\testdemo\\good.jpg"));
}
控制台输出如下
C:\software\jdk1.8\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2021.1\lib\idea_rt.jar=54594:C:\Program Files\JetBrains\IntelliJ IDEA 2021.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2021.1\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2021.1\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2021.1\plugins\junit\lib\junit-rt.jar;C:\software\jdk1.8\jre\lib\charsets.jar;C:\software\jdk1.8\jre\lib\deploy.jar;C:\software\jdk1.8\jre\lib\ext\access-bridge-64.jar;C:\software\jdk1.8\jre\lib\ext\cldrdata.jar;C:\software\jdk1.8\jre\lib\ext\dnsns.jar;C:\software\jdk1.8\jre\lib\ext\jaccess.jar;C:\software\jdk1.8\jre\lib\ext\jfxrt.jar;C:\software\jdk1.8\jre\lib\ext\localedata.jar;C:\software\jdk1.8\jre\lib\ext\nashorn.jar;C:\software\jdk1.8\jre\lib\ext\sunec.jar;C:\software\jdk1.8\jre\lib\ext\sunjce_provider.jar;C:\software\jdk1.8\jre\lib\ext\sunmscapi.jar;C:\software\jdk1.8\jre\lib\ext\sunpkcs11.jar;C:\software\jdk1.8\jre\lib\ext\zipfs.jar;C:\software\jdk1.8\jre\lib\javaws.jar;C:\software\jdk1.8\jre\lib\jce.jar;C:\software\jdk1.8\jre\lib\jfr.jar;C:\software\jdk1.8\jre\lib\jfxswt.jar;C:\software\jdk1.8\jre\lib\jsse.jar;C:\software\jdk1.8\jre\lib\management-agent.jar;C:\software\jdk1.8\jre\lib\plugin.jar;C:\software\jdk1.8\jre\lib\resources.jar;C:\software\jdk1.8\jre\lib\rt.jar;D:\ideaworkspace\demobasic\basic-project\target\classes;C:\Users\Summer\.m2\repository\eu\bitwalker\UserAgentUtils\1.19\UserAgentUtils-1.19.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter-aop\2.2.5.RELEASE\spring-boot-starter-aop-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter\2.2.5.RELEASE\spring-boot-starter-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.2.5.RELEASE\spring-boot-starter-logging-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\Summer\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\Summer\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.12.1\log4j-to-slf4j-2.12.1.jar;C:\Users\Summer\.m2\repository\org\apache\logging\log4j\log4j-api\2.12.1\log4j-api-2.12.1.jar;C:\Users\Summer\.m2\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;C:\Users\Summer\.m2\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\Users\Summer\.m2\repository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-aop\5.2.4.RELEASE\spring-aop-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-beans\5.2.4.RELEASE\spring-beans-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\aspectj\aspectjweaver\1.9.5\aspectjweaver-1.9.5.jar;C:\Users\Summer\.m2\repository\org\jsoup\jsoup\1.12.1\jsoup-1.12.1.jar;C:\Users\Summer\.m2\repository\com\github\oshi\oshi-core\3.9.1\oshi-core-3.9.1.jar;C:\Users\Summer\.m2\repository\net\java\dev\jna\jna-platform\4.5.2\jna-platform-4.5.2.jar;C:\Users\Summer\.m2\repository\net\java\dev\jna\jna\4.5.2\jna-4.5.2.jar;C:\Users\Summer\.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\Users\Summer\.m2\repository\com\github\penggle\kaptcha\2.3.2\kaptcha-2.3.2.jar;C:\Users\Summer\.m2\repository\javax\servlet\javax.servlet-api\4.0.1\javax.servlet-api-4.0.1.jar;C:\Users\Summer\.m2\repository\com\jhlabs\filters\2.0.235-1\filters-2.0.235-1.jar;C:\Users\Summer\.m2\repository\org\apache\poi\poi-ooxml\3.17\poi-ooxml-3.17.jar;C:\Users\Summer\.m2\repository\org\apache\poi\poi\3.17\poi-3.17.jar;C:\Users\Summer\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar;C:\Users\Summer\.m2\repository\org\apache\poi\poi-ooxml-schemas\3.17\poi-ooxml-schemas-3.17.jar;C:\Users\Summer\.m2\repository\org\apache\xmlbeans\xmlbeans\2.6.0\xmlbeans-2.6.0.jar;C:\Users\Summer\.m2\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;C:\Users\Summer\.m2\repository\com\github\virtuald\curvesapi\1.04\curvesapi-1.04.jar;C:\Users\Summer\.m2\repository\org\apache\commons\commons-lang3\3.9\commons-lang3-3.9.jar;C:\Users\Summer\.m2\repository\commons-io\commons-io\2.5\commons-io-2.5.jar;C:\Users\Summer\.m2\repository\commons-fileupload\commons-fileupload\1.3.3\commons-fileupload-1.3.3.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-spring\1.7.1\shiro-spring-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-web\1.7.1\shiro-web-1.7.1.jar;C:\Users\Summer\.m2\repository\org\owasp\encoder\encoder\1.2.2\encoder-1.2.2.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-core\1.7.1\shiro-core-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-lang\1.7.1\shiro-lang-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-cache\1.7.1\shiro-cache-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-crypto-hash\1.7.1\shiro-crypto-hash-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-crypto-core\1.7.1\shiro-crypto-core-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-crypto-cipher\1.7.1\shiro-crypto-cipher-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-config-core\1.7.1\shiro-config-core-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-config-ogdl\1.7.1\shiro-config-ogdl-1.7.1.jar;C:\Users\Summer\.m2\repository\commons-beanutils\commons-beanutils\1.9.4\commons-beanutils-1.9.4.jar;C:\Users\Summer\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-event\1.7.1\shiro-event-1.7.1.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-ehcache\1.7.1\shiro-ehcache-1.7.1.jar;C:\Users\Summer\.m2\repository\net\sf\ehcache\ehcache-core\2.6.11\ehcache-core-2.6.11.jar;C:\Users\Summer\.m2\repository\net\mingsoft\shiro-freemarker-tags\0.1\shiro-freemarker-tags-0.1.jar;C:\Users\Summer\.m2\repository\commons-codec\commons-codec\1.13\commons-codec-1.13.jar;C:\Users\Summer\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\Summer\.m2\repository\com\google\zxing\javase\3.1.0\javase-3.1.0.jar;C:\Users\Summer\.m2\repository\com\google\zxing\core\3.1.0\core-3.1.0.jar;C:\Users\Summer\.m2\repository\org\quartz-scheduler\quartz\2.3.2\quartz-2.3.2.jar;C:\Users\Summer\.m2\repository\com\mchange\mchange-commons-java\0.2.15\mchange-commons-java-0.2.15.jar;C:\Users\Summer\.m2\repository\org\springframework\integration\spring-integration-mail\5.2.4.RELEASE\spring-integration-mail-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\integration\spring-integration-core\5.2.4.RELEASE\spring-integration-core-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\io\projectreactor\reactor-core\3.3.3.RELEASE\reactor-core-3.3.3.RELEASE.jar;C:\Users\Summer\.m2\repository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;C:\Users\Summer\.m2\repository\org\springframework\retry\spring-retry\1.2.5.RELEASE\spring-retry-1.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-messaging\5.2.4.RELEASE\spring-messaging-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\net\sourceforge\jexcelapi\jxl\2.6.12\jxl-2.6.12.jar;C:\Users\Summer\.m2\repository\com\alibaba\fastjson\1.2.6\fastjson-1.2.6.jar;C:\Users\Summer\.m2\repository\com\sun\mail\javax.mail\1.4.5\javax.mail-1.4.5.jar;C:\Users\Summer\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\Summer\.m2\repository\com\mortennobel\java-image-scaling\0.8.6\java-image-scaling-0.8.6.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-core\5.2.4.RELEASE\spring-core-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-jcl\5.2.4.RELEASE\spring-jcl-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-context\5.2.4.RELEASE\spring-context-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-expression\5.2.4.RELEASE\spring-expression-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-context-support\5.2.4.RELEASE\spring-context-support-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-tx\5.2.4.RELEASE\spring-tx-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\freemarker\freemarker\2.3.29\freemarker-2.3.29.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-all\1.2.4\shiro-all-1.2.4.jar;C:\Users\Summer\.m2\repository\org\apache\shiro\shiro-guice\1.2.4\shiro-guice-1.2.4.jar;C:\Users\Summer\.m2\repository\com\google\inject\guice\3.0\guice-3.0.jar;C:\Users\Summer\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\Summer\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\Summer\.m2\repository\com\google\inject\extensions\guice-multibindings\3.0\guice-multibindings-3.0.jar;C:\Users\Summer\.m2\repository\mysql\mysql-connector-java\8.0.19\mysql-connector-java-8.0.19.jar;C:\Users\Summer\.m2\repository\com\alibaba\druid-spring-boot-starter\1.1.10\druid-spring-boot-starter-1.1.10.jar;C:\Users\Summer\.m2\repository\com\alibaba\druid\1.1.10\druid-1.1.10.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.2.5.RELEASE\spring-boot-autoconfigure-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-configuration-processor\2.2.5.RELEASE\spring-boot-configuration-processor-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter-freemarker\2.2.5.RELEASE\spring-boot-starter-freemarker-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.2.5.RELEASE\spring-boot-starter-web-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.2.5.RELEASE\spring-boot-starter-json-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.10.2\jackson-databind-2.10.2.jar;C:\Users\Summer\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.2\jackson-annotations-2.10.2.jar;C:\Users\Summer\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.10.2\jackson-core-2.10.2.jar;C:\Users\Summer\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.2\jackson-datatype-jdk8-2.10.2.jar;C:\Users\Summer\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.2\jackson-datatype-jsr310-2.10.2.jar;C:\Users\Summer\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.2\jackson-module-parameter-names-2.10.2.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.2.5.RELEASE\spring-boot-starter-tomcat-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.31\tomcat-embed-core-9.0.31.jar;C:\Users\Summer\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.31\tomcat-embed-el-9.0.31.jar;C:\Users\Summer\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.31\tomcat-embed-websocket-9.0.31.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter-validation\2.2.5.RELEASE\spring-boot-starter-validation-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\jakarta\validation\jakarta.validation-api\2.0.2\jakarta.validation-api-2.0.2.jar;C:\Users\Summer\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.18.Final\hibernate-validator-6.0.18.Final.jar;C:\Users\Summer\.m2\repository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;C:\Users\Summer\.m2\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-web\5.2.4.RELEASE\spring-web-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-webmvc\5.2.4.RELEASE\spring-webmvc-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\com\baomidou\mybatis-plus-boot-starter\3.1.2\mybatis-plus-boot-starter-3.1.2.jar;C:\Users\Summer\.m2\repository\com\baomidou\mybatis-plus\3.1.2\mybatis-plus-3.1.2.jar;C:\Users\Summer\.m2\repository\com\baomidou\mybatis-plus-extension\3.1.2\mybatis-plus-extension-3.1.2.jar;C:\Users\Summer\.m2\repository\com\baomidou\mybatis-plus-core\3.1.2\mybatis-plus-core-3.1.2.jar;C:\Users\Summer\.m2\repository\com\baomidou\mybatis-plus-annotation\3.1.2\mybatis-plus-annotation-3.1.2.jar;C:\Users\Summer\.m2\repository\com\github\jsqlparser\jsqlparser\1.2\jsqlparser-1.2.jar;C:\Users\Summer\.m2\repository\org\mybatis\mybatis\3.5.1\mybatis-3.5.1.jar;C:\Users\Summer\.m2\repository\org\mybatis\mybatis-spring\2.0.1\mybatis-spring-2.0.1.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\2.2.5.RELEASE\spring-boot-starter-jdbc-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\com\zaxxer\HikariCP\3.4.2\HikariCP-3.4.2.jar;C:\Users\Summer\.m2\repository\org\springframework\spring-jdbc\5.2.4.RELEASE\spring-jdbc-5.2.4.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot-devtools\2.2.5.RELEASE\spring-boot-devtools-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\springframework\boot\spring-boot\2.2.5.RELEASE\spring-boot-2.2.5.RELEASE.jar;C:\Users\Summer\.m2\repository\org\projectlombok\lombok\1.18.12\lombok-1.18.12.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacv\1.4.1\javacv-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\flycapture\2.11.3.121-1.4.1\flycapture-2.11.3.121-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\libdc1394\2.2.5-1.4.1\libdc1394-2.2.5-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\libfreenect\0.5.3-1.4.1\libfreenect-0.5.3-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\libfreenect2\0.2.0-1.4.1\libfreenect2-0.2.0-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\librealsense\1.12.1-1.4.1\librealsense-1.12.1-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\videoinput\0.200-1.4.1\videoinput-0.200-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\artoolkitplus\2.3.1-1.4.1\artoolkitplus-2.3.1-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\flandmark\1.07-1.4.1\flandmark-1.07-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp\1.4.1\javacpp-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv-platform\3.4.1-1.4.1\opencv-platform-3.4.1-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-android-arm.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-android-arm64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-android-x86.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-android-x86_64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-ios-arm64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-ios-x86_64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-linux-x86.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-linux-x86_64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-linux-armhf.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-linux-ppc64le.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-macosx-x86_64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-windows-x86.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\opencv\3.4.1-1.4.1\opencv-3.4.1-1.4.1-windows-x86_64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg-platform\3.4.2-1.4.1\ffmpeg-platform-3.4.2-1.4.1.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-android-arm.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-android-arm64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-android-x86.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-android-x86_64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-linux-x86.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-linux-x86_64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-linux-armhf.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-linux-ppc64le.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-macosx-x86_64.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-windows-x86.jar;C:\Users\Summer\.m2\repository\org\bytedeco\javacpp-presets\ffmpeg\3.4.2-1.4.1\ffmpeg-3.4.2-1.4.1-windows-x86_64.jar;C:\Users\Summer\.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\Summer\.m2\repository\org\hamcrest\hamcrest-core\2.1\hamcrest-core-2.1.jar;C:\Users\Summer\.m2\repository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.basic.common.TestCase,testPic1
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000003fc8e0] overread end of atom 'colr' by 1 bytes
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\testdemo\testdemo.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.33.100
copyright :
copyright-eng :
Duration: 00:00:15.10, start: 0.000000, bitrate: 1410 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 432x960, 1386 kb/s, 29.45 fps, 29.42 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 48 kb/s (default)
Metadata:
handler_name : SoundHandler
Process finished with exit code 0
免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com