feat(rtsp): startup preflight, profile locking, and reconnect hardening#23
Merged
feat(rtsp): startup preflight, profile locking, and reconnect hardening#23
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
==========================================
+ Coverage 81.53% 81.71% +0.17%
==========================================
Files 64 69 +5
Lines 5247 5976 +729
==========================================
+ Hits 4278 4883 +605
- Misses 969 1093 +124 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
This PR introduces mandatory RTSP startup preflight with profile locking, and hardens reconnect behavior so stream recovery does not depend on restarting HomeSec.
The net result is deterministic runtime behavior:
What Changed
src/homesec/sources/rtsp/discovery.pysrc/homesec/sources/rtsp/recording_profile.pysrc/homesec/sources/rtsp/preflight.pysrc/homesec/sources/rtsp/core.pysrc/homesec/app.pysrc/homesec/sources/rtsp/frame_pipeline.pysrc/homesec/sources/rtsp/recorder.pyPreflight Behavior
For each RTSP camera at startup:
ffprobe(timeout-option fallback supported)./stream2from/stream1patterns).mp4 + v:copy + a:copy(only when audio is MP4 copy-compatible)mp4 + v:copy + a:aacmp4 + v:copy + -anIf any camera preflight fails, startup exits non-zero.
Runtime Hardening Added In Follow-up Commits
Runtime Guarantees
stream.ffmpeg_flagson RTSP sources are warned-and-ignored when auto-preflight is active.Why This Matters
pcm_alaw) without manual ffmpeg tuning.Test Coverage
Added focused tests:
tests/homesec/test_rtsp_discovery.pytests/homesec/test_rtsp_preflight.pytests/homesec/test_rtsp_recording_profile.pytests/homesec/test_rtsp_startup_failfast.pytests/homesec/rtsp/test_runtime.py::test_reconnect_retries_detect_stream_when_fallback_failsUpdated affected suites:
tests/homesec/rtsp/test_frame_pipeline.pytests/homesec/rtsp/test_runtime.pytests/homesec/test_app.pyValidation
make checkruff check src testsruff format --check src testsmypy --strictpytest tests/homesec/ --cov=homesec --cov-report=term-missing344 passed.Notes