|
@@ -24,6 +24,8 @@
|
|
|
|
|
|
package com.tzld.crawler.etl.util;
|
|
|
|
|
|
+import com.tzld.crawler.etl.common.enums.ExceptionEnum;
|
|
|
+import com.tzld.crawler.etl.common.exception.CommonException;
|
|
|
import com.tzld.crawler.etl.model.dto.VideoInfoDto;
|
|
|
import net.bramp.ffmpeg.FFprobe;
|
|
|
import net.bramp.ffmpeg.probe.FFmpegProbeResult;
|
|
@@ -31,6 +33,7 @@ import net.bramp.ffmpeg.probe.FFmpegStream;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -86,6 +89,10 @@ public class VideoUtils {
|
|
|
"-c:v", "copy", "-c:a", "aac", "-strict", "experimental", "-map", "0:v:0", "-map", "1:a:0", outPath);
|
|
|
Process process = processBuilder.start();
|
|
|
process.waitFor();
|
|
|
+
|
|
|
+ if (!new File(outPath).exists()) {
|
|
|
+ throw new CommonException(ExceptionEnum.DATA_ERROR, "video synthesis failed, No synthesized video file output.");
|
|
|
+ }
|
|
|
// } catch (Exception e) {
|
|
|
// log.error("video {} audio {} synthesis error.", videoPath, audioPath, e);
|
|
|
// throw new CommonException(ExceptionEnum.DATA_ERROR, "video synthesis error");
|