Simple PHP hackjob to automatically record live streams from Restreamer. It is copying the HLS output with FFmpeg when the Restreamer instance report type connected.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long. 6b321fc407 small facelift 7 months ago
.gitignore Added sleep to config 1 year ago
README Update 'README' 1 year ago
config.example.json added new parameters 1 year ago
record.php small facelift 7 months ago


With this utility it is possible to record live streams that is available through a Restreamer instance.
This monitors the Restreamer API to check if the local repeater is connected. When it is, it probes the
HLS endpoint and depending on the HTTP Code in the response it starts an FFmpeg process that copies the
HLS output OR RTMP stream to a specified location on the filesystem. Then it can be played back.
It is also possible to provide a "rewindable" live stream, but keep in mind that it will introduce big

To set this up, clone this repository and move or copy config.example.json to config.json, then edit it.
Then, run the following command to start monitoring and recording streams: php -q /path/to/record.php

Create a cronjob or systemd service to make it run on boot and handle potential failures/exits.
Example cronjob: * * * * * flock -n /tmp/hls-recorder-flock -c "php -q /path/to/record.php" &