Creates an M3U8 index file for a recording in the specified time range.

ApsaraVideo Live allows you to record live streams in the M3U8 format, store the M3U8 files and their media segment files in Object Storage Service (OSS) buckets, and then edit the stored media segment files in real time.

Note
  • You can create an index file only after a live stream is ingested. If no video is streamed in the specified time range or the specified live stream name is invalid, the index file fails to be created.
  • The time range that is specified by the StartTime and EndTime parameters must be the duration of at least one media segment file. The default duration of one media segment file is 30 seconds.
  • ApsaraVideo Live stores the information about media segment files only for three months. You can create M3U8 index files only for the recordings of the previous three months.
  • OSS stores media segment files for a time period that is specified by the storage configuration.
  • ApsaraVideo Live stores the information about M3U8 index files only for six months. You can query only the information about the M3U8 index files that are created in the previous six months.
  • OSS stores M3U8 index files for a time period that is specified by the storage configuration.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateLiveStreamRecordIndexFiles

The operation that you want to perform. Set the value to CreateLiveStreamRecordIndexFiles.

AppName String Yes AppName

The name of the application to which the live stream belongs.

DomainName String Yes live.yourdomain.com

The main streaming domain.

EndTime String Yes 2017-12-22T08:00:00Z

The end of the recording for which the M3U8 index file is created. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

OssBucket String Yes test123

The name of the OSS bucket in which the M3U8 index file is stored.

OssEndpoint String Yes oss-cn-shanghai.aliyuncs.com

The endpoint of OSS.

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

The name of the recording that is stored in OSS.

StartTime String Yes 2017-12-21T08:00:00Z

The beginning of the recording for which the M3U8 index file is created. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

StreamName String Yes testStream

The name of the live stream.

Response parameters

Parameter Type Example Description
RecordInfo Struct

The recording configuration.

RecordUrl String http://*****/atestObject.m3u8

The URL of the M3U8 index file.

DomainName String test.com

The main streaming domain.

AppName String AppName

The name of the application to which the live stream belongs.

StreamName String TestStream

The name of the live stream.

StartTime String 2015-12-01T07:36:00Z

The beginning of the recording for which the M3U8 index file is created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

EndTime String 2015-12-01T07:40:00Z

The end of the recording for which the M3U8 index file is created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Duration Float 20

The recording length. Unit: seconds.

Height Integer 480

The height of the video.

Width Integer 640

The width of the video.

CreateTime String 2016-05-27T09:40:56Z

The time when the M3U8 index file was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

OssBucket String bucket

The name of the OSS bucket in which the M3U8 index file is stored.

OssEndpoint String oss-cn-hangzhou.aliyuncs.com

The endpoint of OSS.

OssObject String atestObject.m3u8

The name of the recording that is stored in OSS.

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

The ID of the M3U8 index file.

RequestId String 550439A3-F8EC-4CA2-BB62-B9DB43EEEF30

The ID of the request.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=CreateLiveStreamRecordIndexFiles
&AppName=AppName
&DomainName=live.yourdomain.com
&EndTime=2017-12-22T08:00:00Z
&OssBucket=test123
&OssEndpoint= oss-cn-shanghai.aliyuncs.com
&OssObject={AppName}/{StreamName}/{Date}/{Hour}/{Minute}_{Second}.m3u8
&StartTime=2017-12-21T08:00:00Z
&StreamName=testStream
&<Common request parameters>

Sample success responses

XML format

<CreateLiveStreamRecordIndexFilesResponse>
      <RecordInfo>
            <AppName>AppName</AppName>
            <CreateTime>2016-05-27T09:40:56Z</CreateTime>
            <DomainName>www.yourdomain.com</DomainName>
            <Duration>588.849</Duration>
            <EndTime>2016-05-25T05:47:11Z</EndTime>
            <Height>480</Height>
            <OssBucket>bucket</OssBucket>
            <OssEndpoint>oss-cn-hangzhou.aliyuncs.com</OssEndpoint>
            <OssObject>atestObject.m3u8</OssObject>
            <RecordId>c4d7f0a4-b506-43f9-8de3-07732c3f3d82</RecordId>
            <RecordUrl>http://****/atestObject.m3u8</RecordUrl>
            <StartTime>2016-05-25T05:37:11Z</StartTime>
            <StreamName>testStream</StreamName>
            <Width>640</Width>
      </RecordInfo>
      <RequestId>550439A3-F8EC-4CA2-BB62-B9DB43EEEF30</RequestId>
</CreateLiveStreamRecordIndexFilesResponse>

JSON format

{
    "RecordInfo":{
        "AppName":"AppName",
        "CreateTime":"2016-05-27T09:40:56Z",
        "DomainName":"www.yourdomain.com",
        "Duration":588.849,
        "EndTime":"2016-05-25T05:47:11Z",
        "Height":480,
        "OssBucket":"bucket",
        "OssEndpoint":"oss-cn-hangzhou.aliyuncs.com",
        "OssObject":"atestObject.m3u8",
        "RecordId":"c4d7f0a4-b506-43f9-8de3-07732c3f3d82",
        "RecordUrl":"http://****/atestObject.m3u8",
        "StartTime":"2016-05-25T05:37:11Z",
        "StreamName":"testStream",
        "Width":640
    },
    "RequestId":"550439A3-F8EC-4CA2-BB62-B9DB43EEEF30"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidStartTime.Malformed Specified StartTime is malformed. The error message returned because the format of the start time is invalid. Check whether the value of the StartTime parameter is valid.
400 InvalidEndTime.Malformed Specified EndTime is malformed. The error message returned because the format of the end time is invalid. Check whether the value of the EndTime parameter is valid.
400 InvalidEndTime.Mismatch Specified end time does not math the specified start time. The error message returned because the time range that is specified by the StartTime and EndTime parameters is invalid. Check whether the StartTime and EndTime parameters are correctly specified.
400 InvalidOssBucket.Malformed Specified OssBucket is malformed. The error message returned because the format of the OSS bucket name is invalid. Check whether the value of the OssBucket parameter is valid.
400 InvalidOssObject.Malformed Specified OssObject is malformed. The error message returned because the format of the OSS object name is invalid. Check whether the value of the OssObject parameter is valid.
400 InvalidStream.NotFound Speicified stream does not exist. The error message returned because the live stream does not exist. Check whether the value of the StreamName parameter is valid.
400 InvalidConfig.Changed The oss bucket info between StartTime and EndTime has changed. The error message returned because the bucket information changed in the time range that is specified by the StartTime and EndTime parameters.
400 NoRecordContent The record content between StartTime and EndTime is empty. The error message returned because no recordings exist in the time range that is specified by the StartTime and EndTime parameters.

For a list of error codes, visit the API Error Center.