In the project, the RLAC-AudioRecorder module is the core of the system. It captures the radio stream without interruption, 24 hours a day, and transforms this raw stream into segments usable by a mobile application.
While Python is excellent for AI, Java (via Spring Boot) was preferred for the capture part for several reasons:
Rather than starting a recording at the precise moment a chronicle begins (which risks missing the first few seconds due to connection latency), a two-stage system was implemented.
A permanent FFmpeg process runs continuously. It generates 1-second fMP4 segments. This rolling buffer allows the AI to analyze the near past and the system to “go back in time” to capture the exact start of a chronicle.
When a “START” notification is issued by the AI engine, the Java server does not start a new recording. It begins creating links (hard links or symlinks) or copying segments already generated by the Master Stream to a folder specific to the chronicle. This is the Dynamic Recording principle.

FFmpeg control is handled via ProcessBuilder. Standard output is monitored to detect stream errors (internet connection loss, bitrate changes) and automatically restart the process if necessary.
// Simplified process monitoring example
ProcessBuilder pb = new ProcessBuilder("ffmpeg", "-i", streamUrl, ...);
Process process = pb.start();
// Active surveillance in a separate thread
To ensure high availability, several mechanisms were put in place:
This system achieves high capture reliability. Even if the AI service is momentarily unavailable, the continuous stream remains active, allowing post-hoc analysis to recover missing segments.