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.
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
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
live:CreateLiveStreamRecordIndexFiles | create | *Domain
| 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 | liveApp**** |
StreamName | string | Yes | The stream name. The template takes effect only when this name matches the StreamName in the ingest URL. Use | 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.