全部产品
云市场

视频DNA

更新时间:2018-12-27 13:29:19

初始化客户端

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

提交视频DNA作业

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

  1. function submitAIJob($client) {
  2. $request = new vod\SubmitAIJobRequest();
  3. // 设置视频ID
  4. $request->setMediaId('3eb19a4585bc475e995bddxxxxxxxx');
  5. // 设置AI类型,类型为AIMediaDNA
  6. $request->setTypes('AIMediaDNA');
  7. // 返回结果
  8. return $client->getAcsResponse($request);
  9. }
  10. try {
  11. $client = initVodClient('<AccessKeyId>', '<AccessKeySecret>');
  12. $result = submitAIJob($client);
  13. var_dump($result);
  14. } catch (Exception $e) {
  15. print $e->getMessage()."\n";
  16. }

查询视频DNA作业

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

  1. function listAIJob($client) {
  2. $request = new vod\ListAIJobRequest();
  3. // 设置作业ID
  4. $request->setJobIds("979d4d7a36ae41b1a945a2xxxxx,3eb19a4585bc475e995bddeaxxxxx");
  5. // 返回结果
  6. return $client->getAcsResponse($request);
  7. }
  8. try {
  9. $client = initVodClient('<AccessKeyId>', '<AccessKeySecret>');
  10. $result = listAIJob($client);
  11. var_dump($result);
  12. } catch (Exception $e) {
  13. print $e->getMessage()."\n";
  14. }

获取视频DNA结果

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

  1. function getMediaDNAResult($client) {
  2. $request = new vod\GetMediaDNAResultRequest();
  3. // 设置视频ID
  4. $request->setMediaId("3eb19a4585bc475e995bddxxxxxxxx");
  5. // 返回结果
  6. return $client->getAcsResponse($request);
  7. }
  8. try {
  9. $client = initVodClient('<AccessKeyId>', '<AccessKeySecret>');
  10. $result = getMediaDNAResult($client);
  11. var_dump($result);
  12. } catch (Exception $e) {
  13. print $e->getMessage()."\n";
  14. }