#!/bin/sh
# Generate offline slate MP4 for MediaMTX alwaysAvailable
set -e
OUT_DIR="$(dirname "$0")/../slates"
OUT="$OUT_DIR/offline.mp4"
mkdir -p "$OUT_DIR"
docker run --rm -v "$OUT_DIR:/out" linuxserver/ffmpeg:latest \
  -f lavfi -i color=c=0x1a1a1a:s=1280x720:r=30 \
  -f lavfi -i sine=frequency=440:sample_rate=48000 \
  -t 30 -c:v libx264 -pix_fmt yuv420p -g 30 -preset fast \
  -c:a aac -b:a 128k -y /out/offline.mp4
echo "Created $OUT"
