Browse Source

代码修改

gao.qiang 1 year ago
parent
commit
13fc71b312
1 changed files with 4 additions and 1 deletions
  1. 4 1
      vehicle-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

+ 4 - 1
vehicle-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

@@ -723,6 +723,7 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
             for (String line : commands) {
                 out.println(line);
             }
+            out.println("exit");// 这个命令必须执行,否则in流不结束。
             String rspLine = "";
             while ((rspLine = in.readLine()) != null) {
                 System.out.println(rspLine);
@@ -731,7 +732,9 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
             int i = proc.waitFor();
             log.info("执行结果:{}", i);
 
-            
+            in.close();
+            out.close();
+            proc.destroy();
         } catch (IOException e) {
             log.error(e.getMessage());
         } catch (InterruptedException e) {