Automatically records all incoming SRT streams from OpenIRL/srtla-receiver with auto-discovery, segmented MKV output, and automatic cleanup.
- π¬ Auto-Recording β records all active SRT streams in crash-safe 15-minute MKV segments
- π Auto-Discovery β monitors OpenIRL logs and automatically adds new stream IDs without any manual input
- π§Ή Auto-Cleanup β deletes the oldest recordings when disk usage hits a configurable threshold
- π Disconnect Protection β a configurable grace period prevents recordings from stopping on brief network drops
- π Organised Storage β recordings are automatically sorted by stream ID and date
- π³ Docker-based β works on any Linux system running Docker, including x86 and ARM (Raspberry Pi)
- OpenIRL/srtla-receiver installed and running
- Docker + Docker Compose
- Ubuntu 22.04 / Debian 12 or any Linux distribution with Docker support
The core component. Polls the OpenIRL stats API every 10 seconds to check which streams are active, then launches an FFmpeg process per stream writing segmented MKV files. If a stream goes offline it waits for the grace period to expire before stopping the recording β protecting against brief disconnections.
An optional systemd service that monitors the OpenIRL Docker container logs in real time. When it detects a new live_ stream ID connecting, it automatically converts it to the equivalent play_ ID and appends it to stream_ids.txt. The recorder picks it up within 30 seconds.
An optional systemd service that checks disk usage on a configurable interval. When usage exceeds the threshold (default 85%) it deletes the oldest recording segments until usage drops below the target level (default 75%).
All settings are configured via environment variables in ~/irl-auto-recorder/docker-compose.yml:
| Variable | Default | Description |
|---|---|---|
STATS_HOST |
127.0.0.1:8080 |
OpenIRL stats API host and port |
SRT_CALLER_HOST |
127.0.0.1:4000 |
SRT output port to record from |
SEGMENT_DURATION |
900 |
Recording segment length in seconds (default 15 min) |
DISCONNECT_GRACE |
90 |
Seconds to wait before stopping after a disconnect |
POLL_INTERVAL |
10 |
How often to check active streams in seconds |
DISCOVERY_INTERVAL |
30 |
How often to check stream_ids.txt for new entries |
RECORDINGS_BASE |
/root/recordings |
Recording output path inside the container |
After editing, apply changes with:
cd ~/irl-auto-recorder && docker compose restartWe've got you covered. The QUICKSTART.md guide walks you through the entire setup from start to finish with simple copy-paste commands β no Linux expertise required.
β‘οΈ Click here to go to the Quick Start Guide
Just clone the repo, run the installer, and you're recording in minutes.
π‘ Just want to get started? Use QUICKSTART.md β it handles all of this automatically via the installer scripts.
The following is for advanced users who want to understand what the installers do, run components manually, or integrate this into an existing setup.
# Install Docker
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER # Add your user to the docker group
newgrp docker # Apply group change without logoutThe recorder runs as a Docker container built from the included Dockerfile. To build and start it manually without the installer:
cd ~/irl-auto-recorder
# Create recordings directory and stream list
mkdir -p ~/recordings
touch ~/recordings/stream_ids.txt
# Build and start
docker compose up -d --build
# Verify
docker ps | grep irl-auto-recorder
docker logs -f irl-auto-recorderTo run without Docker Compose directly:
docker build -t irl-auto-recorder .
docker run -d \
--name irl-auto-recorder \
--network host \
--restart unless-stopped \
-v ~/recordings:/root/recordings \
-e STATS_HOST=127.0.0.1:8080 \
-e SRT_CALLER_HOST=127.0.0.1:4000 \
-e SEGMENT_DURATION=900 \
-e DISCONNECT_GRACE=90 \
irl-auto-recorderThe auto-discovery script runs as a systemd service. To install it manually:
# Copy script
cp stream_auto_discovery.py ~/stream_auto_discovery.py
chmod +x ~/stream_auto_discovery.py
# Install systemd service (replace 'youruser' with your Linux username)
sudo cp openirl-discovery.service /etc/systemd/system/
sudo sed -i 's/%i/youruser/g' /etc/systemd/system/openirl-discovery.service
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable openirl-discovery
sudo systemctl start openirl-discovery
# Verify
sudo systemctl status openirl-discoveryThe cleanup script is a bash script run by a systemd service. To install manually:
# Copy and make executable
cp auto_cleanup.sh ~/auto_cleanup.sh
chmod +x ~/auto_cleanup.sh
# Install systemd service
sudo cp openirl-cleanup.service /etc/systemd/system/
sudo sed -i 's/%i/youruser/g' /etc/systemd/system/openirl-cleanup.service
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable openirl-cleanup
sudo systemctl start openirl-cleanupIf you prefer to run auto_recorder.py directly on the host rather than in Docker, ensure FFmpeg is installed:
sudo apt install ffmpeg python3 -y
python3 ~/irl-auto-recorder/auto_recorder.pyOr as a systemd service for auto-start on boot:
sudo nano /etc/systemd/system/irl-recorder.service[Unit]
Description=IRL Auto-Recorder
After=network.target docker.service
Requires=docker.service
[Service]
Type=simple
User=youruser
WorkingDirectory=/home/youruser
Environment=STATS_HOST=127.0.0.1:8080
Environment=SRT_CALLER_HOST=127.0.0.1:4000
Environment=SEGMENT_DURATION=900
Environment=DISCONNECT_GRACE=90
Environment=RECORDINGS_BASE=/home/youruser/recordings
ExecStart=/usr/bin/python3 /home/youruser/irl-auto-recorder/auto_recorder.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable irl-recorder
sudo systemctl start irl-recorderBy default recordings are saved to ~/recordings. To use a dedicated drive such as a SATA SSD, M.2 drive, or external USB:
1. Find and mount your drive:
lsblk -f
sudo mkdir -p /mnt/recordings
sudo mount /dev/sdX1 /mnt/recordings2. Make the mount permanent via /etc/fstab:
sudo blkid /dev/sdX1 # Get UUID
sudo nano /etc/fstabAdd:
UUID=your-uuid-here /mnt/recordings ext4 defaults,nofail 0 2
The
nofailflag prevents boot failure if the drive is unplugged.
3. Set permissions:
sudo chown -R $USER:$USER /mnt/recordings4. Update docker-compose.yml:
volumes:
- /mnt/recordings:/root/recordings5. Restart the recorder:
cd ~/irl-auto-recorder
docker compose down && docker compose up -d --build| Drive Type | Filesystem | Notes |
|---|---|---|
| SATA / M.2 SSD | ext4 | Best performance on Linux |
| External USB SSD | ext4 | Format on Linux for best results |
| Shared with Windows | exFAT | Use only if the drive is also used on Windows |
| NAS / Network share | β | Mount via NFS or SMB first, then follow steps above |
β οΈ Avoid FAT32 β its 4GB file size limit will cause recording failures on long streams.
~/irl-auto-recorder/
βββ auto_recorder.py # Main recorder β polls stats API and manages FFmpeg
βββ stream_auto_discovery.py # Auto-discovery β monitors OpenIRL logs
βββ Dockerfile # Container definition
βββ docker-compose.yml # Environment config and volume mounts
βββ install_recorder.sh # Interactive installer for the recorder
βββ install_discovery.sh # Installer for auto-discovery systemd service
βββ install_cleanup.sh # Installer for auto-cleanup systemd service
βββ openirl-discovery.service # systemd unit file for auto-discovery
~/recordings/
βββ stream_ids.txt # List of play_ IDs to record (one per line)
βββ play_stream1/
β βββ 2026-03-22/
β βββ play_stream1_20260322_120000_part001.mkv
β βββ play_stream1_20260322_120000_part002.mkv
βββ play_stream2/
βββ 2026-03-22/
βββ play_stream2_20260322_130000_part001.mkv
If auto-discovery is installed, new streams are added to stream_ids.txt automatically within 30 seconds of a publisher connecting. If you need to add a stream manually β for example before a publisher connects, or if auto-discovery isn't installed β add the play_ stream ID directly:
Manually add a stream:
echo "play_yourstreamid" >> ~/recordings/stream_ids.txtThe recorder checks stream_ids.txt every 30 seconds and will start recording automatically once the stream is both listed and active.
Remove a stream from the list:
nano ~/recordings/stream_ids.txt
# Delete the relevant play_ line, save with Ctrl+O, Ctrl+XView active stream stats:
curl http://127.0.0.1:8080/stats/play_YOURSTREAMIDView today's recordings:
ls -lh ~/recordings/*/$(date +%Y-%m-%d)/File Browser is a lightweight web-based file manager that makes it easy to browse, download, and manage your recordings from any device on your network β no command line needed.
Install File Browser:
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bashRun pointing at your recordings folder:
filebrowser -r ~/recordings -a 0.0.0.0 -p 8082Access it in your browser:
http://YOUR-SERVER-IP:8082
Default login is admin / admin β change this immediately:
filebrowser -r ~/recordings config set --username admin
filebrowser -r ~/recordings users update admin --password yournewpasswordRun File Browser as a systemd service (auto-starts on boot):
sudo nano /etc/systemd/system/filebrowser.service[Unit]
Description=File Browser
After=network.target
[Service]
Type=simple
User=youruser
ExecStart=/usr/local/bin/filebrowser -r /home/youruser/recordings -a 0.0.0.0 -p 8082
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable filebrowser
sudo systemctl start filebrowserπ‘ If you're using Tailscale, File Browser is only accessible on your Tailscale network β no need to expose port 8082 publicly.
# Recorder (Docker)
docker ps | grep irl-auto-recorder # Check running
docker logs -f irl-auto-recorder # Live logs
cd ~/irl-auto-recorder && docker compose restart # Restart
docker compose down && docker compose up -d # Full restart
# Auto-Discovery (systemd)
sudo systemctl status openirl-discovery # Check status
sudo systemctl restart openirl-discovery # Restart
sudo journalctl -u openirl-discovery -f # Live logs
# Auto-Cleanup (systemd)
sudo systemctl status openirl-cleanup # Check status
sudo systemctl restart openirl-cleanup # Restart
sudo journalctl -u openirl-cleanup -f # Live logs
# Disk
df -h / # Check disk space
du -sh ~/recordings # Total recording size
find ~/recordings -name "*.mkv" | wc -l # Count MKV filesdocker logs irl-auto-recorder
# If needed, rebuild:
cd ~/irl-auto-recorder && docker compose down && docker compose up -d --build- Confirm the stream ID is in
stream_ids.txt:cat ~/recordings/stream_ids.txt - Confirm the stream is active:
curl http://127.0.0.1:8080/stats/play_YOURSTREAMID - Check recorder logs:
docker logs --tail 50 irl-auto-recorder
- Check the service is running:
sudo systemctl status openirl-discovery - Check OpenIRL logs directly:
docker logs srtla-receiver | grep streamid - If no
streamid=entries appear in logs, auto-discovery won't trigger β add IDs manually tostream_ids.txtinstead
- Lower the cleanup threshold in the auto-cleanup installer (e.g. 75% instead of 85%)
- Or point recordings at a larger dedicated drive β see Recording Location
- Only
play_stream IDs are recorded β auto-discovery convertslive_βplay_automatically - MKV is used over MP4 for crash safety β completed segments are always intact even if the system loses power mid-recording
stream_ids.txtis the single source of truth β both manual entries and auto-discovered entries live here and can be mixed freely- The recorder Docker container and auto-discovery systemd service are independent β either can be restarted without affecting the other
Built on top of:
This is a personal project, built and maintained in my own time. It works well for my use case but comes with no guarantees. Updates will be infrequent β likely only when breaking changes occur in OpenIRL/srtla-receiver or significant new features are worth adding. Issues and pull requests are welcome but response times may vary.
This project is free and open. Do whatever you want with it.
You are free to use, copy, modify, merge, publish, distribute, and build upon this project β for personal or commercial purposes β with no restrictions and no requirement to credit the original author.
This software is provided as-is, with no warranty of any kind. The author is not responsible for any data loss, hardware issues, or other problems that may arise from its use. Use it at your own risk.