com.qcloud.cos.demo.ci.QualityEstimateJobDemo Maven / Gradle / Ivy
package com.qcloud.cos.demo.ci;
import com.qcloud.cos.COSClient;
import com.qcloud.cos.model.ciModel.job.MediaAudioObject;
import com.qcloud.cos.model.ciModel.job.MediaContainerObject;
import com.qcloud.cos.model.ciModel.job.MediaJobObject;
import com.qcloud.cos.model.ciModel.job.MediaJobOperation;
import com.qcloud.cos.model.ciModel.job.MediaJobResponse;
import com.qcloud.cos.model.ciModel.job.MediaJobsRequest;
import com.qcloud.cos.model.ciModel.job.MediaListJobResponse;
import com.qcloud.cos.model.ciModel.job.MediaTimeIntervalObject;
import com.qcloud.cos.model.ciModel.job.MediaTransConfigObject;
import com.qcloud.cos.model.ciModel.job.MediaTranscodeObject;
import com.qcloud.cos.model.ciModel.job.MediaTranscodeVideoObject;
import com.qcloud.cos.model.ciModel.job.QualityEstimateConfig;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
* 媒体处理 视频质量评分任务接口相关demo 详情见https://cloud.tencent.com/document/product/460/84783
*/
public class QualityEstimateJobDemo {
public static void main(String[] args) throws Exception {
// 1 初始化用户身份信息(secretId, secretKey)。
COSClient client = ClientUtils.getTestClient();
// 2 调用要使用的方法。
describeMediaJob(client);
}
/**
* createMediaJobs 接口用于创建视频质量评分
* demo 使用转码参数创建任务 推荐使用模板创建视频质量评分
*
* @param client
*/
public static void createMediaJobs(COSClient client) {
//1.创建任务请求对象
MediaJobsRequest request = new MediaJobsRequest();
//2.添加请求参数 参数详情请见api接口文档
request.setBucketName("demo-123456789");
request.setTag("QualityEstimate");
request.getInput().setObject("1.mp4");
//2.1添加视频质量评分操作参数
QualityEstimateConfig qualityEstimateConfig = request.getOperation().getQualityEstimateConfig();
qualityEstimateConfig.setRotate("90");
qualityEstimateConfig.setMode("vqaPlus");
request.setCallBack("https://cloud.tencent.com/xxx");
//3.调用接口,获取任务响应对象
MediaJobResponse response = client.createMediaJobs(request);
System.out.println(response.getJobsDetail().getJobId());
}
/**
* describeMediaJob 根据jobId查询任务信息
*
* @param client
*/
public static void describeMediaJob(COSClient client) {
//1.创建任务请求对象
MediaJobsRequest request = new MediaJobsRequest();
//2.添加请求参数 参数详情请见api接口文档
request.setBucketName("demo-123456789");
request.setJobId("j1d9d24d81a7f11ee943ac9b157*****");
//3.调用接口,获取任务响应对象
MediaJobResponse response = client.describeMediaJob(request);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy