|
@@ -161,7 +161,10 @@ public class VideoUtil {
|
|
|
}
|
|
|
|
|
|
private static File writeToFile(Frame frame, String saveDir, String fileName) throws Exception {
|
|
|
-
|
|
|
+ File saveDirFile = new File(saveDir);
|
|
|
+ if(!saveDirFile.exists()) {
|
|
|
+ saveDirFile.mkdirs();
|
|
|
+ }
|
|
|
File targetFile = new File(saveDir + File.separator + fileName + ".jpg");
|
|
|
String imgSuffix = "jpg";
|
|
|
|
|
@@ -332,12 +335,14 @@ public class VideoUtil {
|
|
|
try {
|
|
|
//getList(10,113);
|
|
|
|
|
|
- File file = new File("E:/4bcd37e90a0d087c349bbd817b5b4798.mp4");
|
|
|
-// List<File> files = VideoUtil.fetchPicByCount(file, "E:/223", 100);
|
|
|
+ File file = new File("e:/20211223123223_76639ced-6400-11ec-b8f9-fa163e4e1e9f.mp4");
|
|
|
+// List<File> files = VideoUtil.fetchPicByCount(file, "E:/223", 100);
|
|
|
// System.out.println(files.get(0).getName());
|
|
|
// System.out.println(VideoUtil.getVideoTime(file));
|
|
|
-// fetchAllPic(file,"E:/223",new Date());
|
|
|
- cut(file,new File("e:/a.mp4"));
|
|
|
+
|
|
|
+ Date shootEndTime = DateUtils.strToDate("20211223123223","yyyyMMddHHmmss");
|
|
|
+ fetchAllPic(file,"E:/223",shootEndTime);
|
|
|
+// cut(file,new File("e:/a.mp4"));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|