summaryrefslogtreecommitdiffstats
path: root/roles/stream/templates/restream.sh
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-11-21 14:32:08 -0500
committerSacha Chua <sacha@sachachua.com>2022-11-21 14:32:08 -0500
commit4fe95f44f002a0399f8e31a93e9425edf40a9671 (patch)
tree1663b8ed53505d1d23d4e4b5a5d52c5b537000d2 /roles/stream/templates/restream.sh
parent4d1100b931a0d921883a66f857fd89999fb63a3e (diff)
downloademacsconf-ansible-4fe95f44f002a0399f8e31a93e9425edf40a9671.tar.xz
emacsconf-ansible-4fe95f44f002a0399f8e31a93e9425edf40a9671.zip
restreaming
Diffstat (limited to 'roles/stream/templates/restream.sh')
-rwxr-xr-xroles/stream/templates/restream.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/stream/templates/restream.sh b/roles/stream/templates/restream.sh
new file mode 100755
index 0000000..e1d0a7f
--- /dev/null
+++ b/roles/stream/templates/restream.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# {{ ansible_managed }}
+MOUNT={{ item[0].stream_url }}/{{ item[1].key }} # rtmp://..../stream_key
+LOGLEVEL="${LOGLEVEL:-24}"
+for i in 1 2 3 4 5; do
+ ffmpeg -re -loglevel $LOGLEVEL -i http://localhost:{{ icecast_port }}/{{ emacsconf_id }}/{{ item[1].source }} \
+ -cluster_size_limit 2M \
+ -cluster_time_limit 5100 \
+ -b:v 1M \
+ -crf 30 \
+ -g 125 \
+ -deadline re \
+ -threads 4 \
+ -vcodec libx264 \
+ -acodec libmp3lame \
+ -f flv $MOUNT
+ sleep 5 # in case of error
+done