Rationale: Oracle cannot reach NAS (Tailscale userspace mode on NAS, no TUN), the old pull+webhook design requires Edge to download video from NAS and callback to NAS - both blocked. New design is one-way NAS -> Oracle: - FAM-Edge: new POST /api/edge/video/push endpoint accepts multipart video upload, reuses existing OpenCV scene-change keyframe selection, analyzes synchronously and returns the result payload directly in the HTTP response (no webhook callback). Old /api/edge/video/analyze kept for compatibility. - FAM-Edge: VideoPreprocessor.save_upload() saves the uploaded file - FAM-Edge: AIOrchestrator.process_push_task() runs the full pipeline (health check -> extract -> select -> compress -> VLM -> fusion) and returns callback-style payload dict - FAM-Core: Dispatcher rewritten to push mode - reads local video file, uploads with task metadata (camera_name, event_start_time from file mtime, known_members_context), applies the result to DB via shared event_receiver.apply_success_event() - FAM-Core: event_receiver success logic extracted into reusable apply_success_event() (used by both webhook route and dispatcher) - config: edge_url -> /api/edge/video/push, push_timeout 1800s, gunicorn Edge timeout raised to 1800s for long synchronous analysis
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
# FAM-Core 配置文件 (NAS 端) - 实际部署配置
|
||
# 注: Tailscale 防火墙待修复,当前 edge_url 使用 Oracle 公网 IP
|
||
# 推送模式: NAS 上传视频到 Edge /api/edge/video/push,结果同步随响应返回,
|
||
# 无需 Oracle 反向访问 NAS(webhook/Video-Server 拉取均不再使用)
|
||
# Ollama 未对外暴露,chat_handler 通过 FAM-Edge 代理
|
||
|
||
server:
|
||
host: "0.0.0.0"
|
||
port: 8000
|
||
|
||
database:
|
||
host: "127.0.0.1"
|
||
port: 3306
|
||
user: "root"
|
||
password: "iLoveJava5!"
|
||
database: "sentinel_home_ai"
|
||
unix_socket: "/run/mysqld/mysqld10.sock"
|
||
|
||
scheduler:
|
||
scan_interval: 60
|
||
video_dir: "/volume1/surveillance"
|
||
video_extensions: [".mp4", ".mkv", ".avi"]
|
||
file_stable_seconds: 60
|
||
camera_name: "客厅"
|
||
|
||
dispatcher:
|
||
poll_interval: 30
|
||
edge_url: "http://129.146.203.203:5000/api/edge/video/push"
|
||
max_retries: 3
|
||
push_timeout: 1800
|
||
|
||
video_server:
|
||
base_url: "http://127.0.0.1:8000/media"
|
||
token: "sentinel-media-2026"
|
||
video_dir: "/volume1/surveillance"
|
||
|
||
chat_handler:
|
||
ollama_url: "http://129.146.203.203:5000/api/edge/chat"
|
||
model_name: "llava-phi3"
|
||
timeout: 120
|