All Products
Search
Document Center

ApsaraVideo Live:CreateLiveStreamRecordIndexFiles

Last Updated:Dec 30, 2025

Creates an M3U8 manifest for a specified time range.

Operation description

You must have Object Storage Service (OSS) configured. For more information, see Configure OSS. ApsaraVideo Live can record live streams in the M3U8 format and store TS segments in OSS. This API generates an M3U8 manifest by performing real-time clipping of recorded TS segments.

Note
  • To create a manifest, the live stream must have been active during the specified period. The operation will fail if the stream was not active 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 time interval between StartTime and EndTime must be at least the duration of one TS segment (default is 30 seconds).

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

  • TS segment information is retained in the system for only 3 months. You can only create M3U8 manifests for recordings within the last 3 months.

  • TS segment files are stored in OSS. Their retention period is determined by your OSS lifecycle rules. For details, see Set lifecycle rules.

  • Metadata for created M3U8 manifests is retained in the system for 6 months. You can only query information about manifests created within this period.

  • M3U8 manifests are stored in OSS. Their retention period is determined by your OSS lifecycle rules.

  • If the M3U8 manifest and TS files are stored in different buckets, the TS paths within the M3U8 manifest will be absolute HTTP URLs.

QPS limit

You can call this operation up to 45 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions.

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

example.com

AppName

string

Yes

The AppName of the live stream. The template takes effect only when this name matches the AppName in the ingest URL. Use * to match all application names.

liveApp****

StreamName

string

Yes

The stream name. The template takes effect only when this name matches the StreamName in the ingest URL. Use * to match all stream names.

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 path and file name for the recording file in OSS.

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

StartTime

string

Yes

The start time for the manifest. TS segments uploaded after this time will be included. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).

2017-12-21T08:00:00Z

EndTime

string

Yes

The end time for the manifest. TS segments uploaded before this time will be included. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).

2017-12-22T08:00:00Z

EndTimeIncluded

boolean

No

Specifies whether to include an extra TS segment to cover the EndTime. If set to true, the created manifest will fully cover the StartTime to EndTime range.

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 manifest.

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

StreamName

string

The stream name.

liveStream****

CreateTime

string

The creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).

2016-05-27T09:40:56Z

RecordId

string

The ID of the manifest.

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

Height

integer

The video height.

480

OssBucket

string

The name of the OSS bucket.

liveBucket****

DomainName

string

The main streaming domain.

example.com

OssObject

string

The path and file name of the recording file in OSS.

liveObject****.m3u8

EndTime

string

The end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).

2015-12-01T07:40:00Z

AppName

string

The AppName of the live stream.

liveApp****

StartTime

string

The start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).

2015-12-01T07:36:00Z

Width

integer

The video width.

640

Duration

number

The recording duration. 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.

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.