All Products
Search
Document Center

ApsaraVideo Live:CreateLiveStreamMonitor

更新時間:Sep 15, 2023

Creates a monitoring session.

Usage notes

You can call this operation to create a monitoring session. Make sure that the parameter settings meet the requirements.

QPS limit

You can call this operation up to 10 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit on an API operation in ApsaraVideo Live.

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

CreateLiveStreamMonitor

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

MonitorName

String

Yes

liveMonitor****

The name of the monitoring session.

OutputTemplate

String

Yes

lp_ud

The output template of the monitoring session. Valid values:

  • lp_ld: low definition

  • lp_sd: standard definition

  • lp_hd: high definition

  • lp_ud: ultra high definition

Domain

String

Yes

demo.aliyundoc.com

The domain name of the monitoring session.

App

String

No

monitor****

The name of the application to which the output stream of the monitoring session belongs.

You can specify a name. If you do not specify a name, the system uses monitor as the name of the application.

Stream

String

No

monitorStream****

The name of the output stream of the monitoring session. If you do not specify a name, the system generates a random name.

InputList

String

No

InputConfig

The list of input streams to monitor. For more information, see the following InputConfig table.

MonitorConfig

String

No

"{\"fpsLowThres\": 0.6,\"brLowThres\": 1.1,\"eofDurationThresSec\": 10}"

The monitoring alert thresholds. The value is a JSON string. For more information, see the following MonitorConfig table.

CallbackUrl

String

No

http://guide.aliyundoc.com/notify

The callback URL. Supported formats include HTTP and HTTPS.

DingTalkWebHookUrl

String

No

https://oapi.dingtalk.com/robot/send?access_token=7a7d404056eee1f2fd944ace9bcfc361dc6448583e1d3d3baa****

The URL of the DingTalk chatbot. Specify a DingTalk chatbot that you have configured, and you can receive live monitoring alerts from the chatbot. For more information, see Configure a custom chatbot.

Note

Specify "Alert" as the custom keyword of the DingTalk chatbot. Otherwise, you cannot receive messages.

InputConfig

Field

Type

Description

Example

Index

Integer

The index.

1

LayoutId

Integer

The layout ID, which must start from 1.

1

StreamName

String

The display name of the stream to monitor.

monitorStream****

InputUrl

String

The URL of the input stream.

demo.aliyundoc.com

LayoutConfig

LayoutConfig

The layout information.

See the following LayoutConfig table.

PlayConfig

PlayConfig

The playback configurations.

See the following PlayConfig table.

LayoutConfig

Field

Type

Description

Example

FillMode

String

The fill type. Set the value to none.

none

PositionRefer

String

The reference position of the element. Valid values: topLeft, topRight, bottomLeft, and bottomRight.

topLeft

PositionNormalized

Float

The normalized value of the coordinates of the layer, in the format of [x,y].

The values of x and y range from 0 to 1.

For example, [0.1,0.1] indicates that the layer is horizontally offset by 10% and vertically offset by 10% towards the upper-left corner.

[0.1, 0.1]

SizeNormalized

Float

The normalized value of the size of the layer, in the format of [w,h].

The values of w and h range from 0 to 1.

For example, [0.2,0.3] indicates that the width of the layer is 20% of the screen width, and the height of the layer is 30% of the screen height.

[0.2, 0.3]

PlayConfig

Field

Type

Description

Example

VolumeRate

Float

The volume. Valid values: 0 to 1. The value is rounded down to two decimal places.

0.50

MonitorConfig

Field

Type

Description

Example

fpsLowThres

Float

The video frame rate alert threshold. This threshold is a scale factor. Valid values: (0.0,1.0]. Default value: 0.7. When the video frame rate of the monitored stream is less than the threshold times the original frame rate of the stream, an alert is triggered.

0.7

brHighThres

Float

The audio/video bitrate alert threshold. This threshold is a scale factor. Valid values: (0.0,100]. Default value: 1.0. When the audio/video bitrate of the monitored stream is greater than the threshold times the original bitrate of the stream, an alert is triggered.

1.0

eofDurationThresSec

Float

The interruption duration alert threshold. If the monitored stream is interrupted for a period of time that is longer than the threshold, an alert is triggered. Value values: (0,65535]. Default value: 0. Unit: seconds.

  • After the stream is interrupted, the connection is still available and a packet timeout occurs after 5 seconds. The system determines whether there is an interruption based on the timeout. If you set this parameter to a value that is less than or equal to 5 seconds, the threshold is fixed at 5 seconds. If you set this parameter to a value that is greater than 5 seconds, the threshold is the specified value.

  • If the stream is resumed within the threshold after it is interrupted, no alert is triggered. If you modify the URL of the monitored stream within the threshold after the stream is interrupted, interruption detection is not performed for the stream and no alert is triggered.

10

Response parameters

Parameter

Type

Example

Description

MonitorId

String

445409ec-7eaa-461d-8f29-4bec2eb9****

The ID of the monitoring session.

RequestId

String

5c6a2a0d-f228-4a64-af62-20e91b9676b3

The request ID.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=CreateLiveStreamMonitor
&Domain=demo.aliyundoc.com
&MonitorName=liveMonitor****
&OutputTemplate=lp_ud
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateLiveStreamMonitorResponse>
<RequestId>5c6a2a0d-f228-4a64-af62-20e91b9676b3</RequestId>
<MonitorId>445409ec-7eaa-461d-8f29-4bec2eb9****</MonitorId>
</CreateLiveStreamMonitorResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "5c6a2a0d-f228-4a64-af62-20e91b9676b3",
  "MonitorId" : "445409ec-7eaa-461d-8f29-4bec2eb9****"
}

Error codes

For a list of error codes, see Service error codes.