|
@@ -192,14 +192,16 @@ public class KafkaMessageConsumer {
|
|
|
FileUtil.mkdir("./temp/");
|
|
|
}
|
|
|
File file = HttpUtil.downloadFileFromUrl(path, FileUtil.file("./temp/"));
|
|
|
- try{
|
|
|
- String pathfile = "./"+ UUID.fastUUID()+".mp4";
|
|
|
- Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
|
|
|
- FileUtil.del(file);
|
|
|
- file = new File(pathfile);;
|
|
|
- }catch (Exception e){
|
|
|
-
|
|
|
+ if(path.endsWith(".mp4")){
|
|
|
+ try{
|
|
|
+ String pathfile = "./"+ UUID.fastUUID()+".mp4";
|
|
|
+ Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
|
|
|
+ FileUtil.del(file);
|
|
|
+ file = new File(pathfile);;
|
|
|
+ }catch (Exception e){
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
SysOssVo oss = SpringUtils.getBean(ISysOssService.class).upload(file);
|
|
|
FileUtil.del(file);
|
|
|
return oss.getFileName();
|