转码
This commit is contained in:
parent
ef5823cd43
commit
343dcbeb54
@ -58,6 +58,8 @@ public class VlogController extends BaseInfoProperties {
|
|||||||
(List<Map<String, Object>>) procedureStateChangeEvent.get("MediaProcessResultSet");
|
(List<Map<String, Object>>) procedureStateChangeEvent.get("MediaProcessResultSet");
|
||||||
|
|
||||||
if (mediaProcessResultSet != null) {
|
if (mediaProcessResultSet != null) {
|
||||||
|
String coverUrl=null; // 首帧图
|
||||||
|
String transVdUrl=null; // 转码后的视频地址
|
||||||
for (Map<String, Object> processResult : mediaProcessResultSet) {
|
for (Map<String, Object> processResult : mediaProcessResultSet) {
|
||||||
String type = (String) processResult.get("Type");
|
String type = (String) processResult.get("Type");
|
||||||
if ("CoverBySnapshot".equals(type)) {
|
if ("CoverBySnapshot".equals(type)) {
|
||||||
@ -65,12 +67,20 @@ public class VlogController extends BaseInfoProperties {
|
|||||||
Map<String, Object> coverBySnapshotTask =
|
Map<String, Object> coverBySnapshotTask =
|
||||||
(Map<String, Object>) processResult.get("CoverBySnapshotTask");
|
(Map<String, Object>) processResult.get("CoverBySnapshotTask");
|
||||||
Map<String, Object> output = (Map<String, Object>) coverBySnapshotTask.get("Output");
|
Map<String, Object> output = (Map<String, Object>) coverBySnapshotTask.get("Output");
|
||||||
String coverUrl = (String) output.get("CoverUrl"); // 正确获取 CoverUrl
|
coverUrl = (String) output.get("CoverUrl"); // 正确获取 CoverUrl
|
||||||
log.info("任务流 [截取首帧] 完成, FileId: {}, 封面图 URL: {}", fileId, coverUrl);
|
|
||||||
// TODO: 更新数据库,存储首帧图,设置云端地址,删除本地视频文件
|
}
|
||||||
vlogService.updateVlogFirstImg(fileId,coverUrl,fileUrl);
|
if("Transcode".equals(type)){
|
||||||
|
// 拿到output中的url
|
||||||
|
Map<String, Object> TranscodeTask =
|
||||||
|
(Map<String, Object>) processResult.get("TranscodeTask");
|
||||||
|
Map<String, Object> output = (Map<String, Object>) TranscodeTask.get("Output");
|
||||||
|
transVdUrl = (String) output.get("Url");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.info("任务流 [截取首帧,视频转码,添加水印] 完成, FileId: {}, 封面图 URL: {},视频地址: {}", fileId, coverUrl,transVdUrl);
|
||||||
|
// TODO: 更新数据库,存储首帧图,设置云端地址,删除本地视频文件
|
||||||
|
vlogService.updateVlogFirstImg(fileId,coverUrl,transVdUrl);
|
||||||
} else {
|
} else {
|
||||||
log.warn("MediaProcessResultSet 为空,回调数据: {}", callbackData);
|
log.warn("MediaProcessResultSet 为空,回调数据: {}", callbackData);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user