当前内容仅提供英语版本,中文版我们将尽快补充,感谢您的理解。

StartWebRecord

1. API Description

Domain name for API request: trtc.intl.tencentcloudapi.com.

This API is used to trigger a page recording task. Specify parameters such as the recording URL, recording resolution, and recording result storage in the API parameter.
Because parameter or API logic issues will return immediate results. For page issues such as page unreachable, results will be returned in the callback, stay tuned.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: StartWebRecord.
VersionYesStringCommon Params. The value used for this API: 2019-07-22.
RegionYesStringCommon Params. For more information, please see the list of regions supported by the product. This API only supports: ap-singapore.
RecordUrlYesString[Required] webpage URL that needs to be recorded.
StorageParamsYesStorageParams[Required] cloud storage related parameters. currently supports tencent cloud object storage as well as VOD. no support for third-party cloud storage. the storage format of the output file is only supported for hls or mp4.
SdkAppIdYesInteger[Required] the SdkAppId of TRTC.
MaxDurationLimitNoIntegerMaximum recording duration limit in seconds. valid values [1800, 86400]. default 86400s (24 hr).
WebRecordVideoParamsNoWebRecordVideoParamsPage recording video parameter.
RecordIdNoStringWhen sensitive to repetition tasks, pay attention to this value: to avoid triggering tasks repeatedly in a short time frame, which may lead to task duplication.
Import the recording RecordId to identify the task, less than 32 bytes. if carrying RecordId initiates start recording requests more than twice, only one task will start up, and the second will report error FailedOperation.TaskExist. note that when StartWebRecord call fails instead of FailedOperation.TaskExist error, change RecordId and re-initiate the request.
PublishCdnParams.NNoArray of McuPublishCdnParamIf you want to push stream to CDN, you can configure parameters in PublishCdnParams.N. it supports streaming simultaneously to up to 10 CDN addresses. if the relay address is tencent cloud CDN, set IsTencentCdn to 1.
ReadyTimeoutNoIntegerTimeout period for recording page resource loading, unit: second. default value is 0, which must be greater than or equal to 0 and less than or equal to 60. do not set this parameter when page loading timeout detection is disabled for the recording page.
EmulateMobileParamsNoEmulateMobileParamsRender the mobile mode parameter. do not set this parameter when not preparing to render the mobile mode webpage.

3. Output Parameters

Parameter NameTypeDescription
TaskIdStringUnique Id of the recording task.
RequestIdStringThe unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Start a Page Recording Task

Input Example

POST / HTTP/1.1
Host: trtc.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: StartWebRecord
<Common request parameters>

{
    "RecordUrl": "https://web-record-xxxxx.cos.ap-xxx.myqcloud.com/xxxx/xxx.mp4",
    "StorageParams": {
        "CloudStorage": {
            "Vendor": 0,
            "Bucket": "webrecord-1234589",
            "Region": "ap-chengdu",
            "AccessKey": "AKxxxxxx",
            "SecretKey": "Idxxxxxx",
            "FileNamePrefix": [
                "record",
                "video"
            ]
        }
    },
    "SdkAppId": 1600011111,
    "MaxDurationLimit": 3600,
    "WebRecordVideoParams": {
        "Width": 1280,
        "Height": 720,
        "Format": "mp4"
    }
}

Output Example

{
    "Response": {
        "TaskId": "HMLm5HWNuUAXSb0gTEOx0z1x+nLMZNjXrY3keyUSvu7uu8mF9O656uNtbUtvaWLkpMY134jTN2Ix4vuqgOJ68nQ8tho3ri",
        "RequestId": "2a76ee73-6579-42f0-8d57-1f6c9b9d7208"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error CodeDescription
FailedOperation.NotAbilityUnlock the required capability bit.
FailedOperation.NotAllowedThis operation is not allowed. submit a ticket to contact us.
FailedOperation.SdkAppIdNotUnderAppIdNo resource belonging to this SdkAppId under the AppId.
FailedOperation.TaskExistTask already exists
ResourceInsufficient.RequestRejectionInsufficient resources.