提交的内容
This commit is contained in:
37
vendor/qcloud/cos-sdk-v5/sample/CreateDataset.php
vendored
Normal file
37
vendor/qcloud/cos-sdk-v5/sample/CreateDataset.php
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//本接口用于创建一个数据集(Dataset),数据集是由文件元数据构成的集合,用于存储和管理元数据。
|
||||
$result = $cosClient->CreateDataset(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test', // 数据集名称,同一个账户下唯一。命名规则如下: 长度为1~32字符。 只能包含小写英文字母,数字,短划线(-)。 必须以英文字母和数字开头。;是否必传:是
|
||||
'Description'=> 'test', // 数据集描述信息。长度为1~256个英文或中文字符,默认值为空。;是否必传:否
|
||||
'TemplateId'=> 'Official:COSBasicMeta', // 指模板,在建立元数据索引时,后端将根据模板来决定收集哪些元数据。每个模板都包含一个或多个算子,不同的算子表示不同的元数据。目前支持的模板: Official:DefaultEmptyId:默认为空的模板,表示不进行元数据的采集。 Official:COSBasicMeta:基础信息模板,包含 COS 文件基础元信息算子,表示采集 COS 文件的名称、类型、ACL等基础元信息数据。 Official:FaceSearch:人脸检索模板,包含人脸检索、COS 文件基础元信息算子。Official:ImageSearch:图像检索模板,包含图像检索、COS 文件基础元信息算子。;是否必传:否
|
||||
'Version' => 'basic', // 数据集版本。basic、standard,默认为basic。
|
||||
'Volume' => 0, // Version为basic时为50w。Version为standard时,默认为500w,可设置1-10000,单位w。传0采用默认值。
|
||||
'TrainingMode' => 1, // 训练数据的来源模式。
|
||||
'TrainingDataset' => '', // 训练数据的数据集名称。仅在TrainingMode为0时生效。
|
||||
'TrainingURI' => '', // 训练数据的资源路径。仅在TrainingMode为1时生效。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
32
vendor/qcloud/cos-sdk-v5/sample/CreateDatasetBinding.php
vendored
Normal file
32
vendor/qcloud/cos-sdk-v5/sample/CreateDatasetBinding.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//本文档介绍创建数据集(Dataset)和对象存储(COS)Bucket 的绑定关系,绑定后将使用创建数据集时所指定算子对文件进行处理。绑定关系创建后,将对 COS 中新增的文件进行准实时的增量追踪扫描,使用创建数据集时所指定算子对文件进行处理,抽取文件元数据信息进行索引。通过此方式为文件建立索引后,您可以使用元数据查询API对元数据进行查询、管理和统计。
|
||||
$result = $cosClient->CreateDatasetBinding(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
'URI'=> 'cos://examplebucket-1250000000', // 资源标识字段,表示需要与数据集绑定的资源,当前仅支持COS存储桶,字段规则:cos://<BucketName>,其中BucketName表示COS存储桶名称,例如:cos://examplebucket-1250000000;是否必传:是
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
41
vendor/qcloud/cos-sdk-v5/sample/CreateFileMetaIndex.php
vendored
Normal file
41
vendor/qcloud/cos-sdk-v5/sample/CreateFileMetaIndex.php
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//提取一个 COS 文件的元数据,在数据集中建立索引。会根据数据集中的算子提取不同的元数据建立索引,也支持建立自定义的元数据索引。
|
||||
$result = $cosClient->CreateFileMetaIndex(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test001', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
// 用于建立索引的文件信息。;是否必传:是
|
||||
'File'=> array(
|
||||
'CustomId'=> '001', // 自定义ID。该文件索引到数据集后,作为该行元数据的属性存储,用于和您的业务系统进行关联、对应。您可以根据业务需求传入该值,例如将某个URI关联到您系统内的某个ID。推荐传入全局唯一的值。在查询时,该字段支持前缀查询和排序,详情请见字段和操作符的支持列表。 ;是否必传:否
|
||||
'CustomLabels'=> array('age' => '18','level' => '18',)
|
||||
, // 自定义标签。您可以根据业务需要自定义添加标签键值对信息,用于在查询时可以据此为筛选项进行检索,详情请见字段和操作符的支持列表。 ;是否必传:否
|
||||
'MediaType'=> 'image', // 可选项,文件媒体类型,枚举值: image:图片。 other:其他。 document:文档。 archive:压缩包。 video:视频。 audio:音频。 ;是否必传:否
|
||||
'ContentType'=> 'image/jpeg', // 可选项,文件内容类型(MIME Type),如image/jpeg。 ;是否必传:否
|
||||
'URI'=> 'cos://examplebucket-1250000000/test.jpg', // 资源标识字段,表示需要建立索引的文件地址,当前仅支持COS上的文件,字段规则:cos:///,其中BucketName表示COS存储桶名称,ObjectKey表示文件完整路径,例如:cos://examplebucket-1250000000/test1/img.jpg。 注意: 1、仅支持本账号内的COS文件 2、不支持HTTP开头的地址;是否必传:是
|
||||
'MaxFaceNum'=> 20, // 输入图片中检索的人脸数量,默认值为20,最大值为20。(仅当数据集模板 ID 为 Official:FaceSearch 有效)。;是否必传:否
|
||||
),
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
41
vendor/qcloud/cos-sdk-v5/sample/CreateWatermarkTemplateDemo.php
vendored
Normal file
41
vendor/qcloud/cos-sdk-v5/sample/CreateWatermarkTemplateDemo.php
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//创建明水印模板
|
||||
$result = $cosClient->CreateWatermarkTemplate(array(
|
||||
'Bucket' => '###bucketName###', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Headers' => array(
|
||||
'Content-Type' => 'application/xml',
|
||||
),
|
||||
'Tag'=> 'undefined', // 模板类型: Watermark;是否必传:否
|
||||
'Name'=> 'undefined', // 模板名称,仅支持中文、英文、数字、_、-和*,长度不超过 64;是否必传:否
|
||||
// 水印信息;是否必传:否
|
||||
'Watermark'=> array(
|
||||
'Type'=> 'undefined', // 水印类型Text:文字水印Image:图片水印;是否必传:是
|
||||
'Pos'=> 'undefined', // 基准位置TopRightTopLeftBottomRightBottomLeftLeftRightTopBottomCenter;是否必传:是
|
||||
'LocMode'=> 'undefined', // 偏移方式Relativity:按比例Absolute:固定位置;是否必传:是
|
||||
'Dx'=> 'undefined', // 水平偏移在图片水印中,如果 Background 为 true,当 locMode 为 Relativity 时,为%,值范围:[-300 0];当 locMode 为 Absolute 时,为 px,值范围:[-4096 0]。在图片水印中,如果 Background 为 false,当 locMode 为 Relativity 时,为%,值范围:[0 100];当 locMode 为 Absolute 时,为 px,值范围:[0 4096]。在文字水印中,当 locMode 为 Relativity 时,为%,值范围:[0 100];当 locMode 为 Absolute 时,为 px,值范围:[0 4096]。当Pos为Top、Bottom和Center时,该参数无效。;是否必传:是
|
||||
'Dy'=> 'undefined', // 垂直偏移在图片水印中,如果 Background 为 true,当 locMode 为 Relativity 时,为%,值范围:[-300 0];当 locMode 为 Absolute 时,为 px,值范围:[-4096 0]。在图片水印中,如果 Background 为 false,当 locMode 为 Relativity 时,为%,值范围:[0 100];当 locMode 为 Absolute 时,为 px,值范围:[0 4096]。在文字水印中,当 locMode 为 Relativity 时,为%,值范围:[0 100];当 locMode 为 Absolute 时,为 px,值范围:[0 4096]。当Pos为Left、Right和Center时,该参数无效。;是否必传:是
|
||||
'StartTime'=> 'undefined', // 水印开始时间[0,视频时长] 单位为秒 支持 float 格式,执行精度精确到毫秒;是否必传:否
|
||||
'EndTime'=> 'undefined', // 水印结束时间[0,视频时长] 单位为秒 支持 float 格式,执行精度精确到毫秒;是否必传:否
|
||||
),
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
35
vendor/qcloud/cos-sdk-v5/sample/DatasetFaceSearch.php
vendored
Normal file
35
vendor/qcloud/cos-sdk-v5/sample/DatasetFaceSearch.php
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//从数据集中搜索与指定图片最相似的前N张图片并返回人脸坐标可对数据集内文件进行一个或多个人员的人脸识别。
|
||||
$result = $cosClient->DatasetFaceSearch(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
'URI'=> 'cos://examplebucket-1250000000/test.jpg', // 资源标识字段,表示需要建立索引的文件地址。;是否必传:是
|
||||
'MaxFaceNum'=> 1, // 输入图片中检索的人脸数量,默认值为1(传0或不传采用默认值),最大值为10。;是否必传:否
|
||||
'Limit'=> 10, // 检索的每张人脸返回相关人脸数量,默认值为10,最大值为100。;是否必传:否
|
||||
'MatchThreshold'=> 10, // 出参 Score 中,只有超过 MatchThreshold 值的结果才会返回。范围:1-100,默认值为0,推荐值为80。;是否必传:否
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
54
vendor/qcloud/cos-sdk-v5/sample/DatasetSimpleQuery.php
vendored
Normal file
54
vendor/qcloud/cos-sdk-v5/sample/DatasetSimpleQuery.php
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//可以根据已提取的文件元数据(包含文件名、标签、路径、自定义标签、文本等字段)查询和统计数据集内文件,支持逻辑关系表达方式。
|
||||
$result = $cosClient->DatasetSimpleQuery(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
// 简单查询参数条件,可自嵌套。;是否必传:是
|
||||
'Query'=> array(
|
||||
'Operation'=> 'and', // 操作运算符。枚举值: not:逻辑非。 or:逻辑或。 and:逻辑与。 lt:小于。 lte:小于等于。 gt:大于。 gte:大于等于。 eq:等于。 exist:存在性查询。 prefix:前缀查询。 match-phrase:字符串匹配查询。 nested:字段为数组时,其中同一对象内逻辑条件查询。;是否必传:是
|
||||
'SubQueries' => array(
|
||||
array(
|
||||
'Field'=> 'ContentType',
|
||||
'Value'=> 'image/jpeg',
|
||||
'Operation'=> 'eq',
|
||||
),
|
||||
array(
|
||||
'Field'=> 'Size',
|
||||
'Value'=> '1000',
|
||||
'Operation'=> 'gt',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'MaxResults'=> 100, // 返回文件元数据的最大个数,取值范围为0200。 使用聚合参数时,该值表示返回分组的最大个数,取值范围为02000。 不设置此参数或者设置为0时,则取默认值100。;是否必传:否
|
||||
'Sort'=> 'CustomId', // 排序字段列表。请参考字段和操作符的支持列表。 多个排序字段可使用半角逗号(,)分隔,例如:Size,Filename。 最多可设置5个排序字段。 排序字段顺序即为排序优先级顺序。;是否必传:是
|
||||
'Order'=> 'desc', // 排序字段的排序方式。取值如下: asc:升序; desc(默认):降序。 多个排序方式可使用半角逗号(,)分隔,例如:asc,desc。 排序方式不可多于排序字段,即参数Order的元素数量需小于等于参数Sort的元素数量。例如Sort取值为Size,Filename时,Order可取值为asc,desc或asc。 排序方式少于排序字段时,未排序的字段默认取值asc。例如Sort取值为Size,Filename,Order取值为asc时,Filename默认排序方式为asc,即升序排列;是否必传:是
|
||||
// 聚合字段信息列表。 当您使用聚合查询时,仅返回聚合结果,不再返回匹配到的元信息列表。;是否必传:是
|
||||
'Aggregations'=> array(
|
||||
),
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/DeleteDataset.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/DeleteDataset.php
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//删除一个数据集(Dataset)。
|
||||
$result = $cosClient->DeleteDataset(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
32
vendor/qcloud/cos-sdk-v5/sample/DeleteDatasetBinding.php
vendored
Normal file
32
vendor/qcloud/cos-sdk-v5/sample/DeleteDatasetBinding.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//解绑数据集和对象存储(COS)Bucket ,解绑会导致 COS Bucket新增的变更不会同步到数据集,请谨慎操作。
|
||||
$result = $cosClient->DeleteDatasetBinding(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
'URI'=> 'cos://examplebucket-1250000000', // 资源标识字段,表示需要与数据集绑定的资源,当前仅支持COS存储桶,字段规则:cos://<BucketName>,其中BucketName表示COS存储桶名称,例如:cos://examplebucket-1250000000;是否必传:是
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/DeleteFileMetaIndex.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/DeleteFileMetaIndex.php
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//从数据集内删除一个文件的元信息。无论该文件的元信息是否在数据集内存在,均会返回删除成功。
|
||||
$result = $cosClient->DeleteFileMetaIndex(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
'URI'=> 'cos://examplebucket-1250000000/test.jpg', // 资源标识字段,表示需要建立索引的文件地址。;是否必传:是
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
32
vendor/qcloud/cos-sdk-v5/sample/DescribeDataset.php
vendored
Normal file
32
vendor/qcloud/cos-sdk-v5/sample/DescribeDataset.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//查询一个数据集(Dataset)信息。
|
||||
$result = $cosClient->DescribeDataset(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'datasetname' => '', // 数据集名称,同一个账户下唯一。
|
||||
'statistics' => 'false', // 是否需要实时统计数据集中文件相关信息。有效值: false:不统计,返回的文件的总大小、数量信息可能不正确也可能都为0。 true:需要统计,返回数据集中当前的文件的总大小、数量信息。 默认值为false。
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
32
vendor/qcloud/cos-sdk-v5/sample/DescribeDatasetBinding.php
vendored
Normal file
32
vendor/qcloud/cos-sdk-v5/sample/DescribeDatasetBinding.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//查询数据集和对象存储(COS)Bucket 绑定关系列表。
|
||||
$result = $cosClient->DescribeDatasetBinding(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'datasetname' => '数据集名称', // 数据集名称,同一个账户下唯一。
|
||||
'uri' => 'uri', // 资源标识字段,表示需要与数据集绑定的资源,当前仅支持COS存储桶,字段规则:cos://,其中BucketName表示COS存储桶名称,例如(需要进行urlencode):cos%3A%2F%2Fexample-125000
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
33
vendor/qcloud/cos-sdk-v5/sample/DescribeDatasetBindings.php
vendored
Normal file
33
vendor/qcloud/cos-sdk-v5/sample/DescribeDatasetBindings.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//查询数据集和对象存储(COS)Bucket 绑定关系列表。
|
||||
$result = $cosClient->DescribeDatasetBindings(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'datasetname' => '数据集名称', // 数据集名称,同一个账户下唯一。
|
||||
'maxresults' => '最大个数', // 返回绑定关系的最大个数,取值范围为0~200。不设置此参数或者设置为0时,则默认值为100。
|
||||
'nexttoken' => '下一页', // 当绑定关系总数大于设置的MaxResults时,用于翻页的token。从NextToken开始按字典序返回绑定关系信息列表。第一次调用此接口时,设置为空。
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
33
vendor/qcloud/cos-sdk-v5/sample/DescribeDatasets.php
vendored
Normal file
33
vendor/qcloud/cos-sdk-v5/sample/DescribeDatasets.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//获取数据集(Dataset)列表。
|
||||
$result = $cosClient->DescribeDatasets(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'maxresults' => 100, // 本次返回数据集的最大个数,取值范围为0~200。不设置此参数或者设置为0时,则默认值为100。
|
||||
'nexttoken' => '下一页', // 翻页标记。当文件总数大于设置的MaxResults时,用于翻页的Token。从NextToken开始按字典序返回文件信息列表。填写上次查询返回的值,首次使用时填写为空。
|
||||
'prefix' => '数据集前缀', // 数据集名称前缀。
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
32
vendor/qcloud/cos-sdk-v5/sample/DescribeFileMetaIndex.php
vendored
Normal file
32
vendor/qcloud/cos-sdk-v5/sample/DescribeFileMetaIndex.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//获取数据集内已完成索引的一个文件的元数据。
|
||||
$result = $cosClient->DescribeFileMetaIndex(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'datasetname' => '', // 数据集名称,同一个账户下唯一。
|
||||
'uri' => '', // 资源标识字段,表示需要建立索引的文件地址,当前仅支持COS上的文件,字段规则:cos:///,其中BucketName表示COS存储桶名称,ObjectKey表示文件完整路径,例如:cos://examplebucket-1250000000/test1/img.jpg。 注意: 1、仅支持本账号内的COS文件 2、不支持HTTP开头的地址 3、需UrlEncode
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
49
vendor/qcloud/cos-sdk-v5/sample/GeneratePlayListDemo.php
vendored
Normal file
49
vendor/qcloud/cos-sdk-v5/sample/GeneratePlayListDemo.php
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//生成边转边播的播放列表能够分析视频文件产出 m3u8 文件。生成播放列表后即时播放,并根据播放进度实施按需转码,相比离线转码能极大减少了转码等待时间并大幅度降低了转码和存储开销
|
||||
$result = $cosClient->GeneratePlayList(array(
|
||||
'Bucket' => '###bucketName###', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Headers' => array(
|
||||
'Content-Type' => 'application/xml',
|
||||
),
|
||||
'Tag'=> 'undefined', // 创建任务的Tag:GeneratePlayList;是否必传:是
|
||||
// 待操作的文件信息;是否必传:是
|
||||
'Input'=> array(
|
||||
'Object'=> 'undefined', // 文件路径;是否必传:否
|
||||
),
|
||||
// 操作规则;是否必传:是
|
||||
'Operation'=> array(
|
||||
'UserData'=> 'undefined', // 透传用户信息, 可打印的 ASCII 码, 长度不超过1024;是否必传:否
|
||||
'JobLevel'=> 'undefined', // 任务优先级,级别限制:0 、1 、2 。级别越大任务优先级越高,默认为0;是否必传:否
|
||||
),
|
||||
'CallBack'=> 'undefined', // 任务回调地址,优先级高于队列的回调地址。设置为 no 时,表示队列的回调地址不产生回调;是否必传:否
|
||||
'CallBackFormat'=> 'undefined', // 任务回调格式,JSON 或 XML,默认 XML,优先级高于队列的回调格式;是否必传:否
|
||||
'QueueType'=> 'undefined', // 任务所在的队列类型,限制为 SpeedTranscoding, 表示为开启倍速转码;是否必传:否
|
||||
'CallBackType'=> 'undefined', // 任务回调类型,Url 或 TDMQ,默认 Url,优先级高于队列的回调类型;是否必传:否
|
||||
// 任务回调TDMQ配置,当 CallBackType 为 TDMQ 时必填。详情见 CallBackMqConfig;是否必传:否
|
||||
'CallBackMqConfig'=> array(
|
||||
'MqRegion'=> 'undefined', // 消息队列所属园区,目前支持园区 sh(上海)、bj(北京)、gz(广州)、cd(成都)、hk(中国香港);是否必传:是
|
||||
'MqMode'=> 'undefined', // 消息队列使用模式,默认 Queue :主题订阅:Topic队列服务: Queue;是否必传:是
|
||||
'MqName'=> 'undefined', // TDMQ 主题名称;是否必传:是
|
||||
),
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
29
vendor/qcloud/cos-sdk-v5/sample/GetHLSPlayKeyDemo.php
vendored
Normal file
29
vendor/qcloud/cos-sdk-v5/sample/GetHLSPlayKeyDemo.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//该接口用于获取hls播放密钥。
|
||||
$result = $cosClient->GetHLSPlayKey(array(
|
||||
'Bucket' => '###bucketName###', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Headers' => array(
|
||||
'Content-Type' => 'application/xml',
|
||||
),
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/GetHLSTokenDemo.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/GetHLSTokenDemo.php
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
$playKey = 'playKey';//替换为用户的 playKey,请通过该接口进行查看和管理,https://cloud.tencent.com/document/product/460/104329
|
||||
$bucket = 'examplebucket-1250000000';
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$publicKey = "publicKey";
|
||||
$header = array(
|
||||
'alg' => 'HS256',
|
||||
'typ' => 'JWT'
|
||||
);
|
||||
$payload = array(
|
||||
"Type" => "CosCiToken",
|
||||
"AppId" => "1250000000",
|
||||
"BucketId" => $bucket,
|
||||
"Object" => "exampleobject",
|
||||
"Issuer" => "client",
|
||||
"IssuedTimeStamp" => time(),
|
||||
"ExpireTimeStamp" => time() + 3600 * 6,
|
||||
"UsageLimit" => 3,
|
||||
"ProtectScheme" => "rsa1024",
|
||||
"PublicKey" => base64_encode($publicKey),
|
||||
"ProtectContentKey" => 1,
|
||||
);
|
||||
$base64header = base64UrlEncode(json_encode($header, JSON_UNESCAPED_UNICODE));
|
||||
$base64payload = base64UrlEncode(json_encode($payload, JSON_UNESCAPED_UNICODE));
|
||||
$token = $base64header . '.' . $base64payload . '.' . base64UrlEncode(hash_hmac('sha256', $base64header . '.' . $base64payload, $playKey, true));
|
||||
echo $token;
|
||||
|
||||
function base64UrlEncode($input) {
|
||||
return str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));
|
||||
}
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/ImageSearch.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/ImageSearch.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/ImageSearchAdd.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/ImageSearchAdd.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/ImageSearchDelete.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/ImageSearchDelete.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/ImageSearchOpen.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/ImageSearchOpen.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
54
vendor/qcloud/cos-sdk-v5/sample/ImageSlim.php
vendored
Normal file
54
vendor/qcloud/cos-sdk-v5/sample/ImageSlim.php
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 极智压缩
|
||||
$imageRule = new Qcloud\Cos\ImageParamTemplate\ImageSlimTemplate();
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($imageRule, "output.png"); // rules
|
||||
|
||||
// -------------------- 1. 下载时处理 -------------------- //
|
||||
// $downloadUrl = $cosClient->getObjectUrl('examplebucket-125000000', 'xxx.jpg'); // 获取下载链接
|
||||
$downloadUrl = 'https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/xxx.jpg'; // 私有图片处理方式同上,仅增加签名部分,并与图片处理参数以“&”连接
|
||||
$rule = $imageRule->queryString();
|
||||
echo "{$downloadUrl}?{$rule}";
|
||||
// echo "{$downloadUrl}&{$rule}"; // 携带签名的图片地址以“&”连接
|
||||
// -------------------- 1. 下载时处理 -------------------- //
|
||||
|
||||
// -------------------- 2. 上传时处理 -------------------- //
|
||||
$result = $cosClient->putObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'object.jpg',
|
||||
'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 2. 上传时处理 -------------------- //
|
||||
|
||||
// -------------------- 3. 云上数据处理 -------------------- //
|
||||
$result = $cosClient->ImageProcess(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.png',
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 3. 云上数据处理 -------------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
43
vendor/qcloud/cos-sdk-v5/sample/PostWatermarkJobsDemo.php
vendored
Normal file
43
vendor/qcloud/cos-sdk-v5/sample/PostWatermarkJobsDemo.php
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//提交一个视频明水印任务
|
||||
$result = $cosClient->PostWatermarkJobs(array(
|
||||
'Bucket' => '###bucketName###', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Headers' => array(
|
||||
'Content-Type' => 'application/xml',
|
||||
),
|
||||
'Tag'=> 'undefined', // 创建任务的Tag:Watermark;是否必传:是
|
||||
// 待操作的文件信息;是否必传:是
|
||||
'Input'=> array(
|
||||
'Object'=> 'undefined', // 待处理的文件路径;是否必传:是
|
||||
),
|
||||
// 操作规则;是否必传:是
|
||||
'Operation'=> array(
|
||||
'WatermarkTemplateId'=> 'undefined', // 水印模板 ID,可以传多个水印模板 ID ,最多传3个;是否必传:否
|
||||
'UserData'=> 'undefined', // 透传用户信息,可打印的 ASCII 码,长度不超过1024。;是否必传:否
|
||||
'JobLevel'=> 'undefined', // 任务优先级,级别限制:0 、1 、2 。级别越大任务优先级越高,默认为0;是否必传:否
|
||||
),
|
||||
'CallBackFormat'=> 'undefined', // 任务回调格式,JSON 或 XML,默认 XML,优先级高于队列的回调格式;是否必传:否
|
||||
'CallBackType'=> 'undefined', // 任务回调类型,Url 或 TDMQ,默认 Url,优先级高于队列的回调类型;是否必传:否
|
||||
'CallBack'=> 'undefined', // 任务回调地址,优先级高于队列的回调地址。设置为 no 时,表示队列的回调地址不产生回调;是否必传:否
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
35
vendor/qcloud/cos-sdk-v5/sample/SearchImage.php
vendored
Normal file
35
vendor/qcloud/cos-sdk-v5/sample/SearchImage.php
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//可通过输入自然语言或图片,基于语义对数据集内文件进行图像检索。
|
||||
$result = $cosClient->SearchImage(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'ImageSearch001', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
'Mode'=> 'pic', // 指定检索方式为图片或文本,pic 为图片检索,text 为文本检索,默认为 pic。;是否必传:否
|
||||
'URI'=> 'cos://examplebucket-1250000000/huge_base.jpg', // 资源标识字段,表示需要建立索引的文件地址(Mode 为 pic 时必选)。;是否必传:否
|
||||
'Limit'=> 10, // 返回相关图片的数量,默认值为10,最大值为100。;是否必传:否
|
||||
'MatchThreshold'=> 1, // 出参 Score(相关图片匹配得分) 中,只有超过 MatchThreshold 值的结果才会返回。默认值为0,推荐值为80。;是否必传:否
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
33
vendor/qcloud/cos-sdk-v5/sample/UpdateDataset.php
vendored
Normal file
33
vendor/qcloud/cos-sdk-v5/sample/UpdateDataset.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//更新一个数据集(Dataset)信息。
|
||||
$result = $cosClient->UpdateDataset(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
'Description'=> 'test', // 数据集描述信息。长度为1~256个英文或中文字符,默认值为空。;是否必传:否
|
||||
'TemplateId'=> 'Official:COSBasicMeta', // 该参数表示模板,在建立元数据索引时,后端将根据模板来决定收集哪些元数据。每个模板都包含一个或多个算子,不同的算子表示不同的元数据。目前支持的模板: Official:Empty:默认为空的模板,表示不进行元数据的采集。 Official:COSBasicMeta:基础信息模板,包含COS文件基础元信息算子,表示采集cos文件的名称、类型、acl等基础元信息数据。;是否必传:否
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
41
vendor/qcloud/cos-sdk-v5/sample/UpdateFileMetaIndex.php
vendored
Normal file
41
vendor/qcloud/cos-sdk-v5/sample/UpdateFileMetaIndex.php
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//更新数据集内已索引的一个文件的部分元数据。并非所有的元数据都允许您自定义更新,在您发起更新请求时需要填写数据集,默认会根据该数据集的算子进行元数据重新提取并更新已存在的索引,此外您也可以更新部分自定义的元数据索引,如CustomTags、CustomId等字段,具体请参考请求参数一节。
|
||||
$result = $cosClient->UpdateFileMetaIndex(array(
|
||||
'AppId' => 'AppId', // 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
|
||||
'Headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
'DatasetName'=> 'test001', // 数据集名称,同一个账户下唯一。;是否必传:是
|
||||
'Callback'=> 'http://www.callback.com', // 元数据索引结果(以回调形式发送至您的回调地址,支持以 http:// 或者 https:// 开头的地址,例如: http://www.callback.com;是否必传:是
|
||||
// 用于建立索引的文件信息。;是否必传:是
|
||||
'File'=> array(
|
||||
'CustomId'=> '001', // 自定义ID。该文件索引到数据集后,作为该行元数据的属性存储,用于和您的业务系统进行关联、对应。您可以根据业务需求传入该值,例如将某个URI关联到您系统内的某个ID。推荐传入全局唯一的值。在查询时,该字段支持前缀查询和排序,详情请见字段和操作符的支持列表。 ;是否必传:否
|
||||
'CustomLabels'=> array('age' => '18','level' => '18',)
|
||||
, // 自定义标签。您可以根据业务需要自定义添加标签键值对信息,用于在查询时可以据此为筛选项进行检索,详情请见字段和操作符的支持列表。 ;是否必传:否
|
||||
'MediaType'=> 'image', // 可选项,文件媒体类型,枚举值: image:图片。 other:其他。 document:文档。 archive:压缩包。 video:视频。 audio:音频。 ;是否必传:否
|
||||
'ContentType'=> 'image/jpeg', // 可选项,文件内容类型(MIME Type),如image/jpeg。 ;是否必传:否
|
||||
'URI'=> 'cos://examplebucket-1250000000/test1/img.jpg', // 资源标识字段,表示需要建立索引的文件地址,当前仅支持COS上的文件,字段规则:cos:///,其中BucketName表示COS存储桶名称,ObjectKey表示文件完整路径,例如:cos://examplebucket-1250000000/test1/img.jpg。 注意: 1、仅支持本账号内的COS文件 2、不支持HTTP开头的地址;是否必传:是
|
||||
),
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
30
vendor/qcloud/cos-sdk-v5/sample/ZipFilePreviewDemo.php
vendored
Normal file
30
vendor/qcloud/cos-sdk-v5/sample/ZipFilePreviewDemo.php
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//该接口可以在不解压文件的情况下预览压缩包内的内容,包含文件数量、名称、文件时间等,接口为同步请求方式
|
||||
$result = $cosClient->ZipFilePreview(array(
|
||||
'Bucket' => 'test-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'for-test.zip', // 文件名称
|
||||
'Headers' => array(
|
||||
'Content-Type' => 'application/xml',
|
||||
),
|
||||
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
38
vendor/qcloud/cos-sdk-v5/sample/aIBodyRecognitionProcess.php
vendored
Normal file
38
vendor/qcloud/cos-sdk-v5/sample/aIBodyRecognitionProcess.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
$local_path = "/data/exampleobject";
|
||||
try {
|
||||
// -------------------- 1. 人体识别 原图存储在COS -------------------- //
|
||||
$result = $cosClient->aIBodyRecognitionProcess(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.jpg',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 1. 人体识别 原图存储在COS -------------------- //
|
||||
|
||||
// -------------------- 2. 人体识别 原图来自其他链接 -------------------- //
|
||||
$result = $cosClient->aIBodyRecognitionProcess(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // 该值为空即可
|
||||
'DetectUrl' => 'https://www.xxx.com/xxx.jpg',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 2. 人体识别 原图来自其他链接 -------------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
38
vendor/qcloud/cos-sdk-v5/sample/aIGameRecProcess.php
vendored
Normal file
38
vendor/qcloud/cos-sdk-v5/sample/aIGameRecProcess.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
$local_path = "/data/exampleobject";
|
||||
try {
|
||||
// -------------------- 1. 游戏场景识别 原图存储在COS -------------------- //
|
||||
$result = $cosClient->aIGameRecProcess(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.jpg',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 1. 游戏场景识别 原图存储在COS -------------------- //
|
||||
|
||||
// -------------------- 2. 游戏场景识别 原图来自其他链接 -------------------- //
|
||||
$result = $cosClient->aIGameRecProcess(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // 该值为空即可
|
||||
'DetectUrl' => 'https://www.xxx.com/xxx.jpg',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 2. 游戏场景识别 原图来自其他链接 -------------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
65
vendor/qcloud/cos-sdk-v5/sample/aIImageColoringProcess.php
vendored
Normal file
65
vendor/qcloud/cos-sdk-v5/sample/aIImageColoringProcess.php
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// -------------------- 1. 下载时处理-原图存储在COS -------------------- //
|
||||
$object = 'xxx.jpg';
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIImageColoring');
|
||||
$query = $ciProcessParams->queryString();
|
||||
$downloadUrl = $cosClient->getObjectUrl('examplebucket-1250000000', $object); // 获取下载链接
|
||||
echo "{$downloadUrl}&{$query}"; // 携带签名的图片地址以“&”连接
|
||||
// -------------------- 1. 下载时处理-原图存储在COS -------------------- //
|
||||
|
||||
// -------------------- 2. 下载时处理-原图来自其他链接 -------------------- //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIImageColoring');
|
||||
$ciProcessParams->addParam('detect-url', 'https://xxx.com/xxx.jpg');
|
||||
$query = $ciProcessParams->queryString();
|
||||
$downloadUrl = $cosClient->getObjectUrl('examplebucket-1250000000', ''); // 获取下载链接
|
||||
echo "{$downloadUrl}&{$query}";
|
||||
// -------------------- 2. 下载时处理-原图来自其他链接 -------------------- //
|
||||
|
||||
// ---------------------------- 3. 上传时处理 ---------------------------- //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIImageColoring');
|
||||
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($ciProcessParams, "output.png"); // rules
|
||||
$result = $cosClient->putObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'object.jpg',
|
||||
'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// ---------------------------- 3. 上传时处理 ---------------------------- //
|
||||
|
||||
// --------------------- 4. 云上数据处理 ------------------------------ //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIImageColoring');
|
||||
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($ciProcessParams, 'output.jpg'); // rules
|
||||
$result = $cosClient->ImageProcess(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.jpg',
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// --------------------- 4. 云上数据处理 ------------------------------ //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
83
vendor/qcloud/cos-sdk-v5/sample/aIImageCropProcess.php
vendored
Normal file
83
vendor/qcloud/cos-sdk-v5/sample/aIImageCropProcess.php
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// -------------------- 1. 下载时处理-原图存储在COS -------------------- //
|
||||
$object = 'xxx.jpg';
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIImageCrop');
|
||||
$ciProcessParams->addParam('width', 100); // 需要裁剪区域的宽度,与height共同组成所需裁剪的图片宽高比例;输入数字请大于0、小于图片宽度的像素值
|
||||
$ciProcessParams->addParam('height', 100); // 需要裁剪区域的高度,与width共同组成所需裁剪的图片宽高比例;输入数字请大于0、小于图片高度的像素值;width : height建议取值在[1, 2.5]之间,超过这个范围可能会影响效果
|
||||
$ciProcessParams->addParam('fixed', 0); // 是否严格按照 width 和 height 的值进行输出。
|
||||
$ciProcessParams->addParam('ignore-error', 1); // 当此参数为1时,针对文件过大等导致处理失败的场景,会直接返回原图而不报错。
|
||||
|
||||
$query = $ciProcessParams->queryString();
|
||||
$downloadUrl = $cosClient->getObjectUrl('examplebucket-1250000000', $object); // 获取下载链接
|
||||
echo "{$downloadUrl}&{$query}"; // 携带签名的图片地址以“&”连接
|
||||
// -------------------- 1. 下载时处理-原图存储在COS -------------------- //
|
||||
|
||||
// -------------------- 2. 下载时处理-原图来自其他链接 -------------------- //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIImageCrop');
|
||||
$ciProcessParams->addParam('detect-url', 'https://xxx.com/xxx.jpg');
|
||||
$ciProcessParams->addParam('width', 100); // 需要裁剪区域的宽度,与height共同组成所需裁剪的图片宽高比例;输入数字请大于0、小于图片宽度的像素值
|
||||
$ciProcessParams->addParam('height', 100); // 需要裁剪区域的高度,与width共同组成所需裁剪的图片宽高比例;输入数字请大于0、小于图片高度的像素值;width : height建议取值在[1, 2.5]之间,超过这个范围可能会影响效果
|
||||
$ciProcessParams->addParam('fixed', 0); // 是否严格按照 width 和 height 的值进行输出。
|
||||
$ciProcessParams->addParam('ignore-error', 1); // 当此参数为1时,针对文件过大等导致处理失败的场景,会直接返回原图而不报错。
|
||||
|
||||
$query = $ciProcessParams->queryString();
|
||||
$downloadUrl = $cosClient->getObjectUrl('examplebucket-1250000000', ''); // 获取下载链接
|
||||
echo "{$downloadUrl}&{$query}";
|
||||
// -------------------- 2. 下载时处理-原图来自其他链接 -------------------- //
|
||||
|
||||
// ---------------------------- 3. 上传时处理 ---------------------------- //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIImageCrop');
|
||||
$ciProcessParams->addParam('width', 100); // 需要裁剪区域的宽度,与height共同组成所需裁剪的图片宽高比例;输入数字请大于0、小于图片宽度的像素值
|
||||
$ciProcessParams->addParam('height', 100); // 需要裁剪区域的高度,与width共同组成所需裁剪的图片宽高比例;输入数字请大于0、小于图片高度的像素值;width : height建议取值在[1, 2.5]之间,超过这个范围可能会影响效果
|
||||
$ciProcessParams->addParam('fixed', 0); // 是否严格按照 width 和 height 的值进行输出。
|
||||
$ciProcessParams->addParam('ignore-error', 1); // 当此参数为1时,针对文件过大等导致处理失败的场景,会直接返回原图而不报错。
|
||||
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($ciProcessParams, "output.png"); // rules
|
||||
$result = $cosClient->putObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'object.jpg',
|
||||
'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// ---------------------------- 3. 上传时处理 ---------------------------- //
|
||||
|
||||
// --------------------- 4. 云上数据处理 ------------------------------ //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIImageCrop');
|
||||
$ciProcessParams->addParam('width', 100); // 需要裁剪区域的宽度,与height共同组成所需裁剪的图片宽高比例;输入数字请大于0、小于图片宽度的像素值
|
||||
$ciProcessParams->addParam('height', 100); // 需要裁剪区域的高度,与width共同组成所需裁剪的图片宽高比例;输入数字请大于0、小于图片高度的像素值;width : height建议取值在[1, 2.5]之间,超过这个范围可能会影响效果
|
||||
$ciProcessParams->addParam('fixed', 0); // 是否严格按照 width 和 height 的值进行输出。
|
||||
$ciProcessParams->addParam('ignore-error', 1); // 当此参数为1时,针对文件过大等导致处理失败的场景,会直接返回原图而不报错。
|
||||
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($ciProcessParams, 'output.jpg'); // rules
|
||||
$result = $cosClient->ImageProcess(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.jpg',
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// --------------------- 4. 云上数据处理 ------------------------------ //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
79
vendor/qcloud/cos-sdk-v5/sample/aIImageEnhanceProcess.php
vendored
Normal file
79
vendor/qcloud/cos-sdk-v5/sample/aIImageEnhanceProcess.php
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// -------------------- 1. 下载时处理-原图存储在COS -------------------- //
|
||||
$object = 'xxx.jpg';
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIEnhanceImage');
|
||||
$ciProcessParams->addParam('denoise', 3); // 去噪强度值,取值范围为 0 - 5 之间的整数,值为 0 时不进行去噪操作,默认值为3。
|
||||
$ciProcessParams->addParam('sharpen', 3); // 锐化强度值,取值范围为 0 - 5 之间的整数,值为 0 时不进行锐化操作,默认值为3。
|
||||
$ciProcessParams->addParam('ignore-error', 1); // 当此参数为1时,针对文件过大等导致处理失败的场景,会直接返回原图而不报错。
|
||||
|
||||
$query = $ciProcessParams->queryString();
|
||||
$downloadUrl = $cosClient->getObjectUrl('examplebucket-1250000000', $object); // 获取下载链接
|
||||
echo "{$downloadUrl}&{$query}"; // 携带签名的图片地址以“&”连接
|
||||
// -------------------- 1. 下载时处理-原图存储在COS -------------------- //
|
||||
|
||||
// -------------------- 2. 下载时处理-原图来自其他链接 -------------------- //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIEnhanceImage');
|
||||
$ciProcessParams->addParam('detect-url', 'https://xxx.com/xxx.jpg');
|
||||
$ciProcessParams->addParam('denoise', 3); // 去噪强度值,取值范围为 0 - 5 之间的整数,值为 0 时不进行去噪操作,默认值为3。
|
||||
$ciProcessParams->addParam('sharpen', 3); // 锐化强度值,取值范围为 0 - 5 之间的整数,值为 0 时不进行锐化操作,默认值为3。
|
||||
$ciProcessParams->addParam('ignore-error', 1); // 当此参数为1时,针对文件过大等导致处理失败的场景,会直接返回原图而不报错。
|
||||
|
||||
$query = $ciProcessParams->queryString();
|
||||
$downloadUrl = $cosClient->getObjectUrl('examplebucket-1250000000', ''); // 获取下载链接
|
||||
echo "{$downloadUrl}&{$query}";
|
||||
// -------------------- 2. 下载时处理-原图来自其他链接 -------------------- //
|
||||
|
||||
// ---------------------------- 3. 上传时处理 ---------------------------- //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIEnhanceImage');
|
||||
$ciProcessParams->addParam('denoise', 3); // 去噪强度值,取值范围为 0 - 5 之间的整数,值为 0 时不进行去噪操作,默认值为3。
|
||||
$ciProcessParams->addParam('sharpen', 3); // 锐化强度值,取值范围为 0 - 5 之间的整数,值为 0 时不进行锐化操作,默认值为3。
|
||||
$ciProcessParams->addParam('ignore-error', 1); // 当此参数为1时,针对文件过大等导致处理失败的场景,会直接返回原图而不报错。
|
||||
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($ciProcessParams, "output.png"); // rules
|
||||
$result = $cosClient->putObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'object.jpg',
|
||||
'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// ---------------------------- 3. 上传时处理 ---------------------------- //
|
||||
|
||||
// --------------------- 4. 云上数据处理 ------------------------------ //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AIEnhanceImage');
|
||||
$ciProcessParams->addParam('denoise', 3); // 去噪强度值,取值范围为 0 - 5 之间的整数,值为 0 时不进行去噪操作,默认值为3。
|
||||
$ciProcessParams->addParam('sharpen', 3); // 锐化强度值,取值范围为 0 - 5 之间的整数,值为 0 时不进行锐化操作,默认值为3。
|
||||
$ciProcessParams->addParam('ignore-error', 1); // 当此参数为1时,针对文件过大等导致处理失败的场景,会直接返回原图而不报错。
|
||||
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($ciProcessParams, 'output.jpg'); // rules
|
||||
$result = $cosClient->ImageProcess(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.jpg',
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// --------------------- 4. 云上数据处理 ------------------------------ //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
65
vendor/qcloud/cos-sdk-v5/sample/aIImageSuperResolutionProcess.php
vendored
Normal file
65
vendor/qcloud/cos-sdk-v5/sample/aIImageSuperResolutionProcess.php
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// -------------------- 1. 下载时处理-原图存储在COS -------------------- //
|
||||
$object = 'xxx.jpg';
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AISuperResolution');
|
||||
$query = $ciProcessParams->queryString();
|
||||
$downloadUrl = $cosClient->getObjectUrl('examplebucket-1250000000', $object); // 获取下载链接
|
||||
echo "{$downloadUrl}&{$query}"; // 携带签名的图片地址以“&”连接
|
||||
// -------------------- 1. 下载时处理-原图存储在COS -------------------- //
|
||||
|
||||
// -------------------- 2. 下载时处理-原图来自其他链接 -------------------- //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AISuperResolution');
|
||||
$ciProcessParams->addParam('detect-url', 'https://xxx.com/xxx.jpg');
|
||||
$query = $ciProcessParams->queryString();
|
||||
$downloadUrl = $cosClient->getObjectUrl('examplebucket-1250000000', ''); // 获取下载链接
|
||||
echo "{$downloadUrl}&{$query}";
|
||||
// -------------------- 2. 下载时处理-原图来自其他链接 -------------------- //
|
||||
|
||||
// ---------------------------- 3. 上传时处理 ---------------------------- //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AISuperResolution');
|
||||
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($ciProcessParams, "output.png"); // rules
|
||||
$result = $cosClient->putObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'object.jpg',
|
||||
'Body' => fopen('/tmp/local.jpg', 'rb'), // 本地文件
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// ---------------------------- 3. 上传时处理 ---------------------------- //
|
||||
|
||||
// --------------------- 4. 云上数据处理 ------------------------------ //
|
||||
$ciProcessParams = new Qcloud\Cos\ImageParamTemplate\CIProcessTransformation('AISuperResolution');
|
||||
|
||||
$picOperations = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperations->setIsPicInfo(1); // is_pic_info
|
||||
$picOperations->addRule($ciProcessParams, 'output.jpg'); // rules
|
||||
$result = $cosClient->ImageProcess(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.jpg',
|
||||
'PicOperations' => $picOperations->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// --------------------- 4. 云上数据处理 ------------------------------ //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
40
vendor/qcloud/cos-sdk-v5/sample/aILicenseRecProcess.php
vendored
Normal file
40
vendor/qcloud/cos-sdk-v5/sample/aILicenseRecProcess.php
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
$local_path = "/data/exampleobject";
|
||||
try {
|
||||
// -------------------- 1. 卡证识别 原图存储在COS -------------------- //
|
||||
$result = $cosClient->aILicenseRecProcess(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.jpg',
|
||||
'CardType' => 'IDCard', // 卡证识别类型,有效值为IDCard,DriverLicense。<br>IDCard表示身份证;DriverLicense表示驾驶证,默认:DriverLicense
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 1. 卡证识别 原图存储在COS -------------------- //
|
||||
|
||||
// -------------------- 2. 卡证识别 原图来自其他链接 暂不支持 -------------------- //
|
||||
$result = $cosClient->aILicenseRecProcess(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // 该值为空即可
|
||||
'DetectUrl' => 'https://www.xxx.com/xxx.jpg',
|
||||
'CardType' => 'IDCard', // 卡证识别类型,有效值为IDCard,DriverLicense。<br>IDCard表示身份证;DriverLicense表示驾驶证,默认:DriverLicense
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 2. 卡证识别 原图来自其他链接 暂不支持 -------------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/addHotLink.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/addHotLink.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/appendObject.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/appendObject.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
29
vendor/qcloud/cos-sdk-v5/sample/autoTranslationBlockProcess.php
vendored
Normal file
29
vendor/qcloud/cos-sdk-v5/sample/autoTranslationBlockProcess.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 实时文字翻译
|
||||
$result = $cosClient->autoTranslationBlockProcess(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'InputText' => '', // 待翻译的文本
|
||||
'SourceLang' => '', // 输入语言,如 "zh"
|
||||
'TargetLang' => '', // 输出语言,如 "en"
|
||||
// 'TextDomain' => '', // 文本所属业务领域,如: "ecommerce", //缺省值为 general
|
||||
// 'TextStyle' => '', // 文本类型,如: "title", //缺省值为 sentence
|
||||
));
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/bindCiService.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/bindCiService.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php
vendored
Executable file → Normal file
31
vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
@ -17,6 +17,9 @@ try {
|
||||
$blindWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg");
|
||||
$blindWatermarkTemplate->setType(2);
|
||||
$blindWatermarkTemplate->setLevel(3);
|
||||
$blindWatermarkTemplate->setVersion("2.0");
|
||||
|
||||
// -------------------- 1. 下载时处理 -------------------- //
|
||||
$result = $cosClient->getObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
@ -25,6 +28,32 @@ try {
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 1. 下载时处理 -------------------- //
|
||||
|
||||
// -------------------- 2. 上传时处理 -------------------- //
|
||||
$local_path = "/data/exampleobject";
|
||||
$picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperationsTemplate->setIsPicInfo(1);
|
||||
$picOperationsTemplate->addRule($blindWatermarkTemplate, "resultobject");
|
||||
$result = $cosClient->putObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'Body' => fopen($local_path, 'rb'),
|
||||
'PicOperations' => $picOperationsTemplate->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 2. 上传时处理 -------------------- //
|
||||
|
||||
// -------------------- 3. 云上数据处理 -------------------- //
|
||||
$result = $cosClient->ImageProcess(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'PicOperations' => $picOperationsTemplate->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// -------------------- 3. 云上数据处理 -------------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/cancelInventoryTriggerJob.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/cancelInventoryTriggerJob.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/cancelLiveVideoAuditing.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/cancelLiveVideoAuditing.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'scheme' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/catchException.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/catchException.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/closeAiService.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/closeAiService.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 万象接口必须用https
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 关闭AI内容识别服务
|
||||
$result = $cosClient->closeAiService(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/closeAsrService.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/closeAsrService.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', // 万象接口必须用https
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 关闭智能语音服务 https://cloud.tencent.com/document/product/460/95755
|
||||
$result = $cosClient->closeAsrService(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/closeImageSlim.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/closeImageSlim.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/closeOriginProtect.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/closeOriginProtect.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/copy.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/copy.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/copyObject.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/copyObject.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
4
vendor/qcloud/cos-sdk-v5/sample/cosClient.php
vendored
Executable file → Normal file
4
vendor/qcloud/cos-sdk-v5/sample/cosClient.php
vendored
Executable file → Normal file
@ -9,7 +9,7 @@ $token = "COS_TMPTOKEN"; //如果使用永久密钥不需要填入token,如果
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region, //园区
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'timeout' => 10, //超时时间
|
||||
'connect_timeout' => 10, //连接超时时间
|
||||
'ip' => '', //ip
|
||||
@ -27,6 +27,6 @@ $cosClient = new Qcloud\Cos\Client(
|
||||
'anonymous' => true, //匿名模式
|
||||
),
|
||||
'timezone' => 'PRC', //时区
|
||||
'locationWithSchema' => true //Location中是否包含schema
|
||||
'locationWithScheme' => true //Location中是否包含scheme
|
||||
)
|
||||
);
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createAiTranslationJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createAiTranslationJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 万象接口必须使用https
|
||||
'scheme' => 'https', // 万象接口必须使用https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createAiWordsGeneralizeJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createAiWordsGeneralizeJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 万象接口必须使用https
|
||||
'scheme' => 'https', // 万象接口必须使用https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createBucket.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createBucket.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createFileCompressJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createFileCompressJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createFileHashCodeJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createFileHashCodeJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
6
vendor/qcloud/cos-sdk-v5/sample/createFileUncompressJobs.php
vendored
Executable file → Normal file
6
vendor/qcloud/cos-sdk-v5/sample/createFileUncompressJobs.php
vendored
Executable file → Normal file
@ -8,12 +8,12 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/83110 提交文件解压任务-异步
|
||||
// 提交文件解压任务-异步
|
||||
$result = $cosClient->createFileUncompressJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'FileUncompress',
|
||||
@ -25,6 +25,8 @@ try {
|
||||
'FileUncompressConfig' => array(
|
||||
'Prefix' => 'prefix',
|
||||
'PrefixReplaced' => '1',
|
||||
// 'UnCompressKey' => base64_encode('解压密钥'), // 解压密钥,传入时需先经过 base64编码
|
||||
// 'ListingFile' => false, // 指定查询任务或查看任务回调时,是否输出已解压的文件列表
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createFolder.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createFolder.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createInventoryTriggerJob.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createInventoryTriggerJob.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 万象接口必须使用https
|
||||
'scheme' => 'https', // 万象接口必须使用https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createM3U8PlayListJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createM3U8PlayListJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaConcatTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaConcatTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaDigitalWatermarkJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaDigitalWatermarkJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaExtractDigitalWatermarkJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaExtractDigitalWatermarkJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaHighSpeedHdTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaHighSpeedHdTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionTemplate.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionTemplate.php
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 创建音频降噪模板 https://cloud.tencent.com/document/product/460/94315
|
||||
$result = $cosClient->createMediaNoiseReductionTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'NoiseReduction',
|
||||
'Name' => 'NoiseReduction-Template',
|
||||
'NoiseReduction' => array(
|
||||
'Format' => 'wav',
|
||||
'Samplerate' => '16000',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaQualityEstimateJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaQualityEstimateJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSDRtoHDRJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSDRtoHDRJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
90
vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentVideoBodyJobs.php
vendored
Normal file
90
vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentVideoBodyJobs.php
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交视频人像抠图任务
|
||||
// start --------------- 使用模版 暂不支持模版ID ----------------- //
|
||||
$result = $cosClient->createMediaSegmentVideoBodyJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'SegmentVideoBody',
|
||||
'Input' => array(
|
||||
'Object' => 'input/test.mp4',
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => '',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000',
|
||||
'Object' => 'output/out.mp4',
|
||||
),
|
||||
// 'UserData' => '',
|
||||
// 'JobLevel' => '',
|
||||
),
|
||||
// 'CallBack' => '',
|
||||
// 'CallBackFormat' => '',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaSegmentVideoBodyJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'SegmentVideoBody',
|
||||
'Input' => array(
|
||||
'Object' => 'input/test.mp4',
|
||||
),
|
||||
'Operation' => array(
|
||||
'SegmentVideoBody' => array(
|
||||
'Mode' => 'Mask',
|
||||
'SegmentType' => '',
|
||||
'BackgroundGreen' => '',
|
||||
'BackgroundBlue' => '',
|
||||
'BackgroundLogoUrl' => '',
|
||||
'BinaryThreshold' => '',
|
||||
'RemoveRed' => '',
|
||||
'RemoveGreen' => '',
|
||||
'RemoveBlue' => '',
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000',
|
||||
'Object' => 'output/out.mp4',
|
||||
),
|
||||
// 'UserData' => '',
|
||||
// 'JobLevel' => '',
|
||||
),
|
||||
// 'CallBack' => '',
|
||||
// 'CallBackFormat' => '',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 万象接口必须使用https
|
||||
'scheme' => 'https', // 万象接口必须使用https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaStreamExtractJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaStreamExtractJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
74
vendor/qcloud/cos-sdk-v5/sample/createMediaTargetRecJobs.php
vendored
Normal file
74
vendor/qcloud/cos-sdk-v5/sample/createMediaTargetRecJobs.php
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交视频目标检测任务
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaTargetRecJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoTargetRec',
|
||||
'Input' => array(
|
||||
'Object' => 'test.mp4',
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => '',
|
||||
// 'UserData' => 'xxx',
|
||||
// 'JobLevel' => '0',
|
||||
),
|
||||
// 'CallBack' => '',
|
||||
// 'CallBackFormat' => '',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaTargetRecJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoTargetRec',
|
||||
'Input' => array(
|
||||
'Object' => 'test.mp4',
|
||||
),
|
||||
'Operation' => array(
|
||||
// 'UserData' => 'xxx',
|
||||
// 'JobLevel' => '0',
|
||||
'VideoTargetRec' => array(
|
||||
'Body' => 'true',
|
||||
'Pet' => 'true',
|
||||
'Car' => 'false',
|
||||
),
|
||||
),
|
||||
// 'CallBack' => '',
|
||||
// 'CallBackFormat' => '',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
32
vendor/qcloud/cos-sdk-v5/sample/createMediaTargetRecTemplate.php
vendored
Normal file
32
vendor/qcloud/cos-sdk-v5/sample/createMediaTargetRecTemplate.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 创建视频目标检测模板
|
||||
$result = $cosClient->createMediaTargetRecTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoTargetRec',
|
||||
'Name' => 'template-name',
|
||||
'VideoTargetRec' => array(
|
||||
'Body' => 'true',
|
||||
'Pet' => 'true',
|
||||
'Car' => 'false',
|
||||
), // Body、Pet、Car 不能同时为 false
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeProTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeProTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 万象接口必须使用https
|
||||
'scheme' => 'https', // 万象接口必须使用https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoEnhanceJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoEnhanceJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoEnhanceTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoEnhanceTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoTagJobs.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoTagJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
6
vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php
vendored
Executable file → Normal file
6
vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
@ -29,6 +29,8 @@ try {
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'VoiceSeparate01.mp3',
|
||||
'AuObject' => 'VoiceSeparate02.mp3',
|
||||
'BassObject' => 'VoiceSeparate03.mp3',
|
||||
'DrumObject' => 'VoiceSeparate04.mp3',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
@ -52,6 +54,8 @@ try {
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'VoiceSeparate01.mp3',
|
||||
'AuObject' => 'VoiceSeparate02.mp3',
|
||||
'BassObject' => 'VoiceSeparate03.mp3',
|
||||
'DrumObject' => 'VoiceSeparate04.mp3',
|
||||
),
|
||||
'VoiceSeparate' => array(
|
||||
'AudioMode' => 'AudioAndBackground',
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
2
vendor/qcloud/cos-sdk-v5/sample/createMediaWatermarkTemplate.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/sample/createMediaWatermarkTemplate.php
vendored
Executable file → Normal file
@ -8,7 +8,7 @@ $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的regio
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'scheme' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user