Files
ac-ms-media-transcode/bin/run-encode-only.sh
Anton Afanasyeu 5ca8a9f539 Add lab restream pipeline with pirate_drift logo and lib/env.sh.
Encode-once/fanout scripts, HLS output, and single overloadable env source.
Commits assets/pirate_drift.png as default watermark for cluster runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 15:27:24 +02:00

24 lines
696 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck disable=SC1091
source "${ROOT}/lib/common.sh"
SRC_ARG="${1:-1}"
PID_ENCODE="${RUN_DIR}/encode.pid"
LOG_RUN="${STORAGE_DIR}/run-encode-only.log"
ensure_storage
mkdir -p "${RUN_DIR}"
if [[ -f "${PID_ENCODE}" ]] && kill -0 "$(cat "${PID_ENCODE}")" 2>/dev/null; then
die "encode-only already running (pid $(cat "${PID_ENCODE}")). use bin/stop.sh first"
fi
chmod +x "${ROOT}/bin/"*.sh 2>/dev/null || true
log "starting encode-only source=${SRC_ARG}"
nohup "${ROOT}/bin/encode-only.sh" "${SRC_ARG}" >> "${LOG_RUN}" 2>&1 &
echo $! > "${PID_ENCODE}"
log "encode pid $(cat "${PID_ENCODE}")"