ehlxr 1 éve
szülő
commit
4c07d81591

+ 3 - 3
etl-core/src/main/java/com/tzld/crawler/etl/service/impl/EtlServiceImpl.java

@@ -243,15 +243,15 @@ public class EtlServiceImpl implements EtlService {
         String strategy = data.getStrategy();
         String audioUrl = data.getAudioUrl();
 
-        String videoPath = urlDownload(data.getVideoUrl(), "longvideo/crawler_local/data", title);
+        String videoPath = urlDownload(data.getVideoUrl(), "longvideo/crawler_local/video", title);
         // 音、视频合成
         if (!Strings.isNullOrEmpty(audioUrl)) {
             String auditPath = urlDownload(data.getAudioUrl(), "longvideo/crawler_local/audit", title);
             VideoUtils.videoCompose(ffmpegPath, downloadPath + File.separator + videoPath,
-                    downloadPath + File.separator + auditPath, downloadPath + File.separator + videoPath + "_comp");
+                    downloadPath + File.separator + auditPath, downloadPath + File.separator + videoPath + "_comp.mp4");
             // 清理未合成音频的视频文件
             Files.deleteIfExists(Paths.get(new File(downloadPath + File.separator + videoPath).getPath()));
-            videoPath += "_comp";
+            videoPath += "_comp.mp4";
         }
 
         // 视频上传 oss

+ 7 - 0
etl-core/src/main/java/com/tzld/crawler/etl/util/VideoUtils.java

@@ -87,4 +87,11 @@ public class VideoUtils {
             throw new CommonException(ExceptionEnum.DATA_ERROR, "video compose error");
         }
     }
+
+
+    public static void main(String[] args) {
+        videoCompose("ffmpeg", "/datalog/crawler/videos/longvideo/crawler_local/video/dev/20230628/7628fedb3f1abf460733da698c7fc169",
+                "/datalog/crawler/videos/longvideo/crawler_local/audit/dev/20230628/7628fedb3f1abf460733da698c7fc169",
+                "/datalog/crawler/videos/longvideo/crawler_local/video/dev/20230628/34b192c574330bbcaf008b3c90e565b9_comp111100000");
+    }
 }