All Products
Search
Document Center

ApsaraVideo Live:CreateLiveStreamRecordIndexFiles

Last Updated:Jul 15, 2026

Creates an M3U8 index file for a specified time range.

Operation description

You have configured OSS. For more information, see Configure OSS. Live recording indexing records a live video stream in M3U8 format, stores it in OSS, and performs real-time clipping on the stored TS segment index files.

Note
  • To create a recording index, the live stream must have had stream ingest activity. If no live streaming occurred within the specified time range or the stream name is incorrect, the recording index creation is failed.

  • Make sure that DomainName, AppName, and StreamName are correct. Otherwise, the InvalidStream.NotFound error is returned.

  • The interval between StartTime and EndTime must be at least the duration of one TS segment (30 seconds by default).

  • EndTime must be later than StartTime, and the interval cannot exceed 4 days.

  • TS segment information is retained in the ApsaraVideo Live system for only 3 months. You can create an M3U8 file only from recordings within the last 3 months.

  • TS segment files are stored in OSS. The retention period is determined by the OSS storage configuration. For more information, see Settings lifecycle rules.

  • Information about created M3U8 index files is retained in the ApsaraVideo Live system for only 6 months. You can query only the information of index files created within the last 6 months.

  • M3U8 index files are stored in OSS. The retention period is determined by the OSS storage configuration.

  • If the M3U8 and TS files are stored in different buckets, the TS paths in the M3U8 file are in HTTP format.

QPS limit

The single-user QPS limit for this API is 45 calls per second. If this limit is exceeded, throttling is triggered, which may affect your business. Call this operation as appropriate.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

live:CreateLiveStreamRecordIndexFiles

create

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

DomainName

string

Yes

The streamer streaming domain.

example.com

AppName

string

Yes

The name of the application to which the stream belongs. The AppName must match the AppName in the ingest URL for the template to take effect. To match all AppName values, set this parameter to *.

liveApp****

StreamName

string

Yes

The stream name. The StreamName must match the StreamName in the ingest URL for the template to take effect. To match all StreamName values, set this parameter to *.

The stream must have had actual stream ingest activity under the specified DomainName and AppName. Otherwise, the InvalidStream.NotFound error is returned.

liveStream****

OssEndpoint

string

Yes

The endpoint of the OSS bucket.

cn-oss-****.aliyuncs.com

OssBucket

string

Yes

The name of the OSS bucket.

liveBucket****

OssObject

string

Yes

The name of the recording file stored in OSS.

{AppName}/{StreamName}/{Date}/{Hour}/{Minute}_{Second}.m3u8

StartTime

string

Yes

The start time of the index file. TS files uploaded after this time are included in the index file. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

2017-12-21T08:00:00Z

EndTime

string

Yes

The end time of the index file. TS files uploaded before this time are included in the index file. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

2017-12-22T08:00:00Z

EndTimeIncluded

boolean

No

Specifies whether to include the end time. If you set this parameter to true, the system attempts to include one additional TS file so that the created index file fully covers the period between StartTime and EndTime.

false

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

550439A3-F8EC-4CA2-BB62-B9DB43EEEF30

RecordInfo

object

The recording configuration information.

RecordUrl

string

The URL of the index file.

http://*****/atestObject.m3u8

StreamName

string

The stream name.

liveStream****

CreateTime

string

The creation time. The time is in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

2016-05-27T09:40:56Z

RecordId

string

The ID of the index file.

c4d7f0a4-b506-43f9-8de3-07732c3f****

Height

integer

The video height.

480

OssBucket

string

The name of the OSS bucket.

liveBucket****

DomainName

string

The streamer streaming domain.

example.com

OssObject

string

The name of the recording file stored in OSS.

liveObject****.m3u8

EndTime

string

The end time. The time is in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

2015-12-01T07:40:00Z

AppName

string

The name of the application to which the stream belongs.

liveApp****

StartTime

string

The start time. The time is in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

2015-12-01T07:36:00Z

Width

integer

The video width.

640

Duration

number

The recording length. Unit: seconds.

20

OssEndpoint

string

The endpoint of the OSS bucket.

cn-oss-****.aliyuncs.com

Examples

Success response

JSON format

{
  "RequestId": "550439A3-F8EC-4CA2-BB62-B9DB43EEEF30",
  "RecordInfo": {
    "RecordUrl": "http://*****/atestObject.m3u8",
    "StreamName": "liveStream****",
    "CreateTime": "2016-05-27T09:40:56Z",
    "RecordId": "c4d7f0a4-b506-43f9-8de3-07732c3f****",
    "Height": 480,
    "OssBucket": "liveBucket****",
    "DomainName": "example.com",
    "OssObject": "liveObject****.m3u8",
    "EndTime": "2015-12-01T07:40:00Z",
    "AppName": "liveApp****",
    "StartTime": "2015-12-01T07:36:00Z",
    "Width": 640,
    "Duration": 20,
    "OssEndpoint": "cn-oss-****.aliyuncs.com"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidStartTime.Mismatch Specified StartTime does not math the current time.
400 InvalidStartTime.Malformed Specified StartTime is malformed.
400 InvalidParams invalid params
400 InvalidEndTime.Malformed Specified EndTime is malformed.
400 InvalidEndTime.Mismatch Specified end time does not math the specified start time. The end time does not match the start time. Make sure that the start and end times match.
400 InvalidOssEndpoint.Malformed Specified OssEndpoint is malformed.
400 InvalidOssBucket.Malformed Specified OssBucket is malformed. Invalid value of OSSBucket. Check whether the OSSBucket parameter that you specified is correct.
400 InvalidOssObject.Malformed Specified OssObject is malformed.
400 InvalidStream.NotFound Speicified stream does not exist.
400 InvalidConfig.Changed The oss bucket info between StartTime and EndTime has changed. ossbucket start end time has changed.
400 NoRecordContent The record content between StartTime and EndTime is empty. No records were found between StartTime and EndTime.
400 RecordContentExceed The record content between StartTime and EndTime is exceeded, please narrow down the range.
400 OperationNotSupport The Operation is not support for flv/mp4 format or live to vod record.
500 InternalError The request processing has failed due to some unknown error, exception or failure.
404 InvalidBucket.NotFound The bucket does not belong to you. the specified bucket does not belong to the current user.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.