# Standard recording post-processing (/en/api-reference/api-ref/broadcast-streaming/standard-recording/post-processing)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

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 [#create-a-clip]

Cuts out a specific part of a video recording of a live stream and generates an M3U8 file.

### HTTP request [#http-request]

```bash
POST https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/admin/record/standard/regions/{region}/cutting/{stream_name}
```

#### Path parameter [#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 [#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 [#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 ](#http-code)for possible reasons.

### Example [#example]

**Request line**

```bash
POST https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/admin/record/standard/regions/{region}/cutting/{stream_name} HTTP/1.1
```

**Request body**

```json
{
    "startTime": "2019-01-07T12:00:00+08:00",
    "endTime": "2019-01-07T12:30:00+08:00",
    "fileName": "test.m3u8"
}
```

**Response line**

```bash
HTTP/1.1 200 OK
```

## Create a snapshot [#create-a-snapshot]

Takes a snapshot from a video recording of a live stream and generates a JPEG file.

### HTTP request [#http-request-1]

```bash
POST https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/admin/record/standard/regions/{region}/snapshot/{stream_name}
```

#### Path parameter [#path-parameter-1]

| 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 [#request-body-1]

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 [#http-response-1]

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 ](#http-code)for possible reasons.

### Example [#example-1]

**Request line**

```bash
POST https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/admin/record/standard/regions/{region}/snapshot/{stream_name} HTTP/1.1
```

**Request body**

```json
{
    "time": "2019-01-07T12:30:00+08:00",
    "fileName": "test.jpg"
}
```

**Response line**

```bash
HTTP/1.1 200 OK
```

## List recording files [#list-recording-files]

Lists the recording files for the specified live stream within a time range.

### HTTP request [#http-request-2]

```bash
GET https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/admin/record/standard/regions/{region}/preview_list?start_time={start_time}&end_time={end_time}&stream_name={stream_name}
```

#### Path parameter [#path-parameter-2]

| 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 [#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 [#http-response-2]

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) from `startTime` to the playback position.

If the returned HTTP status code is not 200, the request fails. You can refer to the [HTTP status codes](#http-code) for possible reasons.

### Example [#example-2]

**Request line**

```bash
GET https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/admin/record/standard/regions/{region}/preview_list?start_time={start_time}&end_time={end_time}&stream_name={stream_name} HTTP/1.1
```

**Response line**

```bash
HTTP/1.1 200 OK
```

**Request body**

```bash
{
    "list": [
        {
            "fileName": "record/{entry_point}/{stream_name}/{m3u8_file_name}",
            "startTime": "2021-08-25T10:44:40+08:00",
            "endTime": "2021-08-25T11:01:49+08:00",
            "position": 3
        },
        {
            "fileName": "record/{entry_point}/{stream_name}/{m3u8_file_name}",
            "startTime": "2021-08-25T12:19:23+08:00",
            "endTime": "2021-08-25T14:42:58+08:00",
            "position": 2
        }
    ]
}
```

<a name="http-code" />

## HTTP status codes [#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.                         |
