diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-10-29 07:33:39 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-10-29 07:33:39 -0400 |
commit | a6a373410bde6918f27992ff967660c0541f810a (patch) | |
tree | ab8fbd6a5e12f065a7af82027b98df818dfb9603 /roles/stream/tasks | |
parent | bff9ceae7f42723f939f620f9ef9faebca966742 (diff) | |
download | emacsconf-ansible-a6a373410bde6918f27992ff967660c0541f810a.tar.xz emacsconf-ansible-a6a373410bde6918f27992ff967660c0541f810a.zip |
media, wiki-publish, caption updates
* common-playbook.yml: Start moving publishing setup to res
* group_vars/all.yml: New common variables.
* inventory.yml (prod): Number of threads, new hosts
* roles/caption/templates/process-captions.py: Add mp4, try to figure
out why script was failing, simplify
* roles/media/tasks/main.yml: New role for setting up
media.emacsconf.org for this year
* roles/prerec/templates/reencode.sh: Keep a copy of zaeph's script
* roles/stream/defaults/main.yml: Add more variables
* roles/stream: Restreaming lowres
* roles/wiki-publish/tasks/emacs.yml: Build Emacs from source
Diffstat (limited to 'roles/stream/tasks')
-rw-r--r-- | roles/stream/tasks/main.yml | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/roles/stream/tasks/main.yml b/roles/stream/tasks/main.yml index 7cabb6b..76febe0 100644 --- a/roles/stream/tasks/main.yml +++ b/roles/stream/tasks/main.yml @@ -8,6 +8,33 @@ template: src: icecast.xml dest: /etc/icecast2/icecast-emacsconf.xml +- name: Create restream dir + file: + path: "{{ icecast_restream_dir }}" + owner: "{{ icecast_user }}" + state: directory +- name: Debug + debug: + var: item.id + loop: "{{ emacsconf_tracks }}" +- name: Copy the lowres restreaming shell script + template: + src: lowres.sh + dest: /usr/local/bin/{{ emacsconf_id }}-lowres-{{ item.id }}.sh + mode: 0755 + loop: "{{ emacsconf_tracks }}" +- name: Copy lowres on-connect + template: + src: on-connect + dest: /usr/local/bin/{{ emacsconf_id }}-lowres-{{ item.id }}-on-connect + mode: 0755 + loop: "{{ emacsconf_tracks }}" +- name: Copy lowres on-disconnect + template: + src: on-disconnect + dest: /usr/local/bin/{{ emacsconf_id }}-lowres-{{ item.id }}-on-disconnect + mode: 0755 + loop: "{{ emacsconf_tracks }}" - name: Set up init file become: true template: @@ -22,36 +49,21 @@ mode: 0644 - name: Enable icecast become: true - sysvinit: + service: name: emacsconf - enabled: yes state: started + enabled: yes - name: Check if icecast is listening wait_for: port: "{{ icecast_port }}" delay: 5 - timeout: 10 + timeout: 20 msg: "Timeout waiting for {{ icecast_port }} to respond" register: port_check ignore_errors: yes - name: Try to restart icecast if not started service: name=emacsconf state=started enabled=yes when: port_check.failed == true -- name: Test by streaming from a file - tags: test-stream-file, never - block: - - debug: - msg: ffmpeg -loglevel 32 -re -i {{ icecast_test }} -loop 1 -f webm -r 30 -ac 2 -cluster_size_limit 2M -cluster_time_limit 5100 -content_type video/webm -c:v libvpx -b:v 1M -crf 30 -g 125 -threads 4 -deadline realtime icecast://emacsconf:{{ icecast_emacsconf_password }}@live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm - - local_action: shell ffmpeg -re -loglevel 32 -i {{ icecast_test }} -loop 1 -f webm -r 30 -ac 2 -cluster_size_limit 2M -cluster_time_limit 5100 -content_type video/webm -c:v libvpx -b:v 1M -crf 30 -g 125 -threads 4 -deadline realtime icecast://emacsconf:{{ icecast_emacsconf_password }}@live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm - when: icecast_test is defined -- name: Test by displaying the stream in mpv - tags: test-stream-mpv, never - local_action: shell mpv http://live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm - when: test is defined and test == 'mpv' -- name: Test by streaming a test pattern - tags: test-stream-pattern - local_action: shell ffmpeg -loglevel 32 -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 -f webm icecast://emacsconf:{{ icecast_emacsconf_password }}@live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm - when: test is defined and test == 'pattern' # - name: Set up restream script # template: # src: restream-yt.sh |