summaryrefslogtreecommitdiff
path: root/roles/streaming/rtmp/streamer/templates/record.sh.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/streaming/rtmp/streamer/templates/record.sh.j2')
-rw-r--r--roles/streaming/rtmp/streamer/templates/record.sh.j29
1 files changed, 9 insertions, 0 deletions
diff --git a/roles/streaming/rtmp/streamer/templates/record.sh.j2 b/roles/streaming/rtmp/streamer/templates/record.sh.j2
new file mode 100644
index 00000000..159bf5e2
--- /dev/null
+++ b/roles/streaming/rtmp/streamer/templates/record.sh.j2
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+BASE_D="/srv/recordings"
+DAY=$(date '+%Y-%m-%d')
+TIME=$(date '+%H-%M-%S')
+
+umask 022
+mkdir -p "$BASE_D/$DAY"
+exec /usr/bin/ffmpeg -f live_flv -rtmp_live live -i "rtmp://127.0.0.1/{{ rtmp_streamer_app_name }}/{{ rtmp_streamer_recording_level }}" -c:a copy -c:v copy -f matroska "$BASE_D/$DAY/$DAY""_$TIME.mkv"