From 55b95331f38663b347bbae3fd411d0fe8a845851 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Thu, 23 Jan 2025 08:57:37 -0500 Subject: add reencode-in-screen.sh --- roles/prerec/templates/reencode-in-screen.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 roles/prerec/templates/reencode-in-screen.sh (limited to 'roles/prerec/templates/reencode-in-screen.sh') diff --git a/roles/prerec/templates/reencode-in-screen.sh b/roles/prerec/templates/reencode-in-screen.sh new file mode 100755 index 0000000..5c12203 --- /dev/null +++ b/roles/prerec/templates/reencode-in-screen.sh @@ -0,0 +1,16 @@ +#!/bin/bash +ORIGINAL=$1 +BASE="${ORIGINAL%--original.*}" +REENCODED="${BASE}--reencoded.webm" +SLUG=$(echo "$ORIGINAL" | perl -ne '/^emacsconf-[0-9]*-(.*?)--/ && print $1') +LOCK=".lock-$SLUG" + +if [ ! -f "$REENCODED" ]; then + if [ -f "$LOCK" ]; then + echo "$LOCK already exists, waiting for it" + else + touch "$LOCK" + screen -dmS reencode-$SLUG /bin/bash -c "reencode.sh \"$ORIGINAL\" \"$REENCODED\" && thumbnail.sh \"$MAIN\" && rm \"$LOCK\"" + echo "Processing $REENCODED in reencode-$SLUG" + fi +fi -- cgit v1.2.3