Skip to content

feat: add silence detection as failover trigger#40

Merged
sparkison merged 3 commits intom3ue:devfrom
Serph91P:feature/silence-detection
Mar 11, 2026
Merged

feat: add silence detection as failover trigger#40
sparkison merged 3 commits intom3ue:devfrom
Serph91P:feature/silence-detection

Conversation

@Serph91P
Copy link
Copy Markdown
Contributor

Add audio silence detection using ffmpeg's silencedetect filter to automatically trigger failover when a stream's audio goes silent.

This mirrors the existing bitrate monitoring pattern:

  • Configurable via environment variables (ENABLE_SILENCE_DETECTION, etc.)
  • Grace period before monitoring starts
  • Consecutive threshold to prevent false positives
  • Automatic reset on audio recovery
  • Full state reset on failover (from any trigger)
  • Skipped for VOD streams

New config options:

  • ENABLE_SILENCE_DETECTION (default: false)
  • SILENCE_THRESHOLD_DB (default: -50.0 dB)
  • SILENCE_DURATION (default: 3.0s)
  • SILENCE_CHECK_INTERVAL (default: 10.0s)
  • SILENCE_FAILOVER_THRESHOLD (default: 3 consecutive)
  • SILENCE_MONITORING_GRACE_PERIOD (default: 15.0s)

Includes 17 passing tests covering analysis, config, failover integration, grace period, and edge cases.

Add audio silence detection using ffmpeg's silencedetect filter to
automatically trigger failover when a stream's audio goes silent.

This mirrors the existing bitrate monitoring pattern:
- Configurable via environment variables (ENABLE_SILENCE_DETECTION, etc.)
- Grace period before monitoring starts
- Consecutive threshold to prevent false positives
- Automatic reset on audio recovery
- Full state reset on failover (from any trigger)
- Skipped for VOD streams

New config options:
- ENABLE_SILENCE_DETECTION (default: false)
- SILENCE_THRESHOLD_DB (default: -50.0 dB)
- SILENCE_DURATION (default: 3.0s)
- SILENCE_CHECK_INTERVAL (default: 10.0s)
- SILENCE_FAILOVER_THRESHOLD (default: 3 consecutive)
- SILENCE_MONITORING_GRACE_PERIOD (default: 15.0s)

Includes 17 passing tests covering analysis, config, failover
integration, grace period, and edge cases.
…n logic

Don't hard code the format `mpegts` as incoming streams are not guaranteed to be TS.
@sparkison sparkison merged commit f1f3e03 into m3ue:dev Mar 11, 2026
@Serph91P Serph91P deleted the feature/silence-detection branch March 11, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants