{
  "system": {
    "project_name": "SmartCCTV_Analytics",
    "version": "1.1.0",
    "log_level": "INFO",
    "shm_buffer_dir": "/dev/shm/smart_cctv_buffers"
  },
  "ingestion": {
    "hw_decoder": "cuda",
    "rtsp_transport": "tcp",
    "reconnect_interval_sec": 5,
    "buffer_pre_event_sec": 10,
    "buffer_post_event_sec": 10
  },
  "ai_engine": {
    "precision": "FP16",
    "device_id": 0,
    "multi_rate_sampling": {
      "fast_tier": {
        "fps": 30,
        "scenarios": [
          "fall_detection",
          "fight_detection"
        ]
      },
      "normal_tier": {
        "fps": 15,
        "scenarios": [
          "loitering",
          "intrusion"
        ]
      },
      "slow_tier": {
        "fps": 5,
        "scenarios": [
          "crowd_density",
          "fire_smoke"
        ]
      }
    }
  },
  "tracker": {
    "type": "bytetrack",
    "track_thresh": 0.5,
    "track_buffer": 30,
    "match_thresh": 0.8
  },
  "private_key": {
    "strategy": "composite_timestamp",
    "format_template": "{site_code}_CAM{camera_id}_{timestamp_ms}_{frame_seq}",
    "site_code": "SITE_A1",
    "camera_id_digits": 2,
    "frame_seq_digits": 5,
    "timestamp_unit": "ms"
  },
  "ntp": {
    "enabled": true,
    "server": "pool.ntp.org",
    "max_offset_ms": 50
  },
  "scenarios": {
    "cooldown_sec": 15,
    "enabled_scenarios": [
      "crowd_density",
      "fire_smoke",
      "loitering",
      "intrusion",
      "fall_detection",
      "fight_detection"
    ]
  },
  "metadata": {
    "database": {
      "enabled": true,
      "host": "localhost",
      "port": 5432,
      "name": "smart_cctv_analytics",
      "user": "cctv_writer",
      "password_env": "CCTV_DB_PASSWORD",
      "pool_size": 10,
      "max_overflow": 5,
      "auto_create_tables": true
    },
    "frame_insertion": {
      "enabled": true,
      "flush_interval_ms": 100,
      "batch_size": 50
    },
    "detection_insertion": {
      "enabled": true,
      "flush_interval_ms": 100,
      "batch_size": 50
    },
    "event_insertion": {
      "enabled": true,
      "flush_interval_ms": 10
    }
  },
  "active_learning": {
    "enabled": false,
    "raw_frames": {
      "enabled": false,
      "format": "jpeg",
      "quality": 85,
      "storage_path": "/opt/contextra/data/active-learning/raw_frames/",
      "retention_days": 30,
      "filter_mode": "all",
      "confidence_min": 0.3
    },
    "crop_objects": {
      "enabled": false,
      "storage_path": "/opt/contextra/data/active-learning/crop_objects/",
      "retention_days": 30
    },
    "metadata_json": {
      "enabled": false,
      "storage_path": "/opt/contextra/data/active-learning/metadata_json/",
      "format": "json"
    },
    "annotations": {
      "enabled": false,
      "storage_path": "/opt/contextra/data/active-learning/annotations/",
      "label_format": "coco"
    },
    "labeled": {
      "enabled": false,
      "storage_path": "/opt/contextra/data/active-learning/labeled/"
    }
  },
  "output": {
    "export_json": false,
    "json_output_dir": "/data/metadata/",
    "export_video": false,
    "video_output_dir": "/data/videos/",
    "export_snapshot": false,
    "snapshot_output_dir": "/data/snapshots/"
  }
}
