hexiao 2 years ago
parent
commit
c240f5258b
1 changed files with 9 additions and 2 deletions
  1. 9 2
      hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

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

@@ -72,14 +72,21 @@ public class CameraUtil {
         if (ObjectUtils.isEmpty(fromVideoFileList) || fromVideoFileList.size() <= 0) {
             throw new BaseException("当前相机无视频录像");
         }
-        new Thread(() -> {
+        Thread thread = new Thread(() -> {
             try {
                 myConvetor(fromVideoFileList, NewfilePath, uuid);
             } catch (IOException e) {
                 log.error(e.getMessage());
                 e.printStackTrace();
             }
-        }).start();
+        });
+        thread.start();
+        try {
+            thread.sleep(10000);
+        } catch (InterruptedException e) {
+            log.error(e.getMessage());
+            e.printStackTrace();
+        }
         return Constants.RESOURCE_PREFIX + "/" + ph;
     }