mirror of
git://f0xx.org/ac/ac-ms-media-transcode
synced 2026-07-29 04:59:13 +03:00
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>
This commit is contained in:
36
bin/fanout-copy.sh
Executable file
36
bin/fanout-copy.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
# Fan-out: read pre-encoded FLV from pipe → RTMP sinks (stream copy, no re-encode).
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
# shellcheck disable=SC1091
|
||||
source "${ROOT}/lib/common.sh"
|
||||
# shellcheck disable=SC1091
|
||||
source "${ROOT}/lib/outputs.sh"
|
||||
|
||||
require_cmd "${FFMPEG_BIN}"
|
||||
ensure_storage
|
||||
ensure_pipe
|
||||
|
||||
TEE_SPEC="$(build_fanout_tee_spec)"
|
||||
LOG_FILE="${STORAGE_DIR}/fanout.log"
|
||||
MAX_RETRIES="${FANOUT_RETRIES:-5}"
|
||||
attempt=0
|
||||
|
||||
log "fanout → ${#SINKS[@]} sink(s)"
|
||||
|
||||
while [[ "${attempt}" -le "${MAX_RETRIES}" ]]; do
|
||||
attempt=$((attempt + 1))
|
||||
log "fanout attempt ${attempt}/${MAX_RETRIES}"
|
||||
if "${FFMPEG_BIN}" -hide_banner -loglevel info \
|
||||
-thread_queue_size "${THREAD_QUEUE_SIZE}" \
|
||||
-i "${PIPE_PATH}" \
|
||||
-map 0 \
|
||||
-c copy \
|
||||
-f tee "${TEE_SPEC}" >> "${LOG_FILE}" 2>&1; then
|
||||
log "fanout finished normally"
|
||||
break
|
||||
fi
|
||||
warn "fanout ffmpeg exited — retrying after pipe flush"
|
||||
sleep 1
|
||||
done
|
||||
Reference in New Issue
Block a user