From 16cbdc124d448afd1264fa37b12bd8f0f1841fd8 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 26 Nov 2025 14:45:30 -0500 Subject: updates --- roles/live/tasks/main.yml | 12 ++++++++++-- roles/obs/tasks/main.yml | 17 ++++++++++------- roles/obs/templates/intro | 8 +++++--- roles/prerec/templates/Makefile | 2 +- roles/prerec/templates/process-prerec.sh | 7 ++++--- roles/prerec/templates/reencode.sh | 6 +++++- roles/prerec/templates/upload.sh | 2 +- 7 files changed, 36 insertions(+), 18 deletions(-) (limited to 'roles') diff --git a/roles/live/tasks/main.yml b/roles/live/tasks/main.yml index 8ff5903..f49b2fd 100644 --- a/roles/live/tasks/main.yml +++ b/roles/live/tasks/main.yml @@ -1,6 +1,6 @@ - name: Create the directory for this year file: - path: /var/www/live.emacsconf.org/{{ item }} + path: /var/www/{{ emacsconf_live_domain }}/{{ item }} owner: "{{ emacsconf_user }}" group: "{{ emacsconf_user }}" state: directory @@ -10,8 +10,16 @@ - name: Set up nginx.conf template: src: live.emacsconf.org.conf - dest: /etc/nginx/sites-available/live.emacsconf.org + dest: /etc/nginx/sites-available/{{ emacsconf_live_domain }} - name: Reload nginx service: name: nginx state: reloaded +- name: Static files + tags: static + template: + src: "{{ item }}" + dest: "/var/www/{{ emacsconf_live_domain }}/{{ item }}" + loop: + - emacsconf-tampermonkey-bbb.js + - emacsconf-tampermonkey-irc.js diff --git a/roles/obs/tasks/main.yml b/roles/obs/tasks/main.yml index 5df7d56..95f12b6 100644 --- a/roles/obs/tasks/main.yml +++ b/roles/obs/tasks/main.yml @@ -47,6 +47,16 @@ template: src: xorg.conf dest: /etc/X11/xorg.conf +- name: Create directories + file: + owner: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" + path: "{{ item }}" + state: directory + mode: 0775 + loop: + - "{{ emacsconf_asset_dir }}" + - "{{ emacsconf_asset_dir }}/stream" - name: Set up MPV and MPVC tags: mpv include_tasks: mpv.yml @@ -105,13 +115,6 @@ nopassword: true with_items: - "{{ emacsconf_tracks }}" -- name: Create directories - file: - owner: "{{ emacsconf_user }}" - group: "{{ emacsconf_group }}" - path: "{{ emacsconf_asset_dir }}" - state: directory - mode: 0775 - name: Set up scripts tags: wip, obs-scripts template: diff --git a/roles/obs/templates/intro b/roles/obs/templates/intro index 7af9c4c..9bf1161 100755 --- a/roles/obs/templates/intro +++ b/roles/obs/templates/intro @@ -8,7 +8,7 @@ fi SLUG=$1 FILE=$1 if [[ ! -f $FILE ]]; then - LIST=({{ emacsconf_caption_dir }}/cache/emacsconf-{{ emacsconf_year }}-$FILE--*.webm) + LIST=({{ emacsconf_caption_dir }}/cache/emacsconf-{{ emacsconf_year }}-$FILE--*--intro.webm) FILE="${LIST[0]}" BY_SLUG=1 else @@ -17,7 +17,9 @@ fi shift overlay $SLUG if [[ -f "$FILE" ]]; then - mpv "$FILE" + echo "Playing $FILE" + mpv "$FILE" else - firefox {{ emacsconf_caption_dir }}/assets/in-between/$SLUG.png + echo "Opening backup image {{ emacsconf_caption_dir }}/assets/in-between/$SLUG.png" + firefox {{ emacsconf_caption_dir }}/assets/in-between/$SLUG.png fi diff --git a/roles/prerec/templates/Makefile b/roles/prerec/templates/Makefile index d841cda..f58c5d6 100644 --- a/roles/prerec/templates/Makefile +++ b/roles/prerec/templates/Makefile @@ -67,7 +67,7 @@ emacsconf-%--main.opus: emacsconf-%--main.webm ffmpeg -y -i "$<" -c:a copy "$@" emacsconf-%--reencoded.vtt: emacsconf-%--reencoded.opus - whisperx --model large-v3 --align_model WAV2VEC2_ASR_LARGE_LV60K_960H --compute_type int8 --print_progress True --max_line_width 50 --segment_resolution chunk --max_line_count 1 --language en "$<" + whisperx --model large-v3 --align_model WAV2VEC2_ASR_LARGE_LV60K_960H --compute_type int8 --print_progress True --max_line_width 50 --segment_resolution chunk --max_line_count 1 --language en --initial_prompt "Transcribe this talk about Emacs. It may mention Emacs keywords such as Org Mode, Org Roam, Magit, gptel, or chatgpt-shell, or tech keywords such as LLMs. Format function names and keyboard shortcut sequences according to Emacs conventions using Markdown syntax. For example: control h becomes \`C-h\`." "$<" emacsconf-%--backstage--silences.csv: emacsconf-%--reencoded.opus ffmpeg -i "$<" -af silencedetect=noise=-30dB:d=0.5 -f null - 2>&1 | awk '/silence_start/ {start=$$NF} /silence_end/ {print start "," (start + $$NF)}' > "$@" diff --git a/roles/prerec/templates/process-prerec.sh b/roles/prerec/templates/process-prerec.sh index d0f5fa7..4347576 100755 --- a/roles/prerec/templates/process-prerec.sh +++ b/roles/prerec/templates/process-prerec.sh @@ -5,10 +5,11 @@ ORIGINAL=$1 REENCODED=$(echo "$ORIGINAL" | perl -pe 's/^(emacsconf-[0-9]*-.*?--.*?--.*?--).*/$1reencoded.webm/') SLUG=$(echo "$ORIGINAL" | perl -ne '/^emacsconf-[0-9]*-(.*?)--/ && print $1') MAIN=$(echo "$ORIGINAL" | perl -pe 's/^(emacsconf-[0-9]*-.*?--.*?--.*?--).*/$1main.webm/') -VTT=$(echo "$ORIGINAL" | perl -pe 's/^(emacsconf-[0-9]*-.*?--.*?--.*?--).*/$1main.vtt/') +VTT=$(echo "$ORIGINAL" | perl -pe 's/^(emacsconf-[0-9]*-.*?--.*?--.*?--).*/$1reencoded.vtt/') # ( cd /data/emacsconf/cache; ./update-cache ) # /data/emacsconf/admin/{{ emacsconf_year }}/scripts/talk $SLUG "WAITING_FOR_PREREC" "PROCESSING" if [[ ! -f "$REENCODED" ]]; then - screen -dmS reencode-$SLUG /bin/bash -c "reencode.sh \"$ORIGINAL\" \"$REENCODED\" && upload.sh $REENCODED $MAIN && thumbnail.sh \"$MAIN\" && upload.sh $(echo "$MAIN" | sed s/webm$/png/); echo $(date -Iminutes) $SLUG reencoded >> ~/emacsconf.log && exec /bin/bash" & + screen -dmS reencode-$SLUG /bin/bash -c "reencode.sh \"$ORIGINAL\" \"$REENCODED\" && make $MAIN && upload.sh $REENCODED $MAIN && thumbnail.sh \"$MAIN\" && upload.sh $(echo "$MAIN" | sed s/webm$/png/); echo $(date -Iminutes) $SLUG reencoded >> ~/emacsconf.log && make $VTT; echo $(date -Iminutes) $SLUG captioned >> ~/emacsconf.log; exec /bin/bash" & +else + screen -dmS captions-$SLUG /bin/bash -c "make $VTT; echo $(date -Iminutes) $SLUG captioned >> ~/emacsconf.log; exec /bin/bash" fi -screen -dmS captions-$SLUG /bin/bash -c "make $VTT; echo $(date -Iminutes) $SLUG captioned >> ~/emacsconf.log; exec /bin/bash" diff --git a/roles/prerec/templates/reencode.sh b/roles/prerec/templates/reencode.sh index 665fee2..ac5309a 100755 --- a/roles/prerec/templates/reencode.sh +++ b/roles/prerec/templates/reencode.sh @@ -10,6 +10,9 @@ print_only=false limit_resolution={{ res_y }} limit_fps={{ fps }} +output_final="${2:-$(echo $input | sed 's/--original.*/--reencoded.webm/')}" +output_temp="partial--${output_final}" # <-- New temporary name + while getopts :q:c:t:s OPT; do case $OPT in q|+q) @@ -47,7 +50,7 @@ ffmpeg -y -i "$input" $time_limit \ fps='$limit_fps'" \ -c:v libvpx-vp9 -b:v 0 -crf $q -c:a libopus \ -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu \ - -pass 2 -threads $cpu -- "$output" + -pass 2 -threads $cpu -- "$output_temp" EOF )" @@ -55,4 +58,5 @@ if [ $print_only == true ]; then echo "$command" else eval "$command" + mv "$output_temp" "$output_final" fi diff --git a/roles/prerec/templates/upload.sh b/roles/prerec/templates/upload.sh index 09d55d9..03cc66a 100755 --- a/roles/prerec/templates/upload.sh +++ b/roles/prerec/templates/upload.sh @@ -2,5 +2,5 @@ # {{ ansible_managed }} scp $* orga@media.emacsconf.org:~/backstage -/usr/local/bin/publish-backstage-index.sh +# /usr/local/bin/publish-backstage-index.sh rsync -avze ssh orga@media.emacsconf.org:~/backstage/ /data/emacsconf/shared/{{ emacsconf_year }}/cache/ -- cgit v1.2.3