All Products
Search
Document Center

ApsaraVideo Live:CreateLiveStreamRecordIndexFiles

Last Updated:Aug 28, 2025

Creates an m3u8 index file for a specified time range.

Operation description

You must have Object Storage Service (OSS) configured. For more information, see Configure OSS. ApsaraVideo Live records live streams in the m3u8 format and stores them in OSS. You can create an index of the recording to perform real-time video editing on the stored TS shards.

Note
  • To create a recording index, a live stream must have been ingested. The operation fails if no stream was ingested during the specified time or if the stream name is incorrect.

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

  • The duration between StartTime and EndTime must be at least the duration of one TS shard. The default duration is 30 s.

  • EndTime must be later than StartTime. The duration between them cannot exceed 4 days.

  • Because ApsaraVideo Live stores TS shard information for only 3 months, you can create m3u8 files only for recordings from the last 3 months.

  • TS shard files are stored in OSS. The retention period depends on your OSS storage configuration. For more information, see Set lifecycle rules.

  • Because ApsaraVideo Live stores information about created m3u8 index files for only 6 months, you can query information only for index files created within the last 6 months.

  • M3U8 index files are stored in OSS. The retention period depends on your OSS storage configuration.

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

QPS limit

The limit for this API call is 45 queries per second (QPS) for each user. If you exceed the limit, API calls are throttled, which may affect your business. Plan your API calls accordingly.

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 streaming domain.

example.com

AppName

string

Yes

The name of the application. The AppName must match the AppName in the ingest URL for the template to take effect. To match all applications, enter an asterisk (*).

liveApp****

StreamName

string

Yes

The name of the stream. The StreamName must match the StreamName in the ingest URL for the template to take effect. To match all streams, enter an asterisk (*).

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 for the index file. TS files uploaded after this time are included in the index file. The time must be in UTC and in the yyyy-MM-ddTHH:mm:ssZ format.

2017-12-21T08:00:00Z

EndTime

string

Yes

The end time for the index file. TS files uploaded before this time are included in the index file. The time must be in UTC and in the yyyy-MM-ddTHH:mm:ssZ format.

2017-12-22T08:00:00Z

EndTimeIncluded

boolean

No

Specifies whether to include the end time. If you set this to true, the system tries to include one more TS file to ensure that the created index file completely covers the time range between StartTime and EndTime.

false

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

550439A3-F8EC-4CA2-BB62-B9DB43EEEF30

RecordInfo

object

The recording information.

RecordUrl

string

The URL of the index file.

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

StreamName

string

The stream name.

liveStream****

CreateTime

string

The time when the file was created. The time is in UTC and in the yyyy-MM-ddTHH:mm:ssZ format.

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 streaming domain.

example.com

OssObject

string

The name of the recording file stored in OSS.

liveObject****.m3u8

EndTime

string

The end time of the recording. The time is in UTC and in the yyyy-MM-ddTHH:mm:ssZ format.

2015-12-01T07:40:00Z

AppName

string

The application name.

liveApp****

StartTime

string

The start time of the recording. The time is in UTC and in the yyyy-MM-ddTHH:mm:ssZ format.

2015-12-01T07:36:00Z

Width

integer

The video width.

640

Duration

number

The recording length in 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.
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.