feat: add silence detection as failover trigger#40
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
New config options:
Includes 17 passing tests covering analysis, config, failover integration, grace period, and edge cases.