Standard recording post-processing
Standard recording supports creating clips and snapshots out of a video recording file, as well as querying the existing recording files for a live stream.
Create a clip
Cuts out a specific part of a video recording of a live stream and generates an M3U8 file.
HTTP request
Path parameter
Parameter | Type | Description |
---|---|---|
appid | String | Required. The App ID retrieved from Agora Console. |
entry_point | String | Required. The entry point name. |
region | String | Required. The area corresponding to the video recording. |
stream_name | String | Required. The stream name. |
Request body
The request body is in the JSON Object type and contains the following fields:
Field | Type | Description |
---|---|---|
startTime | String | Required. The starting time of the clip on the video recording's timeline, in the RFC3339 format, for example, 2019-01-07T12:00:00+08:00. |
endTime | String | Optional. The ending time of the clip on the video recording's timeline, in the RFC3339 format, for example, 2019-01-07T12:30:00+08:00. This value cannot exceed the current time. If empty, this field is set as the time when the latest recording file was created. |
fileName | String | Required. The name of the generated M3U8 file. This field must be unique. |
HTTP response
If the returned HTTP status code is 200, the request is successful.
If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.
Example
Request line
Request body
Response line
Create a snapshot
Takes a snapshot from a video recording of a live stream and generates a JPEG file.
HTTP request
Path parameter
Parameter | Type | Description |
---|---|---|
appid | String | Required. The App ID retrieved from Agora Console. |
entry_point | String | Required. The entry point name. |
region | String | Required. The area corresponding to the video recording. |
stream_name | String | Required. The stream name. |
Request body
The request body is in the JSON Object type and contains the following fields:
Field | Type | Description |
---|---|---|
time | String | Optional. The time on the video recording's timeline when the snapshot is taken, in the RFC3339 format, for example, 2019-01-07T12:00:00+08:00. This value cannot exceed the current time. If empty, this field is set as the time when the latest recording file was created. |
fileName | String | Required. The name of the generated JPEG file. This field must be unique. |
HTTP response
If the returned HTTP status code is 200, the request is successful.
If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.
Example
Request line
Request body
Response line
List recording files
Lists the recording files for the specified live stream within a time range.
HTTP request
Path parameter
Parameter | Type | Description |
---|---|---|
appid | String | Required. The App ID retrieved from Agora Console. |
entry_point | String | Required. The entry point name. |
region | String | Required. The area corresponding to the video recording. |
Query parameter
Parameter | Type | Description |
---|---|---|
start_time | String | Required. The starting point of the time range to query recording files, in the RFC3339 format. For example, 2019-01-07T12:00:00Z . |
end_time | String | Required. The end point of the time range to query recording files, in the RFC3339 format. For example, 2019-01-07T12:00:00Z . |
stream_name | String | Required. The stream name. |
HTTP response
If the returned HTTP status code is 200, the request is successful. The response body contains the following fields:
list
:JSON Array. The list of recording files, in ascending order of the time when the recording starts. Each recording attempt corresponds to a JSON Object and contains the following fields:
startTime
:String. The start time of the recording in the RFC3339 format, for example"2019-01-07T12:00:00Z"
.endTime
:String. The end time of the recording in the RFC3339 format, for example"2019-01-07T12:00:00Z"
.fileName
:String. The path to the recording file.position
:Integer. The time offset (in seconds) fromstartTime
to the playback position.
If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.
Example
Request line
Response line
Request body
HTTP status codes
Status code | Description |
---|---|
200 | The request succeeds. |
400 | The parameter is invalid, for example the appid or the entry_point is empty, or the region parameter value is invalid. |
401 | Unauthorized (the customer ID and the customer secret do not match). |
404 | The server cannot find the resource according to the request, which means the requested entry point does not exist or the requested URI path is invalid. |
500 | An internal error occurs in the server, so the server is not able to complete the request. |
504 | An internal error occurs in the server. The gateway or the proxy server did not receive a timely request from the remote server. |