#!/bin/bash
# 推流到 Cloudflare Stream

RTSP_SOURCE="rtsp://localhost:8554/camera1"
CLOUDFLARE_URL="rtmps://live.cloudflare.com:443/live/0a37e82197ac851a92dc5451dfe78485kb51e49994b6fd9e56b6f1fdfcd339fe6"

echo "开始推流到 Cloudflare Stream..."
echo "源: $RTSP_SOURCE"
echo "按 Ctrl+C 停止推流"
echo ""

ffmpeg -i "$RTSP_SOURCE" \
  -c:v copy \
  -c:a aac \
  -f flv \
  "$CLOUDFLARE_URL"
