|
@@ -70,14 +70,16 @@ public class VideoFileProcessor {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String urlType = videoUrl.getUrlType();
|
|
String urlType = videoUrl.getUrlType();
|
|
|
|
|
+ String url = objectNameService.getObjectUrl(objectName);
|
|
|
|
|
+ long bitRate = videoUrl.getBitRate();
|
|
|
String quality = videoUrl.getQuality();
|
|
String quality = videoUrl.getQuality();
|
|
|
int width = videoUrl.getWidth();
|
|
int width = videoUrl.getWidth();
|
|
|
int height = videoUrl.getHeight();
|
|
int height = videoUrl.getHeight();
|
|
|
- String url = objectNameService.getObjectUrl(objectName);
|
|
|
|
|
- VideoUrl videoUrl1 = new VideoUrl(videoFileId, videoFileId, urlType, url, quality, width, height);
|
|
|
|
|
|
|
+ int order = 1;
|
|
|
|
|
+ VideoUrl videoUrl1 = new VideoUrl(videoFileId, videoFileId, urlType, url, bitRate, quality, width, height, order);
|
|
|
|
|
|
|
|
mediaRepository.saveVideoFile(videoFile1, videoUrl1);
|
|
mediaRepository.saveVideoFile(videoFile1, videoUrl1);
|
|
|
- return new UploadFileRet(videoFileId, url);
|
|
|
|
|
|
|
+ return new UploadFileRet(videoFileId, url, true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String absolutePath = objectResult.getAbsolutePath();
|
|
String absolutePath = objectResult.getAbsolutePath();
|
|
@@ -118,11 +120,12 @@ public class VideoFileProcessor {
|
|
|
String objectId1 = objectResult1.getObjectId();
|
|
String objectId1 = objectResult1.getObjectId();
|
|
|
String url1 = objectNameService.getObjectUrl(objectName1);*/
|
|
String url1 = objectNameService.getObjectUrl(objectName1);*/
|
|
|
|
|
|
|
|
|
|
+ long bitRate = videoProps.getBitRate();
|
|
|
MediaResolution mediaResolution = MediaQuality.getQuality(width, height);
|
|
MediaResolution mediaResolution = MediaQuality.getQuality(width, height);
|
|
|
String urlType = FileType.getVideoUrlType(absolutePath);
|
|
String urlType = FileType.getVideoUrlType(absolutePath);
|
|
|
- VideoUrl videoUrl = new VideoUrl(videoFileId, videoFileId, urlType, originalUrl, mediaResolution);;
|
|
|
|
|
|
|
+ VideoUrl videoUrl = new VideoUrl(videoFileId, videoFileId, urlType, originalUrl, bitRate, mediaResolution);
|
|
|
mediaRepository.saveVideoFile(videoFile, videoUrl);
|
|
mediaRepository.saveVideoFile(videoFile, videoUrl);
|
|
|
- return new UploadFileRet(videoFileId, originalUrl);
|
|
|
|
|
|
|
+ return new UploadFileRet(videoFileId, originalUrl, true);
|
|
|
//log.info("添加视频格式转码任务");
|
|
//log.info("添加视频格式转码任务");
|
|
|
//threadPool.submit(new ConvertTask());
|
|
//threadPool.submit(new ConvertTask());
|
|
|
}
|
|
}
|
|
@@ -151,8 +154,9 @@ public class VideoFileProcessor {
|
|
|
String objectId = objectResult.getObjectId();
|
|
String objectId = objectResult.getObjectId();
|
|
|
String url = objectNameService.getObjectUrl(objectResult.getObjectName());
|
|
String url = objectNameService.getObjectUrl(objectResult.getObjectName());
|
|
|
String urlType = FileType.getVideoUrlType(absolutePath);
|
|
String urlType = FileType.getVideoUrlType(absolutePath);
|
|
|
|
|
+ long bitRate = 0;
|
|
|
MediaResolution mediaResolution = MediaQuality.getQuality(width, height);
|
|
MediaResolution mediaResolution = MediaQuality.getQuality(width, height);
|
|
|
- return new VideoUrl(videoFileId, objectId, urlType, url, mediaResolution);
|
|
|
|
|
|
|
+ return new VideoUrl(videoFileId, objectId, urlType, url, bitRate, mediaResolution);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|