|
@@ -31,6 +31,8 @@ public class FfmpegUtilServiceImpl implements FfmpegUtilService {
|
|
|
|| StringUtils.isEmpty(fetchKeyFramesParam.getTimestamp())) {
|
|
|
return CommonResponse.create(500, "参数错误");
|
|
|
}
|
|
|
+ log.info("fetchKeyFramesParam={}", fetchKeyFramesParam);
|
|
|
+ log.info("imagePath={}", imagePath);
|
|
|
String imageFolder = imagePath + "/" + "timeTarget";
|
|
|
File dir = new File(imageFolder);
|
|
|
if (!dir.exists()) {
|
|
@@ -40,11 +42,13 @@ public class FfmpegUtilServiceImpl implements FfmpegUtilService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
String imagePath = imageFolder + "/" + UUID.randomUUID() + ".jpg";
|
|
|
String target = "long_articles/image";
|
|
|
|
|
|
FfmpegUtil.getTargetTimeThumbnail(fetchKeyFramesParam.getUrl(), imagePath, fetchKeyFramesParam.getTimestamp());
|
|
|
String imageUrl = OSSUploader.uploadToOSS(target, imagePath);
|
|
|
+ log.info("imageUrl={}", imageUrl);
|
|
|
Path pathToDelete = Paths.get(imagePath);
|
|
|
try {
|
|
|
// 使用 Files.walkFileTree 删除文件夹及其内容
|