|
@@ -1,3 +1,4 @@
|
|
|
+/*
|
|
|
package org.jeecg.modules.demo.opencv;
|
|
|
|
|
|
import org.bytedeco.javacv.FFmpegFrameGrabber;
|
|
@@ -8,21 +9,25 @@ import javax.imageio.ImageIO;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.File;
|
|
|
|
|
|
+*/
|
|
|
/**
|
|
|
* 视频截帧处理
|
|
|
- */
|
|
|
+ *//*
|
|
|
+
|
|
|
public class VideoProcessing {
|
|
|
public static String videoPath = "D:/data";
|
|
|
|
|
|
//存放截取视频某一帧的图片
|
|
|
public static String videoFramesPath = "D:/data/images/";
|
|
|
|
|
|
- /**
|
|
|
+ */
|
|
|
+/**
|
|
|
* 将视频文件帧处理并以“jpg”格式进行存储。
|
|
|
* 依赖FrameToBufferedImage方法:将frame转换为bufferedImage对象
|
|
|
*
|
|
|
* @param videoFileName
|
|
|
- */
|
|
|
+ *//*
|
|
|
+
|
|
|
public static String grabberVideoFramer(String videoFileName) {
|
|
|
//最后获取到的视频的图片的路径
|
|
|
String videPicture = "";
|
|
@@ -31,9 +36,11 @@ public class VideoProcessing {
|
|
|
//标识
|
|
|
int flag = 0;
|
|
|
try {
|
|
|
- /*
|
|
|
+ */
|
|
|
+/*
|
|
|
获取视频文件
|
|
|
- */
|
|
|
+ *//*
|
|
|
+
|
|
|
FFmpegFrameGrabber fFmpegFrameGrabber = new FFmpegFrameGrabber(videoPath + "/" + videoFileName);
|
|
|
fFmpegFrameGrabber.start();
|
|
|
|
|
@@ -43,9 +50,11 @@ public class VideoProcessing {
|
|
|
|
|
|
while (flag <= ftp) {
|
|
|
frame = fFmpegFrameGrabber.grabImage();
|
|
|
- /*
|
|
|
+ */
|
|
|
+/*
|
|
|
对视频的第五帧进行处理
|
|
|
- */
|
|
|
+ *//*
|
|
|
+
|
|
|
if (frame != null) {
|
|
|
//文件绝对路径+名字
|
|
|
String fileName = videoFramesPath + String.valueOf(flag) + ".jpg";
|
|
@@ -76,3 +85,4 @@ public class VideoProcessing {
|
|
|
grabberVideoFramer(videoFileName);
|
|
|
}
|
|
|
}
|
|
|
+*/
|