edit-icon download-icon

AddLiveAppRecordConfig

Last Updated: Aug 16, 2018

Description

Configure App recording, and the output content is stored in OSS.

Request parameters

Parameters Type Required Example values Description
Action String Yes AddLiveAppRecordConfig

The name of this interface. Value: AddLiveAppRecordConfig

AppName String Yes test123

Name of the app, which the live stream belongs to.
The wildcard () is supported, indicating all the AppNames under the domain name.

DomainName String Yes test.com

Your CDN domain name.

OssBucket String Yes test123

Name of the bucket in OSS.

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

OSS endpoint domain name.

EndTime String No 2018-04-16T09:57:21Z

The end time of recording time.
The time must be set as within 15 days from the current time, only valid at the stream-level recording (StreamName is not left blank.), and must be later than the recording start time.

OnDemand Integer No 1

Recording on demand.

  • 0 indicates off.
  • 1 indicates recording by using HTTP callback.
  • 2 indicates recording by using streaming parameters.
When you use the *1 method, you must set OnDemandCallback, or the recording is not performed by default.

RecordFormat.N.CycleDuration Integer No 1

Cycle recording duration.
Unit: seconds.
If the parameter is left blank, the duration is 1 hour by default.

RecordFormat.N.Format String No m3u8

Format.
Currently supports m3u8, flv, and mp4 for periodic recording.

RecordFormat.N.OssObjectPrefix String No record/{AppName}/{StreamName}/{EscapedStartTime}{EscapedEndTime}

Recorded file name stored in OSS.

  • Smaller than 256 bytes.
  • Supports variable matching, including {AppName}, {StreamName}, {EscapedStartTime} and {EscapedEndTime}.
  • For example, record/{AppName}/{StreamName}/{EscapedStartTime}{EscapedEndTime}.
  • Parameter value must include {EscapedStartTime} and {EscapedEndTime} variables.
  • Supports one-hour periodic recording by default, minimum 15 minutes and up to 6 hours.
  • {EscapedStartTime}/{EscapedEndTime} format is 2006-01-02-15-04-05.
  • We recommend that you use Escaped format to avoid possible problems from certain special characters in the URL.

RecordFormat.N.SliceOssObjectPrefix String No record/{AppName}/{StreamName}/{UnixTimestamp}_{Sequence}

When the recording format is m3u8, you must configure the name of ts slicer.

  • Each ts slice is 30 seconds by default, smaller than 256 bytes.
  • Supports variable matching, includes {AppName}, {StreamName} and {UnixTimestamp}.
  • For example, record/{AppName}/{StreamName}/{UnixTimestamp}.
  • Parameter value must contain variable {UnixTimestamp}.

StartTime String No 2018-04-10T09:57:21Z

Recording start time.
The time must be set as within 15 days from the current time, only valid at the stream-level recording (StreamName is not left blank.).

StreamName String No teststream

Stream name.

Return parameters

Parameters Type Example values Description
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

The ID of the job request

Example

Request example

  1. /?AppName=test123
  2. &DomainName=test.com
  3. &OssBucket=test123
  4. &OssEndpoint=oss-cn-shanghai.aliyuncs.com
  5. &Action=AddLiveAppRecordConfig
  6. &RecordFormat.1.Format=m3u8
  7. &AccessKeyId=XxlctR6mMqO6mhXxX
  8. &EndTime=2018-04-16T09:57:21Z
  9. &OnDemand=1
  10. &RecordFormat.1.CycleDuration=1
  11. &RecordFormat.1.OssObjectPrefix=record/{AppName}/{StreamName}/{Sequence}{EscapedStartTime}{EscapedEndTime}
  12. &RecordFormat.1.SliceOssObjectPrefix=record/{AppName}/{StreamName}/{UnixTimestamp}_{Sequence}
  13. &StartTime=2018-04-10T09:57:21Z
  14. &StreamName=teststream
  15. &<Public Request Parameter>

Normal return example

JSON format

  1. {
  2. "RequestId":"16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
  3. }

Exception return example

JSON format

  1. {
  2. "Code":"InternalError",
  3. "HostId":"live.aliyuncs.com",
  4. "Message":"The request processing has failed due to some unknown error.",
  5. "RequestId":"6EBD1AC4-C34D-4AE1-963E-B688A228BE31"
  6. }

Error code

For more information about error code of this product, see Error code.

Thank you! We've received your feedback.