Browse Source

使用文件参数方式合并,仅为备份代码,未测试

Aladding 9 months ago
parent
commit
49cefa9e1f
1 changed files with 4 additions and 5 deletions
  1. 4 5
      hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

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

@@ -442,9 +442,8 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         	validFileList.add(filePath);
         	log.info("file:{}", filePath);
         	
-        	argFileTxt.append("file ")
-        		.append("'").append(filePath).append(".").append(System.lineSeparator());
-        	
+        	argFileTxt.append("file '").append(filePath).append("'")
+        			.append(System.lineSeparator());
         });
         
         if (!flay) {
@@ -467,8 +466,8 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         }
         
         StringBuilder cmd = new StringBuilder(ffmpegPath);
-        cmd.append(" concat -i")
-        		.append(argFileName)
+        cmd.append(" -f concat -i ")
+        		.append(argFile.getAbsolutePath())
 	        	.append(" -c copy ")
 	        	.append(newfilePath);