hexiao 2 年之前
父节点
当前提交
cffd99bf67
共有 1 个文件被更改,包括 12 次插入12 次删除
  1. 12 12
      hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

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

@@ -72,21 +72,15 @@ public class CameraUtil {
         if (ObjectUtils.isEmpty(fromVideoFileList) || fromVideoFileList.size() <= 0) {
             throw new BaseException("当前相机无视频录像");
         }
-        Thread thread = new Thread(() -> {
+        new Thread(() -> {
             try {
                 myConvetor(fromVideoFileList, NewfilePath, uuid);
             } catch (IOException e) {
                 log.error(e.getMessage());
                 e.printStackTrace();
             }
-        });
-        thread.start();
-        try {
-            thread.sleep(10000);
-        } catch (InterruptedException e) {
-            log.error(e.getMessage());
-            e.printStackTrace();
-        }
+        }).start();
+
         return Constants.RESOURCE_PREFIX + "/" + ph;
     }
 
@@ -306,15 +300,21 @@ public class CameraUtil {
             commands.add(commit);
             // 临时文件转化为 flv
             commands.add(commit1);
-
-            commands.add("rm -rf " + pathStr + "/" + substring);
-
             log.info("录像视频命令:{}", commands);
             for (String line : commands) {
                 log.info("命令:{}", line);
                 out.println(line);
             }
+            try {
+                Thread.currentThread().sleep(10000);
+            } catch (InterruptedException e) {
+                log.error(e.getMessage());
+                e.printStackTrace();
+            }
+            out.println("rm -rf " + pathStr + "/" + substring);
+            log.info("命令:{}", "rm -rf " + pathStr + "/" + substring);
             out.println("exit");// 这个命令必须执行,否则in流不结束。
+            log.info("命令:{}", "exit");
             String rspLine = "";
             while ((rspLine = in.readLine()) != null) {
                 log.info("*****:{}", rspLine);