Domain name for API request: live.tencentcloudapi.com.
Prerequisites
Mode description
This API supports two recording modes:
StopLiveRecord
is not called to terminate the task prematurely), the recording task is valid and will be started even after the push is interrupted and restarted multiple times.Precautions
A maximum of 500 requests can be initiated per second for this API.
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 Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: CreateLiveRecord. |
Version | Yes | String | Common Params. The value used for this API: 2018-08-01. |
Region | No | String | Common Params. This parameter is not required for this API. |
StreamName | Yes | String | Stream name. |
AppName | No | String | Push path, which is the same as the AppName in push and playback addresses and is live by default. |
DomainName | No | String | Push domain name. This parameter must be set for multi-domain name push. |
StartTime | No | String | Recording start time, which is China standard time and should be URL-encoded (RFC3986). For example, the encoding of 2017-01-01 10:10:01 is 2017-01-01+10%3a10%3a01. In scheduled recording mode, this field must be set; in real-time video recording mode, this field is ignored. |
EndTime | No | String | Recording end time, which is China standard time and should be URL-encoded (RFC3986). For example, the encoding of 2017-01-01 10:30:01 is 2017-01-01+10%3a30%3a01. In scheduled recording mode, this field must be set; in real-time video recording mode, this field is optional. If the recording is set to real-time video recording mode through the Highlight parameter, the set end time should not be more than 30 minutes after the current time. If the set end time is more than 30 minutes after the current time, earlier than the current time, or left empty, the actual end time will be 30 minutes after the current time. |
RecordType | No | String | Recording type. "video": Audio-video recording (default). "audio": audio recording. In both scheduled and real-time video recording modes, this parameter is valid and is not case sensitive. |
FileFormat | No | String | Recording file format. Valid values: "flv" (default), "hls", "mp4", "aac", "mp3". In both scheduled and real-time video recording modes, this parameter is valid and is not case sensitive. |
Highlight | No | Integer | Mark for enabling real-time video recording mode. 0: Real-time video recording mode is not enabled, i.e., the scheduled recording mode is used (default). See Sample 1. 1: Real-time video recording mode is enabled. See Sample 2. |
MixStream | No | Integer | Flag for enabling A+B=C mixed stream recording. 0: A+B=C mixed stream recording is not enabled (default). 1: A+B=C mixed stream recording is enabled. In both scheduled and real-time video recording modes, this parameter is valid. |
StreamParam | No | String | Recording stream parameter. The following parameters are supported currently: record_interval: recording interval in seconds. Value range: 1800-7200. storage_time: recording file storage duration in seconds. Example: record_interval=3600&storage_time=2592000. Note: the parameter needs to be URL-encoded. In both scheduled and real-time video recording modes, this parameter is valid. |
Parameter Name | Type | Description |
---|---|---|
TaskId | Integer | Task ID, which uniquely identifies a recording task globally. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to use this API for scenarios with fixed start time and end time of recording, such as training courses, business events, shows, and performances.
https://live.tencentcloudapi.com/?Action=CreateLiveRecord
&AppName=live
&DomainName=5000.live.push.com
&StreamName=livetest
&StartTime=2018-09-11+12%3a04%3a01
&EndTime=2018-09-11+12%3a08%3a01
&<Common request parameters>
{
"Response": {
"RequestId": "eac6b301-a322-493a-8e36-83b295459397",
"TaskId": 1234567
}
}
This example shows you how to immediately start to record any frame of a stream in real time. You can specify the EndTime
of the recording. The recording period is up to 30 minutes.
https://live.tencentcloudapi.com/?Action=CreateLiveRecord
&AppName=live
&DomainName=5000.live.push.com
&StreamName=livetest
&Highlight=1
&EndTime=2018-09-11+12%3a08%3a01
&<Common request parameters>
{
"Response": {
"RequestId": "eac6b301-a322-493a-8e36-83b295459397",
"TaskId": 1234567
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InternalError | Internal error. |
InternalError.GetConfigError | Error getting the configuration. |
InternalError.NetworkError | Internal network error. |
InvalidParameter | Invalid parameter. |
InvalidParameterValue | Invalid parameter value. |
LimitExceeded.MaximumRunningTask | The current number of concurrent tasks exceeds the limit. |
LimitExceeded.MaximumTask | The number of tasks created on the day exceeds the limit. |
ResourceNotFound.ChannelNotExist | The channel does not exist. |
ResourceNotFound.ForbidService | You are blocked. |
ResourceNotFound.FreezeService | Service suspended. |
ResourceNotFound.StopService | The service has been suspended due to account arrears. Please top up it to a positive balance to activate the service first. |
ResourceNotFound.UserDisableService | You disabled the service. |
ResourceUnavailable.InvalidVodStatus | The VOD service has not been activated. |
ResourceUnavailable.StreamNotExist | The stream does not exist. |
Was this page helpful?