require_once 'vendor/autoload.php';
use TencentCloud\Common\Credential;
use TencentCloud\Common\Profile\ClientProfile;
use TencentCloud\Common\Profile\HttpProfile;
use TencentCloud\Common\Exception\TencentCloudSDKException;
use TencentCloud\Live\V20180801\LiveClient;
use TencentCloud\Live\V20180801\Models\CreateRecordTaskRequest;
use TencentCloud\Live\V20180801\Models\StopRecordTaskRequest;
$cred = new Credential("参数key", "参数secret");
$httpProfile = new HttpProfile();
$httpProfile->setEndpoint("live.tencentcloudapi.com");
$clientProfile = new ClientProfile();
$clientProfile->setHttpProfile($httpProfile);
$client = new LiveClient($cred, "ap-guangzhou", $clientProfile);
$req = new CreateRecordTaskRequest();
$params = array(
"StreamName" => $streamName,
"DomainName" => '参数域名',
"AppName" => $appName,
"EndTime" => time()+3600*12
);
$req->fromJsonString(json_encode($params));
$resp = $client->CreateRecordTask($req);
return json_decode($resp->toJsonString(),true);