Closed tphakala closed 3 months ago
The recent updates enable capturing multiple RTSP audio streams by modifying the RTSP.Url
parameter to an array RTSP.Urls
. This change spans across several files, adjusting the configuration structure, enhancing the audio capture function to handle multiple streams, and improving error handling and logging mechanisms.
File Path | Change Summary |
---|---|
cmd/realtime/realtime.go |
Updated RTSP.Url to RTSP.Urls for multiple RTSP streams. |
internal/analysis/realtime.go |
Adjusted RealtimeAnalysis for buffer multiplier based on RTSP stream count; improved Ctrl+C signal handling with logging. |
internal/conf/config.go |
Changed RTSP.Url to RTSP.Urls in Settings struct for multiple URLs. |
internal/myaudio/capture.go |
Enhanced CaptureAudio to handle multiple RTSP URLs, spawning a goroutine for each. |
internal/myaudio/rstp.go |
Updated captureAudioRTSP to accept individual URLs and refactored error handling and process management. |
sequenceDiagram
participant User
participant MainApp
participant Config
participant AudioCapture
participant RTSPStream
User->>MainApp: Start Application
MainApp->>Config: Load Settings
Config-->>MainApp: Return Settings (with RTSP URLs)
MainApp->>AudioCapture: Initialize Capture with Settings
AudioCapture->>RTSPStream: Start Stream 1
AudioCapture->>RTSPStream: Start Stream 2
loop On Error
RTSPStream->>AudioCapture: Error Occurred
AudioCapture->>RTSPStream: Restart Stream
end
User->>MainApp: Send Ctrl+C
MainApp->>AudioCapture: Signal Quit
AudioCapture->>RTSPStream: Stop Streams
RTSPStream-->>AudioCapture: Streams Stopped
AudioCapture-->>MainApp: Capture Stopped
In the world of streams, where data flows, We now embrace what the update bestows. Multiple URLs, in tandem they sing, Capturing audio, a harmonious ring. With buffers adjusted and errors in check, Our code now stands tall, with nary a speck. 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This is great to have! Any chance we might be able to add labels to rtsp inputs (to note where detections occur?)
This is great to have! Any chance we might be able to add labels to rtsp inputs (to note where detections occur?)
Yes, I have been thinking of doing this.
This PR adds support for multiple RTSP streams, streams are configured by listing --rtsp setting multiple times for each stream