PHP code example of liujinyong / tencent-v3-api
1. Go to this page and download the library: Download liujinyong/tencent-v3-api library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
liujinyong / tencent-v3-api example snippets
cretId = "";
$secretKey = "";
$userHearderImg = "";
$groupId = "";
$pushUrl = "";
$pullUrl = ""
$key = "";
//创建人员库
$people = new \Liujinyong\TencentV3Api\Lib\People($secretId, $secretKey);
$res = $people->CreatePerson("user1", "26", $userHearderImg, $groupId);
//删除人员库
$res = $people->DeletePersonFromGroup("26", $groupId);
//验证人脸
$face = new \Liujinyong\TencentV3Api\Lib\Face($secretId, $secretKey);
$res = $face->VerifyFace("user1", $userHearderImg);
//获取直播推拉流地址
$live = new \Liujinyong\TencentV3Api\Lib\Live($secretId,$secretKey,$pushUrl,$pullUrl);
$res = $live->getLiveUrl("live","ceshi1",$key,"2022-04-10 17:33:00",true);
//创建直播录制任务
$res = $live->createRecordTask("luzhi",$pushUrl,"live",1649732129);
//根据流名称查询在线人数
$res = $live->DescribeStreamPlayInfoList("aaa");
//终止直播录制任务
$taskId = "";
$res = $live->stopRecordTask($taskId);
//创建视频审核任务
$callBack = "";
$bizType = "";
$security = new \Liujinyong\TencentV3Api\Lib\Security($secretId,$secretKey);
$res = $security->createVideoSecurityTask("bbb",$pullUrl,$bizType,$callBack);
//终止视频审核任务
$taskIdforVideo = "";
$res = $security->cancelTask($taskIdforVideo);
//名片识别接口
$ocr = new \Liujinyong\TencentV3Api\Lib\Ocr($secretId,$secretKey);
$res = $ocr->BusinessCardOCR($imageUrl);
//文本内容安全接口
$client = new \Liujinyong\TencentV3Api\Lib\ContentSecurity($secretId,$secretKey);
$res = $client->check("社会主义价值观");
//图片内容安全接口
$client = new \Liujinyong\TencentV3Api\Lib\ImageSecurity($secretId,$secretKey);
$res = $client->checkSync("ImageUrl","Target_id");