简介
本文档提供关于创建视频目标检测模板的相关 API 概览以及 SDK 示例代码。
SDK API 参考
创建模板
功能说明
创建视频目标检测模板。
说明:
COS iOS SDK 版本需要大于等于 v6.2.9。
示例代码
Objective-C
QCloudPostVideoTargetTempleteRequest * request = [QCloudPostVideoTargetTempleteRequest new];request.bucket = @"sample-1250000000";request.regionName = @"COS_REGIONNAME";request.input = [QCloudPostVideoTargetTemplete new];// 模板类型:VideoTargetRec;是否必传:是request.input.Tag = @"";// 模板名称,仅支持中文、英文、数字、_、-和*,长度不超过 64;是否必传:是request.input.Name = @"";// 视频目标检测 参数;是否必传:是request.input.VideoTargetRec = [QCloudVideoTargetRec new];[request setFinishBlock:^(QCloudPostVideoTargetTempleteResponse * outputObject, NSError *error) {// result:QCloudPostVideoTargetTempleteResponse 包含所有的响应;// 具体查看代码注释或api文档:https://cloud.tencent.com/document/product/460/84736}];[[QCloudCOSXMLService defaultCOSXML] PostVideoTargetTemplete:request];
注意:
Swift
let request : QCloudPostVideoTargetTempleteRequest = QCloudPostVideoTargetTempleteRequest();request.bucket = "sample-1250000000";request.regionName = "COS_REGIONNAME";let postVideoTargetTemplete : QCloudPostVideoTargetTemplete = QCloudPostVideoTargetTemplete();request.input = postVideoTargetTemplete;// 模板类型:VideoTargetRec;是否必传:是request.input.tag = "";// 模板名称,仅支持中文、英文、数字、_、-和*,长度不超过 64;是否必传:是request.input.name = "";// 视频目标检测 参数;是否必传:是let videoTargetRec : QCloudVideoTargetRec = QCloudVideoTargetRec();request.finishBlock = { result, error in// result:QCloudPostVideoTargetTempleteResponse 包含所有的响应;// 具体查看代码注释或api文档:https://cloud.tencent.com/document/product/460/84736};QCloudCOSXMLService.defaultCOSXML().postVideoTargetTemplete(request);
注意:
更新模板
功能说明
更新视频目标检测模板。
说明:
COS iOS SDK 版本需要大于等于 v6.2.9。
示例代码
Objective-C
QCloudUpdateVideoTargetTempleteRequest * request = [QCloudUpdateVideoTargetTempleteRequest new];request.bucket = @"sample-1250000000";request.regionName = @"COS_REGIONNAME";// 设置:TemplateId;request.TemplateId = @"";request.input = [QCloudUpdateVideoTargetTemplete new];// 模板类型:VideoTargetRec;是否必传:是request.input.Tag = @"";// 模板名称,仅支持中文、英文、数字、_、-和*,长度不超过 64;是否必传:是request.input.Name = @"";// 视频目标检测 参数;是否必传:是request.input.VideoTargetRec = [QCloudVideoTargetRec new];[request setFinishBlock:^(QCloudUpdateVideoTargetTempleteResponse * outputObject, NSError *error) {// result:QCloudUpdateVideoTargetTempleteResponse 包含所有的响应;// 具体查看代码注释或api文档:https://cloud.tencent.com/document/product/460/84760}];[[QCloudCOSXMLService defaultCOSXML] UpdateVideoTargetTemplete:request];
注意:
Swift
let request : QCloudUpdateVideoTargetTempleteRequest = QCloudUpdateVideoTargetTempleteRequest();// 设置:templateId;request.templateId = null;request.bucket = "sample-1250000000";request.regionName = "COS_REGIONNAME";let updateVideoTargetTemplete : QCloudUpdateVideoTargetTemplete = QCloudUpdateVideoTargetTemplete();request.input = updateVideoTargetTemplete;// 模板类型:VideoTargetRec;是否必传:是request.input.tag = "";// 模板名称,仅支持中文、英文、数字、_、-和*,长度不超过 64;是否必传:是request.input.name = "";// 视频目标检测 参数;是否必传:是let videoTargetRec : QCloudVideoTargetRec = QCloudVideoTargetRec();request.finishBlock = { result, error in// result:QCloudUpdateVideoTargetTempleteResponse 包含所有的响应;// 具体查看代码注释或api文档:https://cloud.tencent.com/document/product/460/84760};QCloudCOSXMLService.defaultCOSXML().updateVideoTargetTemplete(request);
注意: