Enhanced Alert

OvenMediaEngine Enterprise supports the Enhanced Alert feature starting with version 0.18.3.2-1

Enhanced Alert is a module that can detect anomalies and patterns of interest in a stream or system and send notifications to users. Anomalies and patterns of interest can be set through predefined rules, and when detected, the module sends an HTTP(S) request to the user's notification server.

Configuring Enhanced Alert

Enhanced Alert can be set up on <Server>, as shown below:

<Server version="8">
	<Alert>
		<Url>http://192.168.0.161:9595/alert/notification</Url>
		<SecretKey>1234</SecretKey>
		<Timeout>3000</Timeout>
		<RulesFile>AlertRules.xml</RulesFile>
		<Rules>
			<Ingress>
				<StreamStatus />
				<MinBitrate>2000000</MinBitrate>
				<MaxBitrate>4000000</MaxBitrate>
				<MinFramerate>15</MinFramerate>
				<MaxFramerate>60</MaxFramerate>
				<MinWidth>1280</MinWidth>
				<MinHeight>720</MinHeight>
				<MaxWidth>1920</MaxWidth>
				<MaxHeight>1080</MaxHeight>
				<MinSamplerate>16000</MinSamplerate>
				<MaxSamplerate>50400</MaxSamplerate>
				<LongKeyFrameInterval />
				<HasBFrames />
			</Ingress>
			<Egress>
				<StreamStatus />
				<LLHLSReady />
				<HLSReady />
			</Egress>
			<InternalQueueCongestion />
		</Rules>
	</Alert>
</Server>
Key
Description

Url

The HTTP Server is to receive the notification.

  • HTTP and HTTPS are available.

SecretKey

The secret key used when encrypting with HMAC-SHA1. For more information, see Security.

Timeout

Time to wait for a response after the request. (in milliseconds).

RulesFile

(Optional) Manages alert detection rules in a separate external file.

Rules

(Optional) Defines anomalies and patterns of interest to be detected. This section is ignored if <RulesFile> is set.

Rules File

You can define anomalies and patterns of interest to be detected in a separate file. OvenMediaEngine Enterprise monitors this file for changes and applies any updates immediately without requiring a restart. If you anticipate needing to modify detection rules during service operation, we recommend using <RulesFile>.

Rules

Key
Description

Ingress

StreamStatus

It detects the creation, standby, failure, and deletion states of a ingress stream.

MinBitrate

Detects when the ingress stream's video bitrate is lower than the set value.

MaxBitrate

Detects when the ingress stream's video bitrate is greater than the set value.

MinFramerate

Detects when the ingress stream's framerate is lower than the set value.

MaxFramerate

Detects when the ingress stream's framerate is greater than the set value.

MinWidth

Detects when the ingress stream's width is lower than the set value.

MaxWidth

Detects when the ingress stream's width is greater than the set value.

MinHeight

Detects when the ingress stream's height is lower than the set value.

MaxHeight

Detects when the ingress stream's height is greater than the set value.

MinSamplerate

Detects when the ingress stream's audio samplerate is lower than the set value.

MaxSamplerate

Detects when the ingress stream's audio samplerate is greater than the set value.

LongKeyFrameInterval

Detects when the ingress stream's keyframe interval is too long (exceeds 4 seconds).

HasBFrames

Detects when there are B-frames in the ingress stream.

Egress

StreamStatus

It detects the creation, standby, failure, and deletion states of a egress stream.

LLHLSReady

Detects the point in time when Low-Latency HLS playback becomes available.

HLSReady

Detects the point in time when HLS playback becomes available.

InternalQueueCongestion

Detect when internal queues become congested.

Notification

Request

Format

Element

Here is a detailed explanation of each element of the JSON payload:

Element
Description

messages

List of Messages detected by the Rules.

type

It represents the format of the JSON payload. The information of the JSON elements can vary depending on the value of the type.

sourceUri

URI information of the detected source.

  • INGRESS: #<vhost>#<application>/<input_stream>

  • EGRESS: #<vhost>#<application>/<output_stream>

sourceInfo

Detailed information about the source at the time of detection. It is identical to the response of the REST API's source information query for the detected source.

parentSourceUri

It provides the URI information of the parent-level source associated with the detected source.

  • INGRESS: #<vhost>#<application>/<input_stream>

  • EGRESS: #<vhost>#<application>/<output_stream>

parentSourceInfo

Provides details of the parent-level source associated with the detected source. If detailed information is unavailable, this field helps trace the source through its parent connection.

Additional Element (EGRESS_STREAM_CREATION_FAILED)

The following provides additional information when an Egress Stream creation fails.

Element
Description

outputProfile

The configuration details that caused the Egress Stream creation to fail.

codecModules

The module information related to the Decoder, Encoder, or Filter when an issue occurs in one of these components.

Messages

Type
Code
Description

INGRESS

INGRESS_STREAM_CREATED

A new ingress stream has been created.

INGRESS_STREAM_PREPARED

A ingress stream has been prepared.

INGRESS_STREAM_DELETED

A ingress stream has been deleted.

INGRESS_STREAM_CREATION_FAILED_DUPLICATE_NAME

Failed to create stream because the specified stream name is already in use.

INGRESS_BITRATE_LOW

The ingress stream's current video bitrate (%d bps) is lower than the configured bitrate (%d bps).

INGRESS_BITRATE_HIGH

The ingress stream's current video bitrate (%d bps) is higher than the configured bitrate (%d bps).

INGRESS_FRAMERATE_LOW

The ingress stream's current framerate (%.2f fps) is lower than the configured framerate (%.2f fps).

INGRESS_FRAMERATE_HIGH

The ingress stream's current framerate (%f fps) is higher than the configured framerate (%f fps).

INGRESS_WIDTH_SMALL

The ingress stream's width (%d) is smaller than the configured width (%d).

INGRESS_WIDTH_LARGE

The ingress stream's width (%d) is larger than the configured width (%d).

INGRESS_HEIGHT_SMALL

The ingress stream's height (%d) is smaller than the configured height (%d).

INGRESS_HEIGHT_LARGE

The ingress stream's height (%d) is larger than the configured height (%d).

INGRESS_SAMPLERATE_LOW

The ingress stream's current audio samplerate (%d) is lower than the configured samplerate (%d).

INGRESS_SAMPLERATE_HIGH

The ingress stream's current audio samplerate (%d) is higher than the configured samplerate (%d).

INGRESS_LONG_KEY_FRAME_INTERVAL

The ingress stream's current keyframe interval (%.1f seconds) is too long. Please use a keyframe interval of 4 seconds or less.

INGRESS_HAS_BFRAME

There are B-frames in the ingress stream.

EGRESS

EGRESS_STREAM_CREATED

A new egress stream has been created.

EGRESS_STREAM_PREPARED

A egress stream has been prepared.

EGRESS_STREAM_DELETED

A egress stream has been deleted.

EGRESS_STREAM_CREATION_FAILED_BY_OUTPUT_PROFILE

Failed to create egress stream because the output profile configuration is invalid

EGRESS_STREAM_CREATION_FAILED_BY_DECODER

Failed to create egress stream because the decoder could not be created

EGRESS_STREAM_CREATION_FAILED_BY_ENCODER

Failed to create egress stream because the encoder could not be created

EGRESS_STREAM_CREATION_FAILED_BY_FILTER

Failed to create egress stream because the filter could not be created

EGRESS_LLHLS_READY

Low-Latency HLS stream is ready to play - initial segment(s) have been generated.

EGRESS_HLS_READY

HLS stream is ready to play - initial segment(s) have been generated.

INTERNAL_QUEUE

INTERNAL_QUEUE

Internal queue(s) is currently congested

Security

The control server may need to validate incoming HTTP requests for security reasons. To do this, the Enhanced Alert module puts the X-OME-Signature value in the HTTP request header.

This X-OME-Signature is a base64 URL-safe encoded value obtained by encrypting the payload of an HTTP request with the HMAC-SHA1 algorithm using the secret key set in <Alert><SecretKey> of the configuration.

Response

The engine in the closing state does not need any parameters in response. The response payload is ignored.

Anomaly Detection | 0.20.1.0+

Anomaly Detection is a module that detects input stream errors that occur during streaming and can take follow-up actions such as triggering an alert callback or terminating the stream.

Anomaly Detection can be configured in <Server><Alert><Rules> as shown below:

Key
Default (Allowed)
Description

CheckDuration

10 (0-3600)

The base time used to accumulate the number of anomaly counts in order to decide whether to execute the action.

  • The unit is seconds (s).

If, within the CheckDuration, situations where the measured value exceeds the Threshold (as described for each option below) occur at least Count times, the Action is triggered.

  • ex) If CheckDuration is set to 0 and Count is 1, the anomaly is detected immediately with no waiting time. If Count is 2 or greater, there is no time window, so detection is not possible.

Count

1 (1-65535)

If the number of anomaly occurrences within the CheckDuration exceeds the value set in Count, the condition is treated as an anomaly.

  • The unit is the number of occurrences.

Action

N/A

Specifies which follow-up actions to take after an anomaly is detected.

The available follow-up actions are as follows, and multiple actions can be configured at the same time:

  1. TerminateStream: Stops the stream when an anomaly is detected on a source type such as WebRTC, Ovt, RTMP, RtmpPull, Rtsp, RtspPull, Mpegts, or Srt.

  2. Alert: Sends the anomaly detection result to alert.

Configuring DTSReversal

DTSReversal detects cases where the Decoding Time Stamp (DTS) becomes smaller than the previous value in milliseconds or does not increase, which may cause playback issues.

DTSReversal can be configured under <Server><Alert><Rules><Anomaly>. An example is shown below:

= During the last 5 seconds (CheckDuration), the number of times the DTS has reversed by 5 milliseconds or more (Threshold) is 2 or greater (Count), the stream is terminated and an alert is sent (Action).

Key
Default (Allowed)
Description

Threshold

1 (1-2147483647)

The criterion for “By how many milliseconds must the DTS be reversed for it to be regarded as an anomaly?”

  • The unit is milliseconds (ms)

Configuring DTSJump

DTSJump detects cases where the DTS increases abruptly between consecutive frames, which may cause playback issues.

DTSJump can be configured under <Server><Alert><Rules><Anomaly>. An example is shown below:

= During the last 5 seconds (CheckDuration), the number of times the DTS has jumped by 1,000 milliseconds or more (Threshold) is 2 or greater (Count), the stream is terminated and an alert is sent (Action).

Key
Default (Allowed)
Description

Threshold

1000 (1-2147483647)

The criterion for “By how many milliseconds must the DTS jump for it to be regarded as an anomaly?”

  • The unit is milliseconds (ms).

Configuring DTSDuplication

DTSDuplication detects cases where the DTS of consecutive frames is identical, which may cause playback issues.

DTSDuplication can be configured under <Server><Alert><Rules><Anomaly>. An example is shown below:

= During the last 5 seconds (CheckDuration), the number of times the DTS is identical is 2 or greater (Count), the stream is terminated and an alert is sent (Action).

Configuring PacketTimeout

PacketTimeout detects cases where no packets are received for a specified period of time, which may cause playback issues.

PacketTimeout can be configured under <Server><Alert><Rules><Anomaly>. An example is shown below:

= During the last 5 seconds (CheckDuration), the number of times no packet was received for 1,000 milliseconds or more (Threshold) is 2 or greater (Count), the stream is terminated and an alert is sent (Action).

Key
Default (Allowed)
Description

Threshold

1500 (1-2147483647)

The criterion for “By how many milliseconds must no packet be received for it to be regarded as an anomaly?”

  • The unit is milliseconds (ms).

Last updated

Was this helpful?