summaryrefslogtreecommitdiffstats
path: root/roles/stream/templates/screen-fallback.sh
blob: 9d816ba0ca574ba199f43591dfb99e523f320fb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
# {{ ansible_managed }}

SCREEN_NAME=fallback-{{ mount }}
if screen -S $SCREEN_NAME -Q select ; then
    echo "Already running; screen -S $SCREEN_NAME -X quit   if you need to restart"
else
    echo {{ filename }} - {{ mount }}
    screen -dmS $SCREEN_NAME ffmpeg -r 20 -re -fflags +genpts -stream_loop -1 -i /usr/share/icecast2/web/{{ filename }} -map_metadata -1 -f webm -content_type video/webm -c:a copy -c:v copy icecast://{{ icecast_emacsconf_user }}:{{ icecast_emacsconf_password }}@localhost:8001/{{ mount }}
    echo "Started screen; connect with screen -x $SCREEN_NAME"
fi