diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-11-05 08:02:44 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-11-05 08:02:44 -0400 |
commit | 5bf4ab50e13a9be2923ddebe69525b40df8ab3bc (patch) | |
tree | c06ff0086d94135871e30981fa80a9112f990cf4 /roles/caption/templates | |
parent | 5f83a3fbeb91dea9c77925e83b09b27427435cb9 (diff) | |
download | emacsconf-ansible-5bf4ab50e13a9be2923ddebe69525b40df8ab3bc.tar.xz emacsconf-ansible-5bf4ab50e13a9be2923ddebe69525b40df8ab3bc.zip |
Separate caption and prerec roles
Diffstat (limited to 'roles/caption/templates')
-rwxr-xr-x | roles/caption/templates/process-prerec.sh | 18 | ||||
-rwxr-xr-x | roles/caption/templates/reencode.sh | 43 | ||||
-rwxr-xr-x | roles/caption/templates/run-aeneas.sh | 14 | ||||
-rwxr-xr-x | roles/caption/templates/update-task-status.sh | 10 | ||||
-rwxr-xr-x | roles/caption/templates/upload.sh | 6 |
5 files changed, 0 insertions, 91 deletions
diff --git a/roles/caption/templates/process-prerec.sh b/roles/caption/templates/process-prerec.sh deleted file mode 100755 index e49aa72..0000000 --- a/roles/caption/templates/process-prerec.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# {{ ansible_managed }} - -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/') -SCREEN=reencode-$SLUG -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" -#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 && 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 -x $SCREEN diff --git a/roles/caption/templates/reencode.sh b/roles/caption/templates/reencode.sh deleted file mode 100755 index e3a82eb..0000000 --- a/roles/caption/templates/reencode.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# Defaults -q=32 -cpu=4 -time_limit="" -print_only=false - -while getopts :q:c:t:s OPT; do - case $OPT in - q|+q) - q="$OPTARG" - ;; - c|+c) - cpu="$OPTARG" - ;; - t|+t) - time_limit="-to $OPTARG" - ;; - s) - print_only=true - ;; - *) - echo "usage: `basename $0` [+-q ARG] [+-c ARG} [--] ARGS..." - exit 2 - esac -done -shift `expr $OPTIND - 1` -OPTIND=1 - -command="$(cat<<EOF -ffmpeg -y -i "$1" $time_limit -c:v libvpx-vp9 -b:v 0 -crf $q -an -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu -g 240 -pass 1 -f webm -threads $cpu /dev/null && - ffmpeg -y -i "$1" $time_limit -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 -g 240 -threads $cpu "$2" -EOF -)" - -if [ $print_only == true ]; then - echo "$command" -else - eval "$command" -fi diff --git a/roles/caption/templates/run-aeneas.sh b/roles/caption/templates/run-aeneas.sh deleted file mode 100755 index 6f40134..0000000 --- a/roles/caption/templates/run-aeneas.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/bash -# -# {{ ansible_managed }} -# -AUDIO=$(ls *.opus *.ogg | head -n1) -BASE=$(echo $AUDIO | perl -pe 's/^(emacsconf-2022-.*?--.*?--.*?)--.*/$1/') -echo $AUDIO -echo $BASE -if [ ! -f $BASE--whisper.vtt ]; then - cp ${BASE}--main.vtt ${BASE}--whisper.vtt -fi -python3 -m aeneas.tools.execute_task $AUDIO *.txt "task_language=eng|os_task_file_format=vtt|is_text_type=plain" ${BASE}--aeneas.vtt -cp ${BASE}--aeneas.vtt ${BASE}--main.vtt -/data/emacsconf/2022/scripts/upload.sh ${BASE}--main.vtt diff --git a/roles/caption/templates/update-task-status.sh b/roles/caption/templates/update-task-status.sh deleted file mode 100755 index 18b7c1b..0000000 --- a/roles/caption/templates/update-task-status.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# {{ ansible_managed }} -SLUG="$1" -FROM_STATUS="$2" -TO_STATUS="$3" -cd ~/emacsconf-2022-private -git pull -emacsclient --eval "(progn (emacsconf-update-talk-status \"$SLUG\" \"$FROM_STATUS\" \"$TO_STATUS\") (emacsconf-with-talk-heading \"$SLUG\" (emacsconf-cache-video-data (emacsconf-get-talk-info-for-subtree)) (save-buffer)))" -git commit -m "Update task status for $SLUG" conf.org -git push diff --git a/roles/caption/templates/upload.sh b/roles/caption/templates/upload.sh deleted file mode 100755 index f723d29..0000000 --- a/roles/caption/templates/upload.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -# {{ ansible_managed }} - -scp $* orga@media.emacsconf.org:~/backstage -emacsclient --eval "(emacsconf-publish-backstage-index)" -rsync -avze ssh orga@media.emacsconf.org:~/backstage/ /data/emacsconf/cache/ |