# Enhanced Alert

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:

```xml
<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>
```

<table><thead><tr><th width="139.55560302734375">Key</th><th>Description</th></tr></thead><tbody><tr><td>Url</td><td><p>The HTTP Server is to receive the notification.</p><ul><li>HTTP and HTTPS are available.</li></ul></td></tr><tr><td>SecretKey</td><td>The secret key used when encrypting with HMAC-SHA1. For more information, see <a href="#security">Security</a>.</td></tr><tr><td>Timeout</td><td>Time to wait for a response after the request. (in milliseconds).</td></tr><tr><td>RulesFile</td><td>(Optional) Manages alert detection rules in a separate external file.</td></tr><tr><td>Rules</td><td>(Optional) Defines anomalies and patterns of interest to be detected. This section is ignored if <code>&#x3C;RulesFile></code> is set.</td></tr></tbody></table>

### 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>`.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<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>
```

#### Rules

<table><thead><tr><th width="140.11114501953125">Key</th><th width="200.4444580078125"></th><th>Description</th></tr></thead><tbody><tr><td>Ingress</td><td>StreamStatus</td><td>It detects the creation, standby, failure, and deletion states of a ingress stream.</td></tr><tr><td></td><td>MinBitrate</td><td>Detects when the ingress stream's video bitrate is lower than the set value.</td></tr><tr><td></td><td>MaxBitrate</td><td>Detects when the ingress stream's video bitrate is greater than the set value.</td></tr><tr><td></td><td>MinFramerate</td><td>Detects when the ingress stream's framerate is lower than the set value.</td></tr><tr><td></td><td>MaxFramerate</td><td>Detects when the ingress stream's framerate is greater than the set value.</td></tr><tr><td></td><td>MinWidth</td><td>Detects when the ingress stream's width is lower than the set value.</td></tr><tr><td></td><td>MaxWidth</td><td>Detects when the ingress stream's width is greater than the set value.</td></tr><tr><td></td><td>MinHeight</td><td>Detects when the ingress stream's height is lower than the set value.</td></tr><tr><td></td><td>MaxHeight</td><td>Detects when the ingress stream's height is greater than the set value.</td></tr><tr><td></td><td>MinSamplerate</td><td>Detects when the ingress stream's audio samplerate is lower than the set value.</td></tr><tr><td></td><td>MaxSamplerate</td><td>Detects when the ingress stream's audio samplerate is greater than the set value.</td></tr><tr><td></td><td>LongKeyFrameInterval</td><td>Detects when the ingress stream's keyframe interval is too long (exceeds 4 seconds).</td></tr><tr><td></td><td>HasBFrames</td><td>Detects when there are B-frames in the ingress stream.</td></tr><tr><td>Egress</td><td>StreamStatus</td><td>It detects the creation, standby, failure, and deletion states of a egress stream.</td></tr><tr><td></td><td>LLHLSReady</td><td>Detects the point in time when Low-Latency HLS playback becomes available.</td></tr><tr><td></td><td>HLSReady</td><td>Detects the point in time when HLS playback becomes available.</td></tr><tr><td></td><td>TranscodeStatus</td><td>Detects decoding, encoding, and filtering failure states during egress stream transcoding.</td></tr><tr><td>InternalQueueCongestion</td><td></td><td>Detect when internal queues become congested.</td></tr><tr><td>Anomaly</td><td>DTSReversal</td><td>Detects cases where DTS is not monotonically increasing.</td></tr><tr><td></td><td>DTSJump</td><td>Detects cases where DTS increases abruptly between consecutive frames.</td></tr><tr><td></td><td>DTSDuplication</td><td>Detects cases where DTS is the same between consecutive frames.</td></tr><tr><td></td><td>PacketTimeout</td><td>Detects when no packets are received for a specified period of time.</td></tr></tbody></table>

## Notification

### Request

#### Format

```http
POST /configured/target/url HTTP/1.1
Content-Length: 1037
Content-Type: application/json
Accept: application/json
X-OME-Signature: f871jd991jj1929jsjd91pqa0amm1
{
  "sourceUri": "#default#app/stream",
  "messages": [
    {
      "code": "INGRESS_HAS_BFRAME",
      "description": "There are B-Frames in the ingress stream."
    },
    {
      "code": "INGRESS_BITRATE_LOW",
      "description": "The ingress stream's current bitrate (316228 bps) is lower than the configured bitrate (2000000 bps)"
    }
  ],
  "sourceInfo": {
    "createdTime": "2023-04-07T21:15:24.487+09:00",
    "sourceType": "Rtmp",
    "sourceUrl": "TCP://192.168.0.220:10639",
    "tracks": [
      {
        "id": 0,
        "name": "Video",
        "type": "Video",
        "video": {
          "bitrate": 300000,
          "bypass": false,
          "codec": "H264",
          "framerate": 30.0,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 160000,
          "bypass": false,
          "channel": 1,
          "codec": "AAC",
          "samplerate": 48000
        },
        "id": 1,
        "name": "Audio",
        "type": "Audio"
      },
      {
        "id": 2,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "type": "INGRESS"
}
```

#### Element

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

<table><thead><tr><th width="156.5555419921875">Element</th><th>Description</th></tr></thead><tbody><tr><td>messages</td><td>List of <a href="#messages">Messages</a> detected by the <a href="#rules">Rules</a>.</td></tr><tr><td>type</td><td>It represents the format of the JSON payload. The information of the JSON elements can vary depending on the value of the type.</td></tr><tr><td>sourceUri</td><td><p>URI information of the detected source.</p><ul><li><code>INGRESS</code>: #&#x3C;vhost>#&#x3C;application>/&#x3C;input_stream></li><li><code>EGRESS</code>: #&#x3C;vhost>#&#x3C;application>/&#x3C;output_stream></li><li><code>ANOMALY</code>: #&#x3C;vhost>#&#x3C;application>/&#x3C;input_stream></li></ul></td></tr><tr><td>sourceInfo</td><td>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.</td></tr><tr><td>parentSourceUri</td><td><p>It provides the URI information of the parent-level source associated with the detected source.</p><ul><li><code>INGRESS</code>: #&#x3C;vhost>#&#x3C;application>/&#x3C;input_stream></li><li><code>EGRESS</code>: #&#x3C;vhost>#&#x3C;application>/&#x3C;output_stream></li></ul></td></tr><tr><td>parentSourceInfo</td><td>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.</td></tr></tbody></table>

#### Messages

<table><thead><tr><th width="140.111083984375">Type</th><th width="299.6666259765625">Code</th><th>Description</th></tr></thead><tbody><tr><td>INGRESS</td><td>INGRESS_STREAM_CREATED</td><td>A new ingress stream has been created.</td></tr><tr><td></td><td>INGRESS_STREAM_PREPARED</td><td>A ingress stream has been prepared.</td></tr><tr><td></td><td>INGRESS_STREAM_DELETED</td><td>A ingress stream has been deleted.</td></tr><tr><td></td><td>INGRESS_STREAM_CREATION_FAILED_DUPLICATE_NAME</td><td>Failed to create stream because the specified stream name is already in use.</td></tr><tr><td></td><td>INGRESS_BITRATE_LOW</td><td>The ingress stream's current video bitrate (<code>%d</code> bps) is lower than the configured bitrate (<code>%d</code> bps).</td></tr><tr><td></td><td>INGRESS_BITRATE_HIGH</td><td>The ingress stream's current video bitrate (<code>%d</code> bps) is higher than the configured bitrate (<code>%d</code> bps).</td></tr><tr><td></td><td>INGRESS_FRAMERATE_LOW</td><td>The ingress stream's current framerate (<code>%.2f</code> fps) is lower than the configured framerate (<code>%.2f</code> fps).</td></tr><tr><td></td><td>INGRESS_FRAMERATE_HIGH</td><td>The ingress stream's current framerate (<code>%f</code> fps) is higher than the configured framerate (<code>%f</code> fps).</td></tr><tr><td></td><td>INGRESS_WIDTH_SMALL</td><td>The ingress stream's width (<code>%d</code>) is smaller than the configured width (<code>%d</code>).</td></tr><tr><td></td><td>INGRESS_WIDTH_LARGE</td><td>The ingress stream's width (<code>%d</code>) is larger than the configured width (<code>%d</code>).</td></tr><tr><td></td><td>INGRESS_HEIGHT_SMALL</td><td>The ingress stream's height (<code>%d</code>) is smaller than the configured height (<code>%d</code>).</td></tr><tr><td></td><td>INGRESS_HEIGHT_LARGE</td><td>The ingress stream's height (<code>%d</code>) is larger than the configured height (<code>%d</code>).</td></tr><tr><td></td><td>INGRESS_SAMPLERATE_LOW</td><td>The ingress stream's current audio samplerate (<code>%d</code>) is lower than the configured samplerate (<code>%d</code>).</td></tr><tr><td></td><td>INGRESS_SAMPLERATE_HIGH</td><td>The ingress stream's current audio samplerate (<code>%d</code>) is higher than the configured samplerate (<code>%d</code>).</td></tr><tr><td></td><td>INGRESS_LONG_KEY_FRAME_INTERVAL</td><td>The ingress stream's current keyframe interval (<code>%.1f</code> seconds) is too long. Please use a keyframe interval of 4 seconds or less.</td></tr><tr><td></td><td>INGRESS_HAS_BFRAME</td><td>There are B-frames in the ingress stream.</td></tr><tr><td>EGRESS</td><td>EGRESS_STREAM_CREATED</td><td>A new egress stream has been created.</td></tr><tr><td></td><td>EGRESS_STREAM_PREPARED</td><td>A egress stream has been prepared.</td></tr><tr><td></td><td>EGRESS_STREAM_DELETED</td><td>A egress stream has been deleted.</td></tr><tr><td></td><td>EGRESS_STREAM_CREATION_FAILED_OUTPUT_PROFILE</td><td>Failed to create egress stream because the output profile configuration is invalid</td></tr><tr><td></td><td>EGRESS_STREAM_CREATION_FAILED_DECODER</td><td>Failed to create egress stream because the decoder could not be created</td></tr><tr><td></td><td>EGRESS_STREAM_CREATION_FAILED_ENCODER</td><td>Failed to create egress stream because the encoder could not be created</td></tr><tr><td></td><td>EGRESS_STREAM_CREATION_FAILED_FILTER</td><td>Failed to create egress stream because the filter could not be created</td></tr><tr><td></td><td>EGRESS_LLHLS_READY</td><td>Low-Latency HLS stream is ready to play - initial segment(s) have been generated.</td></tr><tr><td></td><td>EGRESS_HLS_READY</td><td>HLS stream is ready to play - initial segment(s) have been generated.</td></tr><tr><td></td><td>EGRESS_TRANSCODE_FAILED_DECODING</td><td>Failed to transcode the egress stream due to a frame decoding failure.</td></tr><tr><td></td><td>EGRESS_TRANSCODE_FAILED_ENCODING</td><td>Failed to transcode the egress stream due to a frame encoding failure.</td></tr><tr><td></td><td>EGRESS_TRANSCODE_FAILED_FILTERING</td><td>Failed to transcode the egress stream due to a frame filtering failure.</td></tr><tr><td>INTERNAL_QUEUE</td><td>INTERNAL_QUEUE</td><td>Internal queue(s) is currently congested</td></tr><tr><td>ANOMALY</td><td>ANOMALY_DTS_REVERSAL_DETECTED</td><td>DTS has been reversed by <code>%lld</code>.</td></tr><tr><td></td><td>ANOMALY_DTS_JUMP_DETECTED</td><td>DTS has increased significantly by <code>%lld</code>.</td></tr><tr><td></td><td>ANOMALY_DTS_DUPLICATION_DETECTED</td><td>DTS has been duplicated <code>%d</code> times.</td></tr><tr><td></td><td>ANOMALY_PACKET_TIMEOUT_DETECTED</td><td>No packets have been received for <code>%lld</code>ms.</td></tr></tbody></table>

#### Additional Element (`EGRESS_STREAM_CREATION_FAILED`)

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

**Egress Stream Failure Example:**

<details>

<summary><mark style="color:green;">#01</mark> When output track creation fails:</summary>

```json
{
  "type": "EGRESS",
  "parentSourceUri": "#default#app/stream1",
  "parentSourceInfo": {
    "createdTime": "2025-12-13T02:19:59.256+09:00",
    "name": "stream1",
    "sourceType": "Scheduled",
    "tracks": [
      {
        "id": 0,
        "name": "Video",
        "type": "Video",
        "video": {
          "bitrate": 3898586,
          "bitrateAvg": 0,
          "bitrateConf": 3898586,
          "bitrateLatest": 0,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 1,
          "framerate": 60.0,
          "framerateAvg": 0.0,
          "framerateConf": 60.0,
          "framerateLatest": 0.0,
          "hasBframes": false,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 127999,
          "bitrateAvg": 0,
          "bitrateConf": 127999,
          "bitrateLatest": 0,
          "bypass": false,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 100,
        "name": "Audio",
        "type": "Audio"
      },
      {
        "id": 200,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "messages": [
    {
      "code": "EGRESS_STREAM_CREATION_FAILED_BY_OUTPUT_PROFILE",
      "description": "Failed to create egress stream because the output profile configuration is invalid"
    }
  ],
  "extraInfo": {
    "outputProfile": {
      "encodes": {
        "audios": [
          {
            "bypass": "true",
            "name": "bypass_audio"
          },
          {
            "bitrate": "128000",
            "bypassIfMatch": {
              "codec": "eq"
            },
            "channel": "2",
            "codec": "opus",
            "name": "opus_audio",
            "samplerate": "48000"
          }
        ],
        "videos": [
          {
            "bypass": "true",
            "name": "bypass_video"
          },
          {
            "bFrames": "2",
            "bitrate": "7000000",
            "codec": "h264",
            "framerate": "60",
            "height": "1080",
            "keyFrameInterval": "120",
            "name": "video_1080",
            "preset": "faster",
            "profile": "high",
            "width": "1920"
          }
        ]
      },
      "name": "high",
      "outputStreamName": "${OriginStreamName}"
    }
  }
}
```

</details>

<details>

<summary><mark style="color:purple;">#02-1</mark> When decoder creation fails:</summary>

```json
{
  "type": "EGRESS",
  "parentSourceUri": "#default#app/stream1",
  "parentSourceInfo": {
    "createdTime": "2025-12-13T02:14:34.972+09:00",
    "name": "stream1",
    "sourceType": "Scheduled",
    "tracks": [
      {
        "id": 0,
        "name": "Video",
        "type": "Video",
        "video": {
          "bitrate": 3898586,
          "bitrateAvg": 0,
          "bitrateConf": 3898586,
          "bitrateLatest": 0,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 1,
          "framerate": 60.0,
          "framerateAvg": 0.0,
          "framerateConf": 60.0,
          "framerateLatest": 0.0,
          "hasBframes": false,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 127999,
          "bitrateAvg": 0,
          "bitrateConf": 127999,
          "bitrateLatest": 0,
          "bypass": false,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 100,
        "name": "Audio",
        "type": "Audio"
      },
      {
        "id": 200,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "messages": [
    {
      "code": "EGRESS_STREAM_CREATION_FAILED_BY_DECODER",
      "description": "Failed to create egress stream because the decoder could not be created"
    }
  ],
  "extraInfo": {
    "codecModule": {
      "busId": "-",
      "displayName": "FFmpeg Video Codecs",
      "id": 0,
      "isDecoder": true,
      "isDefault": true,
      "isEncoder": false,
      "isHwAccel": false,
      "mediaType": "Video",
      "metrics": {
        "active": {
          "decoder": 0,
          "encoder": 0
        }
      },
      "module": "default",
      "name": "default:0",
      "supportedCodecs": [
        "H264",
        "H265",
        "VP8"
      ]
    },
    "parentSourceTrackId": 0
  }
}
```

</details>

<details>

<summary><mark style="color:purple;">#02-2</mark> When encoder creation fails:</summary>

```json
{
  "extraInfo": {
    "codecModule": {
      "busId": "00000000:3B:00.0",
      "displayName": "NVIDIA GeForce GTX 1050",
      "id": 0,
      "isDecoder": true,
      "isDefault": false,
      "isEncoder": true,
      "isHwAccel": true,
      "mediaType": "Video",
      "metrics": {
        "active": {
          "decoder": 0,
          "encoder": 0
        }
      },
      "module": "nv",
      "name": "nv:0",
      "supportedCodecs": [
        "H264",
        "H265"
      ]
    },
    "outputProfile": {
      "encodes": {
        "audios": [
          {
            "bypass": "true",
            "name": "bypass_audio"
          },
          {
            "bitrate": "128000",
            "bypassIfMatch": {
              "codec": "eq"
            },
            "channel": "2",
            "codec": "opus",
            "name": "opus_audio",
            "samplerate": "48000"
          }
        ],
        "videos": [
          {
            "bypass": "true",
            "name": "bypass_video"
          },
          {
            "bFrames": "2",
            "bitrate": "7000000",
            "codec": "h264",
            "framerate": "60",
            "height": "1080",
            "keyFrameInterval": "120",
            "name": "video_1080",
            "preset": "faster",
            "profile": "high",
            "width": "1920"
          }
        ]
      },
      "name": "high",
      "outputStreamName": "${OriginStreamName}"
    },
    "parentSourceTrackId": 0,
    "sourceTrackId": 1
  },
  "messages": [
    {
      "code": "EGRESS_STREAM_CREATION_FAILED_ENCODER",
      "description": "Failed to create stream because the encoder could not be created"
    }
  ],
  "parentSourceInfo": {
    "createdTime": "2025-12-15T11:55:50.029+09:00",
    "name": "stream1",
    "sourceType": "Rtmp",
    "sourceUrl": "TCP://192.168.0.245:3805",
    "tracks": [
      {
        "id": 0,
        "name": "Video",
        "type": "Video",
        "video": {
          "bitrate": 30000000,
          "bitrateAvg": 0,
          "bitrateConf": 30000000,
          "bitrateLatest": 0,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 24,
          "framerate": 60.0,
          "framerateAvg": 0.0,
          "framerateConf": 60.0,
          "framerateLatest": 0.0,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 160000,
          "bitrateAvg": 0,
          "bitrateConf": 160000,
          "bitrateLatest": 0,
          "bypass": false,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 1,
        "name": "Audio",
        "type": "Audio"
      },
      {
        "id": 2,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "parentSourceUri": "#default#app/stream1",
  "sourceInfo": {
    "createdTime": "2025-12-15T11:55:50.048+09:00",
    "name": "stream1",
    "sourceType": "Transcoder",
    "sourceUrl": "da4da9dc-4e0f-41de-b623-4a8f3ed8a4c5/#default#app/stream1/i",
    "tracks": [
      {
        "id": 0,
        "name": "bypass_video",
        "type": "Video",
        "video": {
          "bitrate": 30000000,
          "bitrateAvg": 0,
          "bitrateConf": 30000000,
          "bitrateLatest": -1980852460,
          "bypass": true,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 23,
          "framerate": 60.0,
          "framerateAvg": 0.0,
          "framerateConf": 60.0,
          "framerateLatest": 0.0,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "id": 1,
        "name": "video_1080",
        "type": "Video",
        "video": {
          "bitrate": 7000000,
          "bitrateAvg": 0,
          "bitrateConf": 7000000,
          "bitrateLatest": 123084383,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 0,
          "framerate": 60.0,
          "framerateAvg": 0.0,
          "framerateConf": 60.0,
          "framerateLatest": 0.0,
          "hasBframes": false,
          "height": 1080,
          "keyFrameInterval": 120.0,
          "keyFrameIntervalAvg": 0.0,
          "keyFrameIntervalConf": 120.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 160000,
          "bitrateAvg": 0,
          "bitrateConf": 160000,
          "bitrateLatest": -374024710,
          "bypass": true,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 2,
        "name": "bypass_audio",
        "type": "Audio"
      },
      {
        "audio": {
          "bitrate": 128000,
          "bitrateAvg": 0,
          "bitrateConf": 128000,
          "bitrateLatest": -1130268890,
          "bypass": false,
          "channel": 2,
          "codec": "OPUS",
          "samplerate": 48000
        },
        "id": 3,
        "name": "opus_audio",
        "type": "Audio"
      },
      {
        "id": 4,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "sourceUri": "#default#app/stream1",
  "type": "EGRESS"
}
```

</details>

<details>

<summary><mark style="color:purple;">#02-3</mark> When filter creation fails:</summary>

```json
{
  "extraInfo": {
    "codecModule": {
      "busId": "00000000:3B:00.0",
      "displayName": "NVIDIA GeForce GTX 1050",
      "id": 0,
      "isDecoder": true,
      "isDefault": false,
      "isEncoder": true,
      "isHwAccel": true,
      "mediaType": "Video",
      "metrics": {
        "active": {
          "decoder": 0,
          "encoder": 1
        }
      },
      "module": "nv",
      "name": "nv:0",
      "supportedCodecs": [
        "H264",
        "H265"
      ]
    },
    "outputProfile": {
      "encodes": {
        "audios": [
          {
            "bypass": "true",
            "name": "bypass_audio"
          },
          {
            "bitrate": "128000",
            "bypassIfMatch": {
              "codec": "eq"
            },
            "channel": "2",
            "codec": "opus",
            "name": "opus_audio",
            "samplerate": "48000"
          }
        ],
        "videos": [
          {
            "bypass": "true",
            "name": "bypass_video"
          },
          {
            "bFrames": "2",
            "bitrate": "7000000",
            "codec": "h264",
            "framerate": "60",
            "height": "1080",
            "keyFrameInterval": "120",
            "name": "video_1080",
            "preset": "faster",
            "profile": "high",
            "width": "1920"
          }
        ]
      },
      "name": "high",
      "outputStreamName": "${OriginStreamName}"
    },
    "parentSourceTrackId": 0,
    "sourceTrackId": 1
  },
  "messages": [
    {
      "code": "EGRESS_STREAM_CREATION_FAILED_FILTER",
      "description": "Failed to create stream because the filter could not be created"
    }
  ],
  "parentSourceInfo": {
    "createdTime": "2025-12-15T11:57:32.668+09:00",
    "name": "stream1",
    "sourceType": "Rtmp",
    "sourceUrl": "TCP://192.168.0.245:3830",
    "tracks": [
      {
        "id": 0,
        "name": "Video",
        "type": "Video",
        "video": {
          "bitrate": 30000000,
          "bitrateAvg": 0,
          "bitrateConf": 30000000,
          "bitrateLatest": 1835102790,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 13,
          "framerate": 60.0,
          "framerateAvg": 0.0,
          "framerateConf": 60.0,
          "framerateLatest": 0.0,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 160000,
          "bitrateAvg": 0,
          "bitrateConf": 160000,
          "bitrateLatest": 695105391,
          "bypass": false,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 1,
        "name": "Audio",
        "type": "Audio"
      },
      {
        "id": 2,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "parentSourceUri": "#default#app/stream1",
  "sourceInfo": {
    "createdTime": "2025-12-15T11:57:32.683+09:00",
    "name": "stream1",
    "sourceType": "Transcoder",
    "sourceUrl": "da4da9dc-4e0f-41de-b623-4a8f3ed8a4c5/#default#app/stream1/i",
    "tracks": [
      {
        "id": 0,
        "name": "bypass_video",
        "type": "Video",
        "video": {
          "bitrate": 30000000,
          "bitrateAvg": 0,
          "bitrateConf": 30000000,
          "bitrateLatest": 842608930,
          "bypass": true,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 12,
          "framerate": 60.0,
          "framerateAvg": 0.0,
          "framerateConf": 60.0,
          "framerateLatest": 0.0,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "id": 1,
        "name": "video_1080",
        "type": "Video",
        "video": {
          "bitrate": 7000000,
          "bitrateAvg": 0,
          "bitrateConf": 7000000,
          "bitrateLatest": 0,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 0,
          "framerate": 60.0,
          "framerateAvg": 0.0,
          "framerateConf": 60.0,
          "framerateLatest": 0.0,
          "hasBframes": false,
          "height": 1080,
          "keyFrameInterval": 120.0,
          "keyFrameIntervalAvg": 0.0,
          "keyFrameIntervalConf": 120.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 160000,
          "bitrateAvg": 0,
          "bitrateConf": 160000,
          "bitrateLatest": 0,
          "bypass": true,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 2,
        "name": "bypass_audio",
        "type": "Audio"
      },
      {
        "audio": {
          "bitrate": 128000,
          "bitrateAvg": 0,
          "bitrateConf": 128000,
          "bitrateLatest": 0,
          "bypass": false,
          "channel": 2,
          "codec": "OPUS",
          "samplerate": 48000
        },
        "id": 3,
        "name": "opus_audio",
        "type": "Audio"
      },
      {
        "id": 4,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "sourceUri": "#default#app/stream1",
  "type": "EGRESS"
}
```

</details>

<details>

<summary><mark style="color:orange;">#03-1</mark> When frame decoding fails:</summary>

```json
{
  "type": "EGRESS",
  "parentSourceUri": "#default#app/stream1",
  "parentSourceInfo": {
    "createdTime": "2025-12-12T18:31:41.139+09:00",
    "name": "stream1",
    "sourceType": "Scheduled",
    "tracks": [
      {
        "id": 0,
        "name": "Video",
        "type": "Video",
        "video": {
          "bitrate": 3898586,
          "bitrateAvg": 2299712,
          "bitrateConf": 3898586,
          "bitrateLatest": 2275110,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 173,
          "framerate": 60.0,
          "framerateAvg": 60.0,
          "framerateConf": 60.0,
          "framerateLatest": 60.039371490478516,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 127999,
          "bitrateAvg": 130655,
          "bitrateConf": 127999,
          "bitrateLatest": 131385,
          "bypass": false,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 100,
        "name": "Audio",
        "type": "Audio"
      },
      {
        "id": 200,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "messages": [
    {
      "code": "EGRESS_TRANSCODE_FAILED_DECODING",
      "description": "Failed to decode frames"
    }
  ],
  "extraInfo": {
    "codecModule": {
      "busId": "-",
      "displayName": "FFmpeg Audio Codecs",
      "id": 0,
      "isDecoder": true,
      "isDefault": true,
      "isEncoder": false,
      "isHwAccel": false,
      "mediaType": "Audio",
      "metrics": {
        "active": {
          "decoder": 1,
          "encoder": 0
        }
      },
      "module": "default",
      "name": "default:0",
      "supportedCodecs": [
        "AAC",
        "OPUS"
      ]
    },
    "errorCount": 50,
    "errorEvaluationWindow": 5000,
    "parentSourceTrackId": 100
  }
}
```

</details>

<details>

<summary><mark style="color:orange;">#03-2</mark> When frame encoding fails:</summary>

```json
{
  "type": "EGRESS",
  "sourceUri": "#default#app/stream1",
  "sourceInfo": {
    "createdTime": "2025-12-12T18:31:41.155+09:00",
    "name": "stream1",
    "sourceType": "Transcoder",
    "sourceUrl": "da4da9dc-4e0f-41de-b623-4a8f3ed8a4c5/#default#app/stream1/i",
    "tracks": [
      {
        "id": 0,
        "name": "bypass_video",
        "type": "Video",
        "video": {
          "bitrate": 3898586,
          "bitrateAvg": 3249288,
          "bitrateConf": 3898586,
          "bitrateLatest": 2977072,
          "bypass": true,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 265,
          "framerate": 60.0,
          "framerateAvg": 60.0,
          "framerateConf": 60.0,
          "framerateLatest": 60.0,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "id": 1,
        "name": "video_1080",
        "type": "Video",
        "video": {
          "bitrate": 7000000,
          "bitrateAvg": 1591632,
          "bitrateConf": 7000000,
          "bitrateLatest": 1582415,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 9,
          "framerate": 60.0,
          "framerateAvg": 60.0,
          "framerateConf": 60.0,
          "framerateLatest": 62.376235961914062,
          "hasBframes": false,
          "height": 1080,
          "keyFrameInterval": 120.0,
          "keyFrameIntervalAvg": 80.333335876464844,
          "keyFrameIntervalConf": 120.0,
          "keyFrameIntervalLatest": 120.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 127999,
          "bitrateAvg": 130459,
          "bitrateConf": 127999,
          "bitrateLatest": 130048,
          "bypass": true,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 2,
        "name": "bypass_audio",
        "type": "Audio"
      },
      {
        "audio": {
          "bitrate": 128000,
          "bitrateAvg": 128000,
          "bitrateConf": 128000,
          "bitrateLatest": 245681,
          "bypass": false,
          "channel": 2,
          "codec": "OPUS",
          "samplerate": 48000
        },
        "id": 3,
        "name": "opus_audio",
        "type": "Audio"
      },
      {
        "id": 4,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "parentSourceUri": "#default#app/stream1",
  "parentSourceInfo": {
    "createdTime": "2025-12-12T18:31:41.139+09:00",
    "name": "stream1",
    "sourceType": "Scheduled",
    "tracks": [
      {
        "id": 0,
        "name": "Video",
        "type": "Video",
        "video": {
          "bitrate": 3898586,
          "bitrateAvg": 3249288,
          "bitrateConf": 3898586,
          "bitrateLatest": 2983512,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 266,
          "framerate": 60.0,
          "framerateAvg": 60.0,
          "framerateConf": 60.0,
          "framerateLatest": 60.0,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 127999,
          "bitrateAvg": 130459,
          "bitrateConf": 127999,
          "bitrateLatest": 128983,
          "bypass": false,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 100,
        "name": "Audio",
        "type": "Audio"
      },
      {
        "id": 200,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "messages": [
    {
      "code": "EGRESS_TRANSCODE_FAILED_ENCODING",
      "description": "Failed to encode frames"
    }
  ],
  "extraInfo": {
    "codecModule": {
      "busId": "-",
      "displayName": "Opus Interactive Audio Codec",
      "id": 0,
      "isDecoder": false,
      "isDefault": true,
      "isEncoder": true,
      "isHwAccel": false,
      "mediaType": "Audio",
      "metrics": {
        "active": {
          "decoder": 0,
          "encoder": 1
        }
      },
      "module": "libopus",
      "name": "libopus:0",
      "supportedCodecs": [
        "OPUS"
      ]
    },
    "errorCount": 100,
    "errorEvaluationWindow": 5000,
    "parentSourceTrackId": 100,
    "sourceTrackId": 3
  }
}
```

</details>

<details>

<summary><mark style="color:orange;">#03-3</mark> When frame filtering fails:</summary>

```json
{
  "type": "EGRESS",
  "sourceUri": "#default#app/stream1",
  "sourceInfo": {
    "createdTime": "2025-12-12T18:31:41.155+09:00",
    "name": "stream1",
    "sourceType": "Transcoder",
    "sourceUrl": "da4da9dc-4e0f-41de-b623-4a8f3ed8a4c5/#default#app/stream1/i",
    "tracks": [
      {
        "id": 0,
        "name": "bypass_video",
        "type": "Video",
        "video": {
          "bitrate": 3898586,
          "bitrateAvg": 2299712,
          "bitrateConf": 3898586,
          "bitrateLatest": 2296848,
          "bypass": true,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 157,
          "framerate": 60.0,
          "framerateAvg": 60.0,
          "framerateConf": 60.0,
          "framerateLatest": 60.0,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "id": 1,
        "name": "video_1080",
        "type": "Video",
        "video": {
          "bitrate": 7000000,
          "bitrateAvg": 905512,
          "bitrateConf": 7000000,
          "bitrateLatest": 895276,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 26,
          "framerate": 60.0,
          "framerateAvg": 60.0,
          "framerateConf": 60.0,
          "framerateLatest": 59.642147064208984,
          "hasBframes": false,
          "height": 1080,
          "keyFrameInterval": 120.0,
          "keyFrameIntervalAvg": 60.5,
          "keyFrameIntervalConf": 120.0,
          "keyFrameIntervalLatest": 120.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 127999,
          "bitrateAvg": 130655,
          "bitrateConf": 127999,
          "bitrateLatest": 130696,
          "bypass": true,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 2,
        "name": "bypass_audio",
        "type": "Audio"
      },
      {
        "audio": {
          "bitrate": 128000,
          "bitrateAvg": 128000,
          "bitrateConf": 128000,
          "bitrateLatest": 125417,
          "bypass": false,
          "channel": 2,
          "codec": "OPUS",
          "samplerate": 48000
        },
        "id": 3,
        "name": "opus_audio",
        "type": "Audio"
      },
      {
        "id": 4,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "parentSourceUri": "#default#app/stream1",
  "parentSourceInfo": {
    "createdTime": "2025-12-12T18:31:41.139+09:00",
    "name": "stream1",
    "sourceType": "Scheduled",
    "tracks": [
      {
        "id": 0,
        "name": "Video",
        "type": "Video",
        "video": {
          "bitrate": 3898586,
          "bitrateAvg": 2299712,
          "bitrateConf": 3898586,
          "bitrateLatest": 2275110,
          "bypass": false,
          "codec": "H264",
          "deltaFramesSinceLastKeyFrame": 158,
          "framerate": 60.0,
          "framerateAvg": 60.0,
          "framerateConf": 60.0,
          "framerateLatest": 60.039371490478516,
          "hasBframes": true,
          "height": 1080,
          "keyFrameInterval": 1.0,
          "keyFrameIntervalAvg": 1.0,
          "keyFrameIntervalConf": 0.0,
          "keyFrameIntervalLatest": 0.0,
          "width": 1920
        }
      },
      {
        "audio": {
          "bitrate": 127999,
          "bitrateAvg": 130655,
          "bitrateConf": 127999,
          "bitrateLatest": 131385,
          "bypass": false,
          "channel": 2,
          "codec": "AAC",
          "samplerate": 44100
        },
        "id": 100,
        "name": "Audio",
        "type": "Audio"
      },
      {
        "id": 200,
        "name": "Data",
        "type": "Data"
      }
    ]
  },
  "messages": [
    {
      "code": "EGRESS_TRANSCODE_FAILED_FILTERING",
      "description": "Failed to filter frames"
    }
  ],
  "extraInfo": {
    "codecModule": {
      "busId": "-",
      "displayName": "Opus Interactive Audio Codec",
      "id": 0,
      "isDecoder": false,
      "isDefault": true,
      "isEncoder": true,
      "isHwAccel": false,
      "mediaType": "Audio",
      "metrics": {
        "active": {
          "decoder": 0,
          "encoder": 1
        }
      },
      "module": "libopus",
      "name": "libopus:0",
      "supportedCodecs": [
        "OPUS"
      ]
    },
    "errorCount": 49,
    "errorEvaluationWindow": 5000,
    "parentSourceTrackId": 100,
    "sourceTrackId": 3
  }
}
```

</details>

**Data delivered when `type` is `EGRESS`:**

<table><thead><tr><th width="280.00018310546875">Element</th><th>Description</th></tr></thead><tbody><tr><td><code>sourceInfo</code></td><td>Information about the egress stream.</td></tr><tr><td><code>parentSourceInfo</code></td><td>Information about the ingress stream.</td></tr><tr><td><code>extraInfo.outputProfil</code></td><td>Output profile information related to a stream creation failure or a transcoding failure.</td></tr><tr><td><code>extraInto.codecModule</code></td><td>Codec module information related to a stream creation failure or a transcoding failure.</td></tr><tr><td><code>extraInfo.sourceTrackId</code></td><td>The track ID of the egress stream related to a stream creation failure or a transcoding failure.</td></tr><tr><td><code>extraInfo.parentSourceTrackId</code></td><td>The track ID of the ingress stream related to a stream creation failure or a transcoding failure.</td></tr></tbody></table>

#### 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.

```http
HTTP/1.1 200 OK
Content-Length: 0
Connection: Closed
```

## 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:

```xml
<Server>
	<Alert>
		<Rules>
			...
			<Anomaly>
				<DTSReversal>
					<CheckDuration>5</CheckDuration>
					<Count>1</Count>
					<Threshold>5</Threshold>
					<Action>TerminateStream,Alert</Action>
				</DTSReversal>
				<DTSJump>
					<Action>TerminateStream,Alert</Action>
				</DTSJump>
				<DTSDuplication>
					<Count>1</Count>
					<Action>TerminateStream,Alert</Action>
				</DTSDuplication>
				<PacketTimeout>
					<Action>TerminateStream,Alert</Action>
				</PacketTimeout>
			</Anomaly>
		</Rules>
	</Alert>
...
```

<table><thead><tr><th width="139.5555419921875">Key</th><th width="159.5555419921875" align="center">Default (Allowed)</th><th>Description</th></tr></thead><tbody><tr><td>CheckDuration</td><td align="center">10 (0-3600)</td><td><p>The base time used to accumulate the number of anomaly counts in order to decide whether to execute the action.</p><ul><li>The unit is seconds (s).</li></ul><p>If, within the <code>CheckDuration</code>, situations where the measured value exceeds the <code>Threshold</code> (as described for each option below) occur at least <code>Count</code> times, the <code>Action</code> is triggered.</p><ul><li>ex) If <code>CheckDuration</code> is set to <code>0</code> and <code>Count</code> is <code>1</code>, the anomaly is detected immediately with no waiting time. If <code>Count</code> is <code>2</code> or greater, there is no time window, so detection is not possible.</li></ul></td></tr><tr><td>Count</td><td align="center">1  (1-65535)</td><td><p>If the number of anomaly occurrences within the <code>CheckDuration</code> exceeds the value set in <code>Count</code>, the condition is treated as an anomaly.</p><ul><li>The unit is the number of occurrences.</li></ul></td></tr><tr><td>Action</td><td align="center">N/A</td><td><p>Specifies which follow-up actions to take after an anomaly is detected.</p><p>The available follow-up actions are as follows, and multiple actions can be configured at the same time:</p><ol><li><code>TerminateStream</code>: Stops the stream when an anomaly is detected on a source type such as <code>WebRTC</code>, <code>Ovt</code>, <code>RTMP</code>, <code>RtmpPull</code>, <code>Rtsp</code>, <code>RtspPull</code>, <code>Mpegts</code>, or <code>Srt</code>.</li><li><code>Alert</code>: Sends the anomaly detection result to alert.</li></ol></td></tr></tbody></table>

### 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:

```xml
<Server>
	<Alert>
		<Rules>
		...
			<Anomaly>
				<DTSReversal>
					<CheckDuration>5</CheckDuration>	<!-- During the last 5 seconds -->
					<Count>2</Count>	<!-- Two or more times -->
					<Threshold>5</Threshold>	<!-- DTS reversed by 5ms or more -->
					<Action>TerminateStream,Alert</Action>	<!-- Terminates the stream and sends an alert -->
				</DTSReversal>
				...
```

\= 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`).

<table><thead><tr><th width="139.5555419921875">Key</th><th width="159.5555419921875" align="center">Default (Allowed)</th><th>Description</th></tr></thead><tbody><tr><td>Threshold</td><td align="center">1<br>(1-2147483647)</td><td><p>The criterion for “By how many milliseconds must the DTS be reversed for it to be regarded as an anomaly?”</p><ul><li>The unit is milliseconds (ms)</li></ul></td></tr></tbody></table>

#### Notification example

```json
{
	"sourceUri": "#default#app/stream",
	"messages": [
		{
			"code": "ANOMALY_DTS_REVERSAL_DETECTED",
			"description": "DTS has been reversed by 100."
		}
	],
	"type": "ANOMALY"
}
```

### 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:

```xml
<Server>
	<Alert>
		<Rules>
			<Anomaly>
				<DTSJump>
					<CheckDuration>5</CheckDuration>	<!-- During the last 5 seconds -->
					<Count>2</Count>	<!-- Two or more times -->
					<Threshold>1000</Threshold>	<!-- DTS spikes by 1000 ms or more -->
					<Action>TerminateStream,Alert</Action>	<!-- Terminates the stream and sends an alert -->
				</DTSJump>
				...
```

\= 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`).

<table><thead><tr><th width="139.5555419921875">Key</th><th width="159.5555419921875" align="center">Default (Allowed)</th><th>Description</th></tr></thead><tbody><tr><td>Threshold</td><td align="center">1000<br>(1-2147483647)</td><td><p>The criterion for “By how many milliseconds must the DTS jump for it to be regarded as an anomaly?”</p><ul><li>The unit is milliseconds (ms).</li></ul></td></tr></tbody></table>

#### Notification example

```json
{
	"sourceUri": "#default#app/stream",
	"messages": [
		{
			"code": "ANOMALY_DTS_JUMP_DETECTED",
			"description": "DTS has increased significantly by 3000."
		}
	],
	"type": "ANOMALY"
}
```

### 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:

```xml
<Server>
	<Alert>
		<Rules>
			<Anomaly>
				<DTSDuplication>
					<CheckDuration>5</CheckDuration>	<!-- During the last 5 seconds -->
					<Count>2</Count>	<!-- Two or more times -->
					<Action>TerminateStream,Alert</Action>	<!-- Terminates the stream and sends an alert -->
				</DTSDuplication>
				...
```

\= 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`).

#### Notification example

```json
{
	"sourceUri": "#default#app/stream",
	"messages": [
		{
			"code": "ANOMALY_DTS_DUPLICATION_DETECTED",
			"description": "DTS has been duplicated 2 times."
		}
	],
	"type": "ANOMALY"
}
```

### Configuring PacketTimeout

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

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

```xml
<Server>
	<Alert>
		<Rules>
			<Anomaly>
				<PacketTimeout>
					<CheckDuration>5</CheckDuration>	<!-- During the last 5 seconds -->
					<Count>2</Count>	<!-- Two or more times -->
					<Threshold>1000</Threshold>	<!-- No packets have been received for 1000 ms or more -->
					<Action>TerminateStream,Alert</Action>	<!-- Terminates the stream and sends an alert -->
				</PacketTimeout>
				...
```

\= 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`).

<table><thead><tr><th width="139.5555419921875">Key</th><th width="159.5555419921875" align="center">Default (Allowed)</th><th>Description</th></tr></thead><tbody><tr><td>Threshold</td><td align="center">1500<br>(1-2147483647)</td><td><p>The criterion for “By how many milliseconds must no packet be received for it to be regarded as an anomaly?”</p><ul><li>The unit is milliseconds (ms).</li></ul></td></tr></tbody></table>

{% hint style="warning" %}
Because this `PacketTimeout` feature overlaps with the [`PacketSilenceTimeoutMs` in Origin Redundancy,](https://ovenmediaengine-enterprise.gitbook.io/guide/high-availability/origin-redundancy#packetsilencetimeoutms) we recommend using the Anomaly Detection feature.

* If both settings are enabled, the module configured with the smaller value will take effect first.
  {% endhint %}

#### Notification example

```json
{
	"sourceUri": "#default#app/stream",
	"messages": [
		{
			"code": "ANOMALY_PACKET_TIMEOUT_DETECTED",
			"description": "No packets have been received for 1500ms."
		}
	],
	"type": "ANOMALY"
}
```
