视觉智能平台视频人像增强的签名params.put("Version", "2019-09-30");这个参数在API文档中没找到,应该填什么日期的版本?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
您好,视觉智能开放平台人像增强的版本号建议可以填2020-03-20尝试,根据示例代码可以看出来
// 引入依赖包
// 最低SDK版本要求:videoenhan20200320的SDK版本需大于等于2.0.14。
// 可以在此仓库地址中引用最新版本SDK:https://mvnrepository.com/artifact/com.aliyun/videoenhan20200320
// <dependency>
//       <groupId>com.aliyun</groupId>
//       <artifactId>videoenhan20200320</artifactId>
//       <version>${aliyun.videoenhan.version}</version>
// </dependency>
import com.aliyun.tea.TeaException;
import com.aliyun.tea.TeaModel;
import com.aliyun.videoenhan20200320.models.EnhancePortraitVideoResponse;
public class EnhancePortraitVideo {
    public static com.aliyun.videoenhan20200320.Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
        /*
          初始化配置对象com.aliyun.teaopenapi.models.Config
          Config对象存放 AccessKeyId、AccessKeySecret、endpoint等配置
         */
         com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
                .setAccessKeyId(accessKeyId)
                .setAccessKeySecret(accessKeySecret);
        // 访问的域名
        config.endpoint = "videoenhan.cn-shanghai.aliyuncs.com";
        return new com.aliyun.videoenhan20200320.Client(config);
    }
    public static void main(String[] args) throws Exception {
        // 创建AccessKey ID和AccessKey Secret,请参见:https://help.aliyun.com/document_detail/175144.html
        // 如果您使用的是RAM用户的AccessKey,还需要为子账号授予权限AliyunVIAPIFullAccess,请参见:https://help.aliyun.com/document_detail/145025.html
        // 从环境变量读取配置的AccessKey ID和AccessKey Secret。运行代码示例前必须先配置环境变量。
        String accessKeyId = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID");
        String accessKeySecret = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"); 
        com.aliyun.videoenhan20200320.Client client = EnhancePortraitVideo.createClient(accessKeyId, accessKeySecret);
        com.aliyun.videoenhan20200320.models.EnhancePortraitVideoRequest enhancePortraitVideoRequest = new com.aliyun.videoenhan20200320.models.EnhancePortraitVideoRequest()
                .setVideoUrl("http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/videoenhan/SuperResolveVideo/SuperResolveVideo5.mp4");
        com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
        try {
            // 复制代码运行请自行打印 API 的返回值
            EnhancePortraitVideoResponse response = client.enhancePortraitVideoWithOptions(enhancePortraitVideoRequest, runtime);
            System.out.println(com.aliyun.teautil.Common.toJSONString(TeaModel.buildMap(response)));
        } catch (TeaException error) {
            // 获取整体报错信息
            System.out.println(com.aliyun.teautil.Common.toJSONString(error));
            // 获取单个字段
            System.out.println(error.getCode());
        }
    }
}