mirror of
git://f0xx.org/ac/ac-ms-media-transcode
synced 2026-07-29 03:57:41 +03:00
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>
24 lines
696 B
Bash
Executable File
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}")"
|