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 | |
parent | 58a16c0d64ca9ba3bc8861fbaeb19d2630de04aa (diff) | |
download | emacsconf-ansible-66ae0b351fe2709d583073496f3ff6812989cdd2.tar.xz emacsconf-ansible-66ae0b351fe2709d583073496f3ff6812989cdd2.zip |
prerec updates
-rw-r--r-- | README.org | 3 | ||||
-rw-r--r-- | group_vars/all.yml | 1 | ||||
-rw-r--r-- | roles/prerec/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/prerec/tasks/main.yml | 11 | ||||
-rwxr-xr-x | roles/prerec/templates/process-prerec.sh | 4 | ||||
-rwxr-xr-x | roles/prerec/templates/reencode.sh | 8 | ||||
-rwxr-xr-x | roles/prerec/templates/talk (renamed from roles/prerec/templates/update-task-status.sh) | 14 | ||||
-rw-r--r-- | roles/publish/tasks/main.yml | 2 | ||||
-rw-r--r-- | roles/stream/tasks/main.yml | 2 | ||||
-rwxr-xr-x | roles/stream/templates/restream.sh | 22 |
10 files changed, 43 insertions, 26 deletions
@@ -58,6 +58,9 @@ git remote add docker ssh://ikiwiki@127.0.0.1:2222/var/www/wiki.git Debugging ssh wiki 'cd /var/www/wiki.git; git update-ref refs/heads/master HEAD^' && git push docker 2022-pages +* Processing prerecs + +ansible-playbook -i inventory.yml prod-playbook.yml --tags prerec * Publishing diff --git a/group_vars/all.yml b/group_vars/all.yml index cd9c38e..151cb6f 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -1,6 +1,7 @@ docker: false res_x: 1280 res_y: 720 +fps: 30 emacsconf_year: 2022 emacsconf_name: EmacsConf emacsconf_id: emacsconf diff --git a/roles/prerec/defaults/main.yml b/roles/prerec/defaults/main.yml new file mode 100644 index 0000000..3668655 --- /dev/null +++ b/roles/prerec/defaults/main.yml @@ -0,0 +1,2 @@ +reencode_quality: 32 +reencode_cpu: 4 diff --git a/roles/prerec/tasks/main.yml b/roles/prerec/tasks/main.yml index 954c5a7..e44617d 100644 --- a/roles/prerec/tasks/main.yml +++ b/roles/prerec/tasks/main.yml @@ -24,22 +24,21 @@ dest: "{{ emacsconf_caption_dir }}/scripts/reencode.sh" owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" - # This avoids overwriting zaeph's - force: no + backup: yes mode: 0775 - name: Copy scripts for processing - tags: process-prerec + tags: process-prerec, wip template: src: "{{ item }}" - dest: "{{ emacsconf_caption_dir }}/scripts/{{ item }}" + dest: "/usr/local/bin/{{ item }}" owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" mode: 0775 loop: - process-prerec.sh - - update-task-status.sh + - talk - upload.sh - publish-backstage-index.sh - update-emacsconf.sh - thumbnail.sh - + - reencode.sh diff --git a/roles/prerec/templates/process-prerec.sh b/roles/prerec/templates/process-prerec.sh index 8fdca72..4544b43 100755 --- a/roles/prerec/templates/process-prerec.sh +++ b/roles/prerec/templates/process-prerec.sh @@ -10,9 +10,9 @@ if ! ( screen -ls | grep -q $SLUG ); then screen -dmS $SCREEN fi ( cd /data/emacsconf/cache; ./update-cache ) -# /data/emacsconf/2022/scripts/update-task-status.sh $SLUG "WAITING_FOR_PREREC" "PROCESSING" +# /data/emacsconf/2022/scripts/talk $SLUG "WAITING_FOR_PREREC" "PROCESSING" #if [[ ! -f "$REENCODED" ]]; then screen -S $SCREEN -X screen -t reencode-$SLUG /bin/bash -c "/data/emacsconf/2022/scripts/reencode.sh \"$ORIGINAL\" \"$REENCODED\" && /data/emacsconf/2022/scripts/upload.sh $REENCODED $MAIN && /data/emacsconf/2022/scripts/thumbnail.sh \"$MAIN\" && /data/emacsconf/2022/scripts/upload.sh $(echo "$MAIN" | sed s/webm$/png/) exec /bin/bash" & #fi -screen -S $SCREEN -X screen -t captions-$SLUG /bin/bash -c "/data/emacsconf/2022/scripts/process-captions.py $(dirname $ORIGINAL); /data/emacsconf/2022/scripts/update-task-status.sh $SLUG PROCESSING TO_ASSIGN; exec /bin/bash" +screen -S $SCREEN -X screen -t captions-$SLUG /bin/bash -c "/data/emacsconf/2022/scripts/process-captions.py $(dirname $ORIGINAL); exec /bin/bash" screen -x $SCREEN diff --git a/roles/prerec/templates/reencode.sh b/roles/prerec/templates/reencode.sh index 63be1d0..b0bdfc7 100755 --- a/roles/prerec/templates/reencode.sh +++ b/roles/prerec/templates/reencode.sh @@ -3,12 +3,12 @@ set -euo pipefail # Defaults -q=32 -cpu=4 +q={{ reencode_quality }} +cpu={{ reencode_cpu }} time_limit="" print_only=false -limit_resolution=1080 -limit_fps=30 +limit_resolution={{ res_y }} +limit_fps={{ fps }} while getopts :q:c:t:s OPT; do case $OPT in diff --git a/roles/prerec/templates/update-task-status.sh b/roles/prerec/templates/talk index b3f59d2..0531cda 100755 --- a/roles/prerec/templates/update-task-status.sh +++ b/roles/prerec/templates/talk @@ -1,7 +1,7 @@ #!/bin/bash # {{ ansible_managed }} -# How to use: update-task-status.sh slug from-status-regexp to-status -# or update-task-status.sh slug to-status +# How to use: talk slug from-status-regexp to-status +# or talk slug to-status SLUG="$1" FROM_STATUS="$2" @@ -11,11 +11,11 @@ if [ "x$TO_STATUS" == "x" ]; then TO_STATUS="$2" fi cd {{ emacsconf_private_dir }} -echo "Pulling conf.org..." -git pull +#echo "Pulling conf.org..." +#git pull echo "Updating status..." emacsclient --eval "(emacsconf-with-todo-hooks (emacsconf-update-talk-status \"$SLUG\" \"$FROM_STATUS\" \"$TO_STATUS\"))" -a emacs -echo "Committing and pushing in the background" -git commit -m "Update task status for $SLUG from $FROM_STATUS to $TO_STATUS" conf.org -git push & +#echo "Committing and pushing in the background" +#git commit -m "Update task status for $SLUG from $FROM_STATUS to $TO_STATUS" conf.org +#git push & diff --git a/roles/publish/tasks/main.yml b/roles/publish/tasks/main.yml index c09cae2..064f40f 100644 --- a/roles/publish/tasks/main.yml +++ b/roles/publish/tasks/main.yml @@ -56,7 +56,7 @@ create: yes - name: Set up or update repositories become_user: "{{ emacsconf_user }}" - tags: publish, wip + tags: publish block: - name: Set up compile-media git: 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 |