MCP CamStream Analyzer logo

MCP CamStream Analyzer

by l1b0k

MCP CamStream Analyzer is a tool for collecting and analyzing content from cameras and RTSP video streams. It supports integration with any OpenAI-compatible API for detailed content analysis.

View on GitHub

Last updated: N/A

MCP CamStream Analyzer

MCP CamStream Analyzer is a tool for collecting and analyzing content from cameras and RTSP video streams. It supports integration with any OpenAI-compatible API for detailed content analysis.

Features

  • Image Analysis: Generate descriptions based on templates by providing image files.
  • Video Analysis: Supports frame-by-frame analysis or entire video analysis.
  • Multi-Camera Support: Supports system default cameras, external USB cameras, and RTSP stream cameras.

Quick Start

  1. Clone the project:

    git clone <repository-url>
    cd mcp_camstream_analizer
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Configuration: The default configuration file is config.yaml, which will be automatically generated on the first run. Modify the configuration as needed, especially the api_key.

  4. Run the service:

    python main.py
    

Configuration

Example configuration file:

model: gpt-4-vision-preview
base_url: null
cameras:
  default: 0
  webcam1: 1
  ip_camera1:
    rtsp_url: rtsp://admin:[email protected]:554/stream1
    buffer_size: 5
output_dir: output
prompt_templates:
  default: Describe what you see in this image.
  detailed: Provide a detailed analysis of the scene, people, and events happening in this image.
  security: This is a security monitoring image. Are there any abnormalities or situations that need attention? Describe in detail what you see.
video_analysis:
  mode: frames
  frame_interval: 30
api_key: ""

Contribution

Feel free to submit issues and contribute code!