Create Recording Task

Last updated: 2019-07-29 16:27:19

PDF

1. API Description

Domain name: live.api.qcloud.com

Note: This API (CreateRecord) is used to store recorded files on the VOD platform. If you want to use the recording feature, you need to activate VOD Service first. When recording files are stored, the charges (including charges for storage and downstream playback traffic) are calculated with VOD billing method. Note: API calling timeout should be greater than 3 seconds, because retries within 3 seconds and frequent calls may lead to duplicate recording tasks.

Recording rules
(1) The recording task starts at the preset time and ends when the LVB ends
(2) The recording is fragmented by time, and the longest fragment time is 0.5 hour
(3) The recording is stopped and a fragment is generated in case of a stream interruption
A new fragment recording task is started after the stream is resumed to repeat the preceding steps until the entire recording is completed
Fragment recording request URL format: http://(VOD bizid).vod.myqcloud.com/(vid).f0.flv
Or view the fragment on the VOD page

2. Input Parameters

Parameter Name Required Type Description
channelId Yes String Channel ID
startTime Yes String Start time (China Standard Time), such as 2017-01-01 10:10:01
endTime Yes String End time (China Standard Time), such as 2017-01-01 10:10:01
tapeType Yes Int Whether to enable real-time recording. 1 - Enable; 0 - Disable; 1 is recommended.
a. Creating real-time recording tasks requires that VJs push streams actively. The video recording starts at the moment when this API is successfully called. In this case, the parameter of task start time is ignored.
b. The real-time recording task supports a maximum length of 30 minutes. If the time difference between the passed task end time and the current time is longer than 30 minutes, only a length of 30 minutes is recorded. The recommended recording length is within 5 minutes.
c. If real-time recording is disabled, the parameter of task start time is required, and the time difference between the end time and the start time should not be longer than 1 day.

3. Output Parameters

Parameter Name Type Description
code Int Error code. 0: Successful; other values: Failed
message String Error message
task_id Int Task ID. 64-bit unsigned integer

4. Example

Input 1


http://domain/v2/index.php?Action=CreateRecord&channelId=123&tapeType=1&endTime=2016-01-21 12:00:00&Common request parameters

Output 1

{
   "code": 0,
   "message": "",
   "task_id": 1

}