wangyunpeng 3 hete
szülő
commit
4df12253f6

+ 5 - 1
src/main/java/com/tzld/ffmpeg/service/impl/FFmpegServiceImpl.java

@@ -595,7 +595,7 @@ public class FFmpegServiceImpl implements FFmpegService {
         List<String> allLocalFilePathList = new ArrayList<>();
 
         try {
-            String inputFile = FFmpegUtil.pathCreate("./datalog/ffmpeg/command/input/" + param.getOutputFile());
+            String inputFile = FFmpegUtil.pathCreate("./datalog/ffmpeg/command/input/" + getFileNameByUrl(param.getInputFile()));
             allLocalFilePathList.add(inputFile);
             downloadFile(CdnUtil.getOssHttpUrl(param.getInputFile()), inputFile);
             ffmpegCommand = ffmpegCommand.replace(param.getInputFile(), inputFile);
@@ -640,6 +640,10 @@ public class FFmpegServiceImpl implements FFmpegService {
 
     }
 
+    private String getFileNameByUrl(String inputFile) {
+        return inputFile.substring(inputFile.lastIndexOf("/") + 1);
+    }
+
     private List<String> splitCommands(String ffmpegCommand) {
         List<String> parts = new ArrayList<>();
         boolean inQuotes = false;