Jelajahi Sumber

替换合并视频代码

hexiao 1 tahun lalu
induk
melakukan
165676a92d

+ 3 - 16
hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

@@ -394,14 +394,7 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.flv
 
                 String cmdstr = ffmpegPath + " -i " + fromVideoFileList.get(t) + " -c:v copy " + substring + ".ts";
                 log.info("转换命令:{}", cmdstr);
-
-                executor.submit(new Runnable() {
-                    @Override
-                    public void run() {
-                        cUtil.cmd(cmdstr);
-                    }
-                });
-
+                cUtil.cmd(cmdstr);
                 fileTs.add(substring + ".ts");
                 if (t != fromVideoFileList.size() - 1) {
                     sm.append(substring + ".ts|");
@@ -414,15 +407,9 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.flv
         if (fileTs.size() > 0) {
             sm.append("-c copy " + newfilePath);
             log.info("合并命令:{}", sm.toString());
-            executor.submit(new Runnable() {
-                @Override
-                public void run() {
-                    cUtil.cmd(sm.toString());
-                }
-            });
-
+            cUtil.cmd(sm.toString());
         }
-        Thread.sleep(1000L);
+        Thread.sleep(2000L);
         for (String fileT : fileTs) {
             File ft = new File(fileT);
             if (ft.exists()) {