diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-12-02 08:18:56 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-12-02 08:18:56 -0500 |
commit | 66ae0b351fe2709d583073496f3ff6812989cdd2 (patch) | |
tree | c70099fba7f9e38e6162f0dab4be0c780d65b861 /roles/stream | |
parent | 58a16c0d64ca9ba3bc8861fbaeb19d2630de04aa (diff) | |
download | emacsconf-ansible-66ae0b351fe2709d583073496f3ff6812989cdd2.tar.xz emacsconf-ansible-66ae0b351fe2709d583073496f3ff6812989cdd2.zip |
prerec updates
Diffstat (limited to '')
-rw-r--r-- | roles/stream/tasks/main.yml | 2 | ||||
-rwxr-xr-x | roles/stream/templates/restream.sh | 22 |
2 files changed, 18 insertions, 6 deletions
diff --git a/roles/stream/tasks/main.yml b/roles/stream/tasks/main.yml index 6a53df1..d821d5e 100644 --- a/roles/stream/tasks/main.yml +++ b/roles/stream/tasks/main.yml @@ -28,7 +28,7 @@ dest: /etc/init.d/emacsconf mode: 0755 - name: Set up nginx config - tags: wip, stream-nginx + tags: stream-nginx become: true template: src: emacsconf.nginx.conf diff --git a/roles/stream/templates/restream.sh b/roles/stream/templates/restream.sh index 81970c7..4577cde 100755 --- a/roles/stream/templates/restream.sh +++ b/roles/stream/templates/restream.sh @@ -3,17 +3,29 @@ # 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 \ +while true; do + ffmpeg -re -loglevel $LOGLEVEL \ + -reconnect_at_eof 1 \ + -reconnect_streamed 1 \ + -fflags +genpts -i http://localhost:{{ icecast_port }}/{{ 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 \ + -preset:v ultrafast \ + -tune zerolatency \ + -maxrate:v 256k \ + -bufsize:v 512k \ + -acodec libmp3lame \ + -ac 2 \ + -b:a 96k \ + -preset:a ultrafast \ + -maxrate:a 96k \ + -bufsize:a 192k \ + -tune zerolatency \ -f flv $MOUNT sleep 5 # in case of error done |