feat: 优化
This commit is contained in:
@@ -151,9 +151,8 @@ public class BatchProduceAlignment {
|
||||
String dateDir = java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
String outputMediaPath = mixDirectory + "/" + dateDir + "/" + targetFileName + ".mp4";
|
||||
|
||||
// 使用默认的阿里云OSS endpoint格式
|
||||
String bucketEndpoint = "https://" + properties.getBucket() + ".oss-" + properties.getRegionId() + ".aliyuncs.com";
|
||||
String outputMediaUrl = bucketEndpoint + "/" + outputMediaPath;
|
||||
// ICE写入必须使用OSS原始域名(不能是CDN域名,因为ICE需要写权限)
|
||||
String outputMediaUrl = properties.getOssWriteUrl(outputMediaPath);
|
||||
|
||||
// ICE需要将处理结果写入到该URL,签名URL会导致写入失败
|
||||
int width = 720;
|
||||
@@ -374,8 +373,8 @@ public class BatchProduceAlignment {
|
||||
String dateDir = java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
String outputMediaPath = mixDirectory + "/" + dateDir + "/" + targetFileName + ".mp4";
|
||||
|
||||
String bucketEndpoint = "https://" + properties.getBucket() + ".oss-" + properties.getRegionId() + ".aliyuncs.com";
|
||||
String outputMediaUrl = bucketEndpoint + "/" + outputMediaPath;
|
||||
// ICE写入必须使用OSS原始域名(不能是CDN域名,因为ICE需要写权限)
|
||||
String outputMediaUrl = properties.getOssWriteUrl(outputMediaPath);
|
||||
|
||||
int width = 720;
|
||||
int height = 1280;
|
||||
|
||||
@@ -53,4 +53,11 @@ public class IceProperties {
|
||||
public boolean isEnabled() {
|
||||
return enabled && StrUtil.isNotBlank(accessKeyId) && StrUtil.isNotBlank(accessKeySecret);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取ICE写入用的OSS URL(必须使用原始域名)
|
||||
*/
|
||||
public String getOssWriteUrl(String path) {
|
||||
return "https://" + bucket + ".oss-" + regionId + ".aliyuncs.com/" + path;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,24 +551,6 @@ public class MixTaskServiceImpl implements MixTaskService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从OSS URL中提取相对路径
|
||||
*/
|
||||
private String extractPathFromUrl(String ossUrl) {
|
||||
if (StrUtil.isEmpty(ossUrl)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 查找 ".aliyuncs.com/" 的位置
|
||||
int index = ossUrl.indexOf(".aliyuncs.com/");
|
||||
if (index == -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 提取 "/" 后的路径
|
||||
return ossUrl.substring(index + ".aliyuncs.com/".length());
|
||||
}
|
||||
|
||||
/**
|
||||
* 将DO分页结果转换为VO分页结果,消除冗余代码
|
||||
* 优化点:
|
||||
|
||||
Reference in New Issue
Block a user