Browse Source

添加日志信息

syh 5 năm trước cách đây
mục cha
commit
b4e9694297

+ 6 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/opencv/service/impl/FfmpegServiceImpl.java

@@ -319,22 +319,28 @@ public class FfmpegServiceImpl implements IFfmpegService {
             //3.1 抽取音频文件
             String srcM4aFilePath = splitSrcPath + "src.m4a";
             getM4aFromMp4(srcFilePath, srcM4aFilePath);
+            log.info("提取原始音频文件成功:{}", srcM4aFilePath);
             String fillM4aFilePath = splitSrcPath + "fill.m4a";
             getM4aFromMp4(fillFilePath, fillM4aFilePath);
+            log.info("提取填充音频文件成功:{}", fillM4aFilePath);
             //3.2 截取源模板音频文件
             String cutM4aFilePath = splitSrcPath + "cut.m4a";
             //计算需要截取的音频时长
             String secondStr = getSecond(exchangeStartFrameNum);
             cutM4a(srcM4aFilePath, cutM4aFilePath, "00:00:00.000", secondStr);
+            log.info("音频文件截取成功:{}", cutM4aFilePath);
             //3.3 合并两个音频文件
             String finalM4aFilePath = splitSrcPath + "final.m4a";
             audioMosaic(cutM4aFilePath, fillM4aFilePath, finalM4aFilePath);
+            log.info("音频文件合成成功:{}", finalM4aFilePath);
             //3.4 将最终生成的图片合成为视频
             String noVoiceVideoFilePath = splitSrcPath + "novoice.mp4";
             mergeImageToVideo(splitFinalPath, 25, noVoiceVideoFilePath);
+            log.info("图片合成视频成功:{}", noVoiceVideoFilePath);
             //3.5 合并视频和音频
             String finalVideoFilePath = splitSrcPath + "final.mp4";
             mergeAudioAndVideo(noVoiceVideoFilePath, finalM4aFilePath, finalVideoFilePath);
+            log.info("视频文件合成成功:{}", finalVideoFilePath);
             //3.6 上传视频文件至OSS并返回url存入数据库
             InputStream inputStream = new FileInputStream(finalVideoFilePath);
             String finalUrl = OSSUtils.uploadFile2OSS(inputStream, "model/final/", videoInfo.getId() + "_" + current + ".mp4");

+ 3 - 1
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -139,6 +139,8 @@ mybatis-plus:
       log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 #jeecg专用配置
 jeecg:
+  ffmpeg:
+    bin: D:\java\ffmpeg\bin\ffmpeg.exe
   path:
     #文件上传根目录 设置
     #文件上传根目录 设置
@@ -168,4 +170,4 @@ oss:
   replace:
     replace-value: oss-cn-beijing-internal
     replace-old-value: oss-cn-beijing
-    download: /mnt/file/video/
+    download: /mnt/file/video/