summaryrefslogtreecommitdiffstats
path: root/roles/stream/templates/restream.sh
blob: 81970c70da2bff0348d4fe50a758523774ce90dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# {{ ansible_managed }}
# echo $$ > /tmp/restream-{{ item[1].key }}.pid
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