wenhongquan 3 月之前
父節點
當前提交
0ac6c986c8
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      ruoyi-admin/src/main/java/org/dromara/web/task/KafkaMessageConsumer.java

+ 4 - 1
ruoyi-admin/src/main/java/org/dromara/web/task/KafkaMessageConsumer.java

@@ -25,6 +25,7 @@ import org.dromara.system.service.ITblDeviceService;
 import org.dromara.system.service.ITblEventService;
 import org.dromara.system.utils.Utils;
 import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -44,6 +45,8 @@ public class KafkaMessageConsumer {
     private String finalEventChangeTime = "400";
 
 
+    @Value("${user.ffmpegpath}")
+    private String ffmpegFilePath = "/usr/local/bin/ffmpeg";
     @Scheduled(cron = "*/1 * * * * *")
     public void doChange() {
 //        System.out.println("事件判断");
@@ -191,7 +194,7 @@ public class KafkaMessageConsumer {
         File file = HttpUtil.downloadFileFromUrl(path, FileUtil.file("./temp/"));
         try{
             String pathfile = "./"+ UUID.fastUUID()+".mp4";
-            Utils.exchangeToMp4("/Users/wenhongquan/miniforge3/bin/ffmpeg",file.toPath().toString(),pathfile);
+            Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
             FileUtil.del(file);
             file =  new File(pathfile);;
         }catch (Exception e){