A comprehensive production-grade platform for setting up and managing robust RTSP audio streaming with MediaMTX. This project includes automated installation, configuration, monitoring, and recovery components designed for reliability in mission-critical environments.
- Overview
- Architecture
- Features
- Requirements
- Installation
- Configuration
- Usage
- Monitoring System
- Logging
- Troubleshooting
- Uninstallation
- Advanced Topics
- Technical Details
- License and Contributors
This platform provides a complete solution for setting up audio streaming from various capture devices (USB microphones, audio interfaces, etc.) to RTSP endpoints. It handles the complexities of audio device management, streaming configuration, and system monitoring with production-grade reliability features.
The platform is designed for:
- Multi-room audio streaming installations
- Conference room audio distribution
- Network audio monitoring systems
- Studio setups with multiple audio sources
- Broadcast monitoring and ingest systems
The platform consists of the following core components:
-
MediaMTX Installer (
install_mediamtx.sh
)- Secure and robust installation of the MediaMTX RTSP server
- Architecture detection and checksum verification
- Custom port configuration
- Systemd integration
-
Audio RTSP Setup (
setup_audio_rtsp.sh
)- Audio streaming service configuration
- Log rotation setup
- Helper scripts creation
-
Stream Management (
startmic.sh
)- Audio device detection and stream configuration
- Device mapping for consistent stream naming
- Stream monitoring and auto-recovery
- Per-device configuration options
-
System Monitoring (
mediamtx-monitor.sh
)- Resource usage monitoring (CPU, memory, file descriptors)
- Four-level progressive recovery system
- Trend analysis for predictive maintenance
- System-wide health checks
-
Version Checker (
MediaMTX-Version-Checker.sh
)- Version availability validation
- Checksum verification
- Architecture compatibility checking
-
All-in-One Installer (
mediamtx-rtsp-audio-installer.sh
)- Single script to manage all aspects of installation
- Interactive menus for configuration
- Update, reinstall, and uninstall capabilities
- Troubleshooting and log management
- Secure Installation: Cryptographic verification of downloaded binaries
- Automatic Device Discovery: Detects all connected audio capture devices
- Persistent Device Naming: Maintains consistent stream names across reboots
- Granular Configuration: Per-device audio settings (channels, bitrate, codec, etc.)
- Production-Grade Reliability: Proper error handling, atomic operations, and resource monitoring
- Self-Healing: Multi-level recovery system with automatic service restoration
- Comprehensive Logging: Detailed logs with rotation and retention policies
- Device Blacklisting: Exclude specific devices from streaming
- Advanced Resource Monitoring: Tracks CPU, memory, and network with trend analysis
- Audio Processing: Support for custom FFmpeg filters per device
- Deadman Switch Protection: Prevents excessive reboot cycles
- Disk Space Monitoring: Emergency cleanup for low disk space conditions
- Operating System: Linux (Debian/Ubuntu/Raspberry Pi OS recommended)
- Processor: 1GHz or faster (ARM or x86_64)
- Memory: 512MB minimum, 1GB+ recommended
- Storage: 100MB free space minimum
- Network: Ethernet or WiFi connection
- Base System: Systemd-based Linux distribution
- Required Packages:
- bash (4.0+)
- systemd
- ffmpeg (4.0+)
- curl or wget
- Optional but recommended: jq
- Audio Devices: USB audio interfaces, microphones or capture cards with ALSA support
- For Raspberry Pi installations:
- Raspberry Pi 3 or newer recommended
- Proper USB power supply (2.5A+ recommended)
Before installation:
- Ensure system is up to date:
sudo apt update && sudo apt upgrade -y
- Install required packages:
sudo apt install ffmpeg curl jq
- Expand filesystem if on Raspberry Pi:
sudo raspi-config
→ Advanced Options → Expand Filesystem
This platform provides two installation methods:
- All-in-One Installer: A single script that handles the complete installation process with interactive menus
- Manual Installation: Step-by-step installation of individual components for more control
⚠️ SECURITY WARNING: Always review scripts before downloading and running them with sudo privileges. The installation scripts require root access to configure system services and modify system directories.
The simplest way to install the MediaMTX RTSP Audio Platform is using the all-in-one installer script:
# Download the installer script
wget https://raw.githubusercontent.com/tomtom215/mediamtx-rtsp-setup/refs/heads/main/mediamtx-rtsp-audio-installer.sh
# Make it executable
chmod +x mediamtx-rtsp-audio-installer.sh
# Run the installer
sudo ./mediamtx-rtsp-audio-installer.sh
This will guide you through an interactive installation process, handling all the component setup automatically.
For non-interactive installation with default settings:
sudo ./mediamtx-rtsp-audio-installer.sh install -y -q
If you prefer to install components individually or want more control over the installation process:
-
First, download all necessary scripts:
# Create a directory for the scripts mkdir -p mediamtx-rtsp-setup && cd mediamtx-rtsp-setup # Download all required scripts wget --progress=bar:force:noscroll \ https://raw.githubusercontent.com/tomtom215/mediamtx-rtsp-setup/refs/heads/main/install_mediamtx.sh \ https://raw.githubusercontent.com/tomtom215/mediamtx-rtsp-setup/refs/heads/main/setup_audio_rtsp.sh \ https://raw.githubusercontent.com/tomtom215/mediamtx-rtsp-setup/refs/heads/main/startmic.sh \ https://raw.githubusercontent.com/tomtom215/mediamtx-rtsp-setup/refs/heads/main/setup-monitor-script.sh \ https://raw.githubusercontent.com/tomtom215/mediamtx-rtsp-setup/refs/heads/main/mediamtx-monitor.sh # Make all scripts executable chmod +x *.sh
Alternatively, if you prefer git:
git clone https://github.com/tomtom215/mediamtx-rtsp-setup.git cd mediamtx-rtsp-setup chmod +x *.sh
-
Install each component in sequence:
# Step 1: Install MediaMTX RTSP server sudo ./install_mediamtx.sh # Step 2: Set up audio RTSP streaming sudo ./setup_audio_rtsp.sh # Step 3: Set up monitoring system (recommended) sudo ./setup-monitor-script.sh
-
Verify installation:
# Check streaming status sudo check-audio-rtsp.sh # Check monitoring system sudo check-mediamtx-monitor.sh
For customized installations, the MediaMTX installer supports various options:
sudo ./install_mediamtx.sh [OPTIONS]
Available options:
-v, --version VERSION
- Specify MediaMTX version (default: v1.12.2)-p, --rtsp-port PORT
- Specify RTSP port (default: 18554)--rtmp-port PORT
- Specify RTMP port (default: 11935)--hls-port PORT
- Specify HLS port (default: 18888)--webrtc-port PORT
- Specify WebRTC port (default: 18889)--metrics-port PORT
- Specify metrics port (default: 19999)- And other options for checksum verification and installation modes
Examples:
# Install latest version with custom RTSP port
sudo ./install_mediamtx.sh --version latest --rtsp-port 8554
# Only update configuration
sudo ./install_mediamtx.sh --config-only --rtsp-port 8554
The all-in-one installer also supports various commands and options:
sudo ./mediamtx-rtsp-audio-installer.sh [COMMAND] [OPTIONS]
Commands:
install
- Install MediaMTX and audio streaming platformuninstall
- Remove all installed componentsupdate
- Update to the latest version while preserving configreinstall
- Completely remove and reinstallstatus
- Show status of all componentstroubleshoot
- Run diagnostics and fix common issueslogs
- View or manage logs
Options:
-v, --version VERSION
- Specify MediaMTX version-p, --rtsp-port PORT
- Specify RTSP port-d, --debug
- Enable debug mode-q, --quiet
- Minimal output-y, --yes
- Answer yes to all prompts-f, --force
- Force operation-h, --help
- Show help message
The platform uses a hierarchy of configuration files for different aspects of the system.
The main configuration file is located at /etc/audio-rtsp/config
and contains system-wide settings:
# Audio RTSP Streaming Service Configuration
RTSP_PORT=18554
RESTART_DELAY=10
MAX_RESTART_ATTEMPTS=5
LOG_LEVEL=info
LOG_DIR=/var/log/audio-rtsp
LOG_ROTATE_DAYS=7
# Audio Settings
AUDIO_BITRATE=192k
AUDIO_CODEC=libmp3lame
AUDIO_CHANNELS=1
AUDIO_SAMPLE_RATE=44100
# Recovery Settings
CPU_THRESHOLD=80
MEMORY_THRESHOLD=15
MAX_UPTIME=86400
ENABLE_AUTO_REBOOT=false
Parameter | Description | Default |
---|---|---|
RTSP_PORT | Port for RTSP streaming | 18554 |
RESTART_DELAY | Seconds to wait before restarting failed streams | 10 |
MAX_RESTART_ATTEMPTS | Maximum number of restart attempts | 5 |
LOG_LEVEL | Logging level (debug, info, warning, error) | info |
LOG_ROTATE_DAYS | Number of days to keep logs | 7 |
AUDIO_BITRATE | Audio bitrate for streams | 192k |
AUDIO_CODEC | Audio codec for streams | libmp3lame |
AUDIO_CHANNELS | Number of audio channels | 1 |
AUDIO_SAMPLE_RATE | Audio sample rate | 44100 |
CPU_THRESHOLD | CPU usage percentage that triggers restart | 80 |
MEMORY_THRESHOLD | Memory usage percentage that triggers restart | 15 |
MAX_UPTIME | Force restart after this many seconds (24h) | 86400 |
ENABLE_AUTO_REBOOT | Whether to allow system reboot for recovery | false |
Each audio device can have its own configuration file in the /etc/audio-rtsp/devices/
directory. Files are named after the device's stream name with a .conf
extension.
Example device configuration (/etc/audio-rtsp/devices/conference_room_mic.conf
):
# Device-specific configuration for conference_room_mic
# Custom audio settings - override global configuration
AUDIO_CHANNELS=2 # Use stereo for this device
AUDIO_SAMPLE_RATE=48000 # Higher sample rate
AUDIO_BITRATE=256k # Higher bitrate
AUDIO_CODEC="libmp3lame" # MP3 codec
# Advanced FFmpeg settings
FFMPEG_ADDITIONAL_OPTS="-af highpass=f=100,lowpass=f=8000,volume=2.0"
Parameter | Description | Example Values |
---|---|---|
AUDIO_CHANNELS | Number of audio channels | 1 (mono), 2 (stereo) |
AUDIO_SAMPLE_RATE | Sample rate in Hz | 44100, 48000, 96000 |
AUDIO_BITRATE | Audio encoding bitrate | 128k, 192k, 256k, 320k |
AUDIO_CODEC | FFmpeg audio codec to use | libmp3lame, aac, libopus, flac |
FFMPEG_ADDITIONAL_OPTS | Additional FFmpeg parameters | "-af ..." (audio filters) |
You can use the FFMPEG_ADDITIONAL_OPTS
parameter to apply audio processing using FFmpeg filters:
- Noise reduction:
-af highpass=f=200,lowpass=f=3000
- Volume boost:
-af volume=1.5
- Compression:
-af acompressor=threshold=0.05:ratio=4
- Normalization:
-af dynaudnorm
- Multiple filters:
-af highpass=f=100,dynaudnorm,volume=1.2
Example with detailed compression:
FFMPEG_ADDITIONAL_OPTS="-af acompressor=threshold=0.05:ratio=4:attack=200:release=1000:makeup=2"
The device map file (/etc/audio-rtsp/device_map.conf
) provides persistent naming for audio devices across reboots:
# Format: DEVICE_UUID=friendly_name
usb_audio_c13487=conference_room_mic
usb_audio_a98712=reception_desk
usb_audio_046d041e=wireless_lapel_mic
This ensures the same device always gets the same stream name, even if the device order changes after a reboot.
The blacklist file (/etc/audio-rtsp/device_blacklist.conf
) allows excluding specific devices from being streamed:
# Audio Device Blacklist - Add devices you want to exclude from streaming
bcm2835_headpho # Raspberry Pi onboard audio output (no capture)
HDMI # Generic HDMI audio output (no capture)
broken_webcam # Device with issues
The monitoring system has its own configuration parameters in the global config file:
# Recovery Thresholds
CPU_THRESHOLD=80
CPU_WARNING_THRESHOLD=70
CPU_SUSTAINED_PERIODS=3
MEMORY_THRESHOLD=15
MEMORY_WARNING_THRESHOLD=12
EMERGENCY_CPU_THRESHOLD=95
EMERGENCY_MEMORY_THRESHOLD=20
FILE_DESCRIPTOR_THRESHOLD=1000
COMBINED_CPU_THRESHOLD=200
# Recovery Settings
MAX_RESTART_ATTEMPTS=5
RESTART_COOLDOWN=300
REBOOT_THRESHOLD=3
ENABLE_AUTO_REBOOT=false
REBOOT_COOLDOWN=1800
MAX_REBOOTS_IN_DAY=5
Parameter | Description | Default |
---|---|---|
CPU_THRESHOLD | CPU usage % that triggers recovery | 80 |
CPU_SUSTAINED_PERIODS | Number of periods before action | 3 |
MEMORY_THRESHOLD | Memory usage % that triggers recovery | 15 |
EMERGENCY_CPU_THRESHOLD | CPU % for immediate recovery | 95 |
FILE_DESCRIPTOR_THRESHOLD | FD count that triggers recovery | 1000 |
MAX_RESTART_ATTEMPTS | Max attempts before escalation | 5 |
RESTART_COOLDOWN | Seconds between restarts | 300 |
REBOOT_THRESHOLD | Failed recoveries before reboot | 3 |
ENABLE_AUTO_REBOOT | Whether to allow system reboots | false |
MAX_REBOOTS_IN_DAY | Maximum allowed reboots in 24 hours | 5 |
The platform creates three systemd services that can be managed using standard systemd commands:
# Check service status
sudo systemctl status mediamtx
# Start the service
sudo systemctl start mediamtx
# Stop the service
sudo systemctl stop mediamtx
# Restart the service
sudo systemctl restart mediamtx
# View logs
sudo journalctl -u mediamtx -f
# Check service status
sudo systemctl status audio-rtsp
# Start the service
sudo systemctl start audio-rtsp
# Stop the service
sudo systemctl stop audio-rtsp
# Restart the service
sudo systemctl restart audio-rtsp
# View logs
sudo journalctl -u audio-rtsp -f
# Check monitoring service status
sudo systemctl status mediamtx-monitor
# Start the monitoring service
sudo systemctl start mediamtx-monitor
# Stop the monitoring service
sudo systemctl stop mediamtx-monitor
# View monitoring logs
sudo journalctl -u mediamtx-monitor -f
To edit the global configuration:
sudo nano /etc/audio-rtsp/config
Or use the interactive configuration editor:
sudo configure-audio-rtsp.sh
To configure a specific device:
sudo nano /etc/audio-rtsp/devices/device_name.conf
To edit device mapping (for persistent naming):
sudo nano /etc/audio-rtsp/device_map.conf
To edit device blacklist:
sudo nano /etc/audio-rtsp/device_blacklist.conf
After making configuration changes, restart the audio-rtsp service:
sudo systemctl restart audio-rtsp
Check the status of your audio streams:
sudo check-audio-rtsp.sh
This shows:
- Service status and uptime
- Running audio streams with their RTSP URLs
- Available sound cards
- System resource usage
- Recent log entries
Check the health of the MediaMTX server and monitoring system:
sudo check-mediamtx-monitor.sh
This shows:
- Monitoring service status
- MediaMTX resource usage (CPU, memory, file descriptors)
- Combined CPU usage (MediaMTX + ffmpeg processes)
- Recent recovery actions
- Performance trends and metrics
Audio streams are available at:
rtsp://[SERVER_IP]:18554/[DEVICE_NAME]
Where:
[SERVER_IP]
is your server's IP address (orlocalhost
for local access)[DEVICE_NAME]
is the device name from the device mapping or the automatically generated name
Example:
rtsp://192.168.1.100:18554/conference_room_mic
Open a stream in VLC:
- Open VLC
- Go to Media > Open Network Stream
- Enter the RTSP URL, e.g.,
rtsp://192.168.1.100:18554/conference_room_mic
- Click Play
ffplay rtsp://192.168.1.100:18554/conference_room_mic
To test streaming to your RTSP server:
ffmpeg -f lavfi -i sine=frequency=440:sample_rate=44100 -f rtsp rtsp://localhost:18554/test_tone
The monitoring system tracks several key resources:
- CPU Usage: Both MediaMTX process CPU and combined CPU (MediaMTX + all ffmpeg processes)
- Memory Usage: MediaMTX process memory consumption
- File Descriptors: Open file handles for detecting resource leaks
- Process Uptime: To enforce periodic restarts if needed
- Network Connectivity: RTSP port accessibility
- Disk Space: Monitors disk space and performs emergency cleanup if needed
These metrics are tracked over time to detect trends and predict potential issues before they cause service interruptions.
The system employs a progressive recovery approach with four levels:
- Gentle systemd-based restart
- Minimal service disruption
- Used for first recovery attempt
- Stops related processes
- Cleans up resources
- Performs more thorough service restart
- Used after Level 1 fails
- Force kills problematic processes
- Cleans shared memory and socket files
- Performs deep resource cleanup
- Restarts full service chain
- Used when levels 1-2 fail
- Only triggered after multiple Level 3 failures
- Makes one final recovery attempt
- Initiates system reboot if all else fails
- Requires
ENABLE_AUTO_REBOOT=true
in config - Protected by deadman switch to prevent reboot loops
The platform maintains several log files for different components:
# Audio streaming logs
/var/log/audio-rtsp/audio-streams.log # Main streaming log
/var/log/audio-rtsp/service.log # Service operation log
/var/log/audio-rtsp/service-error.log # Error log
# MediaMTX logs
/var/log/mediamtx/mediamtx.log # MediaMTX server log
# Monitoring system logs
/var/log/audio-rtsp/mediamtx-monitor.log # Main monitor log
/var/log/audio-rtsp/recovery-actions.log # Recovery action log
/var/log/audio-rtsp/state/ # System state information
Logs are automatically rotated to prevent disk space issues:
- Default rotation period: 7 days (configurable)
- Compression of rotated logs
- Service restart after rotation to ensure proper file handles
To customize log rotation settings:
sudo nano /etc/logrotate.d/audio-rtsp
# Monitor audio streaming logs
sudo tail -f /var/log/audio-rtsp/audio-streams.log
# Monitor MediaMTX server logs
sudo tail -f /var/log/mediamtx/mediamtx.log
# Monitor recovery actions
sudo tail -f /var/log/audio-rtsp/recovery-actions.log
# Follow all logs in real-time
sudo journalctl -f -u mediamtx -u audio-rtsp -u mediamtx-monitor
-
Check if audio devices are detected:
arecord -l
-
Verify MediaMTX is running:
systemctl status mediamtx
-
Check port availability:
sudo ss -tuln | grep 18554
-
Check logs for errors:
sudo tail -f /var/log/audio-rtsp/audio-streams.log
-
Check audio levels:
alsamixer # Use F6 to select the right card
-
Verify USB power is sufficient (especially on Raspberry Pi)
-
Check CPU usage:
top
High CPU can cause audio glitches
-
Check for specific stream issues:
sudo grep "device_name" /var/log/audio-rtsp/audio-streams.log
-
Check monitoring status:
sudo check-mediamtx-monitor.sh
-
Review recovery logs:
sudo cat /var/log/audio-rtsp/recovery-actions.log
-
Check for resource leaks:
sudo lsof -p $(pgrep mediamtx) | wc -l
-
Adjust threshold settings in config if needed.
The platform includes several diagnostic tools:
sudo ./mediamtx-rtsp-audio-installer.sh troubleshoot
This interactive tool will:
- Check system status
- Verify services
- Look for common issues
- Offer to fix detected problems
sudo check-audio-rtsp.sh
This provides comprehensive information about:
- Current streams
- Available audio devices
- Service status
- Recent log entries
sudo check-mediamtx-monitor.sh
This shows:
- Monitoring service status
- Resource usage metrics
- Recovery history
- Performance trends
sudo mediamtx-monitor-diagnostic-fix.sh
This tool:
- Diagnoses issues with the monitoring service
- Fixes common configuration problems
- Creates a simplified monitor script if needed
- Updates service configuration
sudo ./mediamtx-version-checker.sh
Verifies:
- Latest available version
- Download URL validity
- Checksum verification
- Architecture compatibility
-
Restart the audio streaming service:
sudo systemctl restart audio-rtsp
-
If that doesn't work, check devices:
arecord -l
-
Verify MediaMTX is running:
sudo systemctl status mediamtx
-
Check if device is blacklisted:
sudo cat /etc/audio-rtsp/device_blacklist.conf
-
Check resource usage:
sudo check-mediamtx-monitor.sh
-
Force recovery at level 2:
sudo systemctl restart mediamtx-monitor sudo systemctl restart mediamtx sudo systemctl restart audio-rtsp
-
Check logs for specific errors:
grep ERROR /var/log/audio-rtsp/mediamtx-monitor.log
-
Use the diagnostic fix tool for monitor issues:
sudo mediamtx-monitor-diagnostic-fix.sh
The platform includes an uninstallation script:
sudo uninstall-audio-rtsp.sh
This interactive script will:
- Stop and disable all services
- Remove scripts and configuration
- Ask if you want to remove log files
- Clean up systemd service files
Alternatively, use the all-in-one installer:
sudo ./mediamtx-rtsp-audio-installer.sh uninstall
If needed, you can manually remove components:
# Stop and disable services
sudo systemctl stop mediamtx-monitor audio-rtsp mediamtx
sudo systemctl disable mediamtx-monitor audio-rtsp mediamtx
# Remove service files
sudo rm /etc/systemd/system/mediamtx.service
sudo rm /etc/systemd/system/audio-rtsp.service
sudo rm /etc/systemd/system/mediamtx-monitor.service
sudo systemctl daemon-reload
# Remove scripts
sudo rm -f /usr/local/bin/startmic.sh
sudo rm -f /usr/local/bin/check-audio-rtsp.sh
sudo rm -f /usr/local/bin/check-mediamtx-monitor.sh
sudo rm -f /usr/local/bin/uninstall-audio-rtsp.sh
sudo rm -f /usr/local/bin/configure-audio-rtsp.sh
sudo rm -f /usr/local/bin/mediamtx-monitor.sh
# Remove configuration (optional)
sudo rm -rf /etc/audio-rtsp
sudo rm -rf /etc/mediamtx
# Remove binaries (optional)
sudo rm -rf /usr/local/mediamtx
# Remove log files (optional)
sudo rm -rf /var/log/audio-rtsp
sudo rm -rf /var/log/mediamtx
# Remove log rotation configuration
sudo rm -f /etc/logrotate.d/audio-rtsp
The platform supports advanced audio processing using FFmpeg filters in the device-specific configuration files:
# Add to device config file
FFMPEG_ADDITIONAL_OPTS="-af highpass=f=100,lowpass=f=7500,volume=1.5,dynaudnorm"
This applies:
- High-pass filter at 100Hz (removes low rumble)
- Low-pass filter at 7.5kHz (removes high hiss)
- Volume boost of 1.5x
- Dynamic audio normalization
# Add to device config file
FFMPEG_ADDITIONAL_OPTS="-af acompressor=threshold=0.05:ratio=4:attack=200:release=1000:makeup=2"
This applies:
- Threshold of -26dB (0.05)
- Compression ratio of 4:1
- 200ms attack time
- 1000ms release time
- 2dB makeup gain
# Add to device config file
FFMPEG_ADDITIONAL_OPTS="-af highpass=f=200,afftdn=nr=10:nf=-25"
This applies:
- High-pass filter at 200Hz
- FFT-based noise reduction with 10dB reduction and -25dB noise floor
For systems handling multiple audio streams, consider these performance optimizations:
-
Adjust codec settings for lower CPU usage:
AUDIO_CODEC="libmp3lame" # Generally more efficient than AAC AUDIO_BITRATE="128k" # Lower bitrate reduces CPU load
-
Reduce sample rate for non-critical audio:
AUDIO_SAMPLE_RATE=22050 # Half of CD quality, sufficient for voice
-
Adjust monitoring thresholds:
CPU_THRESHOLD=90 # Allow more CPU headroom CPU_SUSTAINED_PERIODS=5 # Wait longer before taking action
-
Set a maximum number of streams:
MAX_STREAMS=16 # Prevent resource exhaustion
-
Limit maximum number of streams:
MAX_STREAMS=16 # Prevent resource exhaustion
-
Consider lower bitrates for multiple streams:
AUDIO_BITRATE="96k" # Lower quality but more efficient
The platform includes several security features, but consider these additional measures:
-
Access Control: Use firewall rules to restrict RTSP access:
sudo ufw allow from 192.168.1.0/24 to any port 18554 proto tcp
-
Secure Installation: Always use checksum verification:
sudo ./install_mediamtx.sh --force-checksum
-
RTSP Authentication: Configure MediaMTX with authentication:
# Add to /etc/mediamtx/mediamtx.yml paths: secure: readUser: myuser readPass: mypassword
-
Service Hardening: The systemd service already includes security directives:
- ProtectSystem=full
- ProtectHome=true
- PrivateTmp=true
- NoNewPrivileges=true
The system implements robust version comparison and management:
- Semantic Versioning: Properly parses and compares version numbers (major.minor.patch)
- Version Checking: Validates available versions against GitHub releases
- Upgrade Path: Handles upgrades, downgrades, and reinstallations correctly
- Backup Creation: Automatically creates backups before upgrading
Multiple levels of failure detection and recovery are implemented:
- Process Monitoring: Tracks process health and resource usage
- Stream Monitoring: Detects and restarts failed streams
- Progressive Recovery: Escalates through recovery levels as needed
- Optional Auto-Reboot: Can trigger system reboot as last resort
- Deadman Switch: Prevents excessive reboot cycles
- Trend Analysis: Detects gradually increasing resource usage before failure
- Disk Space Monitoring: Emergency cleanup for low disk space conditions
The platform uses production-grade file handling techniques:
- Atomic Writes: All critical file operations use atomic write patterns
- Proper Locking: File locks to prevent race conditions
- Temporary Files: Uses unique temporary files for safer operations
- State Management: Persistent state tracking across restarts
- Safe Configuration Updates: Maintains backups of all configuration files
This software is released under the Apache 2.0 License.
- Main project development and maintenance
- Based on original concept by Cberge908 GitHub gist
- MediaMTX for the excellent RTSP server
- All testers and users who provided feedback
This project is not officially affiliated with the MediaMTX project.
Always review scripts before running them with sudo privileges.