全部产品
云市场

视频DNA

更新时间:2019-01-17 13:43:50

初始化客户端

使用前请先初始化客户端,参考 initVodClient 接口。

提交视频DNA作业

接口参数和返回字段请参考 SubmitAIJob

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * 提交作业
  8. */
  9. VodApiResponse submitAIJob(VodCredential authInfo) {
  10. string apiName = "SubmitAIJob";
  11. map<string, string> args;
  12. // 设置视频ID
  13. args["MediaId"] = "3eb19a4585bc475e995bddxxxxxxxx";
  14. // 设置AI类型,类型为AIMediaDNA
  15. args["Types"] = "AIMediaDNA";
  16. return getAcsResponse(authInfo, apiName, args);
  17. }
  18. // 请求示例
  19. void main() {
  20. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  21. VodApiResponse response = submitAIJob(authInfo);
  22. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  23. }

查询视频DNA作业

接口参数和返回字段请参考 ListAIJob

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * 查询作业
  8. */
  9. VodApiResponse listAIJob(VodCredential authInfo) {
  10. string apiName = "ListAIJob";
  11. map<string, string> args;
  12. // 设置作业ID
  13. args["JobIds"] = "979d4d7a36ae41b1a945a2xxxxx,3eb19a4585bc475e995bddeaxxxxx";
  14. return getAcsResponse(authInfo, apiName, args);
  15. }
  16. // 请求示例
  17. void main() {
  18. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  19. VodApiResponse response = listAIJob(authInfo);
  20. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  21. }

获取视频DNA结果

接口参数和返回字段请参考 GetMediaDNAResult

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * 查询结果
  8. */
  9. VodApiResponse getMediaDNAResult(VodCredential authInfo) {
  10. string apiName = "GetMediaDNAResult";
  11. map<string, string> args;
  12. // 设置视频ID
  13. args["MediaId"] = "3eb19a4585bc475e995bddxxxxxxxx";
  14. return getAcsResponse(authInfo, apiName, args);
  15. }
  16. // 请求示例
  17. void main() {
  18. VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  19. VodApiResponse response = getMediaDNAResult(authInfo);
  20. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  21. }