Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hazard-sdk/pom.xml
gao.qiang 2 vuotta sitten
vanhempi
commit
c792d37b7a

+ 1 - 0
business-service/src/main/resources/mapper/service/BaseCameraManagementMapper.xml

@@ -2,4 +2,5 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ozs.service.mapper.BaseCameraManagementMapper">
 
+
 </mapper>

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

@@ -206,6 +206,7 @@ public class CameraUtil {
         String substr = fromVideoFileList.get(0).substring(0, fromVideoFileList.get(0).lastIndexOf("/"));
         log.info("substr:{}", substr);
         Runtime.getRuntime().exec("chmod 777 " + substr);
+        // 转化为临时文件 .ts  放入到 voidTS里面
         for (int i = 0; i < fromVideoFileList.size(); i++) {
             String fromVideoFile = fromVideoFileList.get(i);
             File file1 = new File(fromVideoFile);
@@ -256,11 +257,13 @@ public class CameraUtil {
                 log.info("文件不存在:{}", fromVideoFile);
             }
         }
+        log.info("ffmpegPath:{}", ffmpegPath);
         List<String> dos = new ArrayList<>();
         StringBuffer tsPath = new StringBuffer();
         tsPath.append(ffmpegPath);
         tsPath.append(" -i ");
         tsPath.append("concat:");
+        log.info("voidTS:{}", voidTS);
         for (int t = 0; t < voidTS.size(); t++) {
             if (t != voidTS.size() - 1) {
                 tsPath.append(voidTS.get(t) + "|");
@@ -275,6 +278,7 @@ public class CameraUtil {
         tsPath.append(" -movflags ");
         tsPath.append(" +faststart ");
         tsPath.append(newfilePath);
+        log.info("执行的命令:{}", tsPath.toString());
         Process pr = Runtime.getRuntime().exec(
                 tsPath.toString());
         process.getInputStream();
@@ -282,7 +286,13 @@ public class CameraUtil {
         pr.getInputStream().close();
         pr.getErrorStream().close();
         try {
-            pr.waitFor();
+            int i = pr.waitFor();
+            System.out.println("********");
+            log.info("********");
+            System.out.println(i);
+            log.info(i + "");
+            log.info("********");
+            System.out.println("********");
         } catch (InterruptedException e) {
             log.error(e.getMessage());
             e.printStackTrace();
@@ -290,10 +300,11 @@ public class CameraUtil {
             pr.destroy();
         }
         //删除生成的ts文件
-        for (String filePath : voidTS) {
-            File filet = new File(filePath);
-            filet.delete();
-        }
+//        for (String filePath : voidTS) {
+//            File filet = new File(filePath);
+//            filet.delete();
+//            pr.destroy();
+//        }
     }
 
     public static void main(String[] args) throws IOException {

+ 11 - 0
hazard-sdk/pom.xml

@@ -48,6 +48,17 @@
             <artifactId>druid-spring-boot-starter</artifactId>
             <version>1.2.15</version>
         </dependency>
+        <!--        &lt;!&ndash; 系统模块&ndash;&gt;-->
+        <dependency>
+            <groupId>com.ozs</groupId>
+            <artifactId>base-system</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-security</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
         <!-- 业务代码-->
         <dependency>
             <groupId>com.ozs</groupId>