Sign inSign up

kosdk/mqtt-camera-ai-monitor

By kosdk

•Updated about 1 year ago

Captures RTSP images on MQTT trigger, analyzes with AI, and publishes results to MQTT.

Image
Networking
Machine learning & AI
0

2.0K

kosdk/mqtt-camera-ai-monitor repository overview

⁠MQTT Camera AI Monitor

MQTT Camera AI Monitor is a Docker-ready Node.js/TypeScript application that listens to MQTT channels for trigger commands, captures images from RTSP cameras using FFmpeg, analyzes them via OpenAI-compatible AI endpoints, and publishes results and images back to MQTT. It supports multiple cameras, automatic cleanup, graceful shutdown, and detailed logging, all configured via a YAML file.

⁠Features

  • Monitors MQTT topics for trigger commands
  • Captures still images from RTSP camera streams (FFmpeg)
  • Analyzes images using OpenAI-compatible endpoints
  • Publishes results and images as MQTT messages
  • Supports multiple cameras and flexible YAML config
  • Automatic file cleanup, status monitoring, and detailed logging

⁠Quick Start

  1. Prepare your config file:
    Copy and edit config.yaml.sample from the GitHub repository⁠ with your MQTT, camera, and AI endpoint settings.

  2. Run the container:

    docker run -d \
      -v /path/to/your/config.yaml:/usr/src/app/config.yaml \
      kosdk/mqtt-camera-ai-monitor:latest
    

    (Optionally, set a custom config path with -e CONFIG_FILE=/path/in/container/config.yaml)

  3. MQTT Usage Example:

    • Trigger analysis by publishing YES to <basetopic>/<camera>/trigger
    • Image and AI analysis responses are published on <basetopic>/<camera>/image and <basetopic>/<camera>/ai
    • Monitor <basetopic>/online for status

⁠Prerequisites

  • MQTT broker
  • RTSP cameras accessible from container
  • OpenAI-compatible API endpoint

⁠Docker Compose Example

services:
  mqtt-camera-monitor:
    image: kosdk/mqtt-camera-ai-monitor:latest
    volumes:
      - ./config.yaml:/app/config.yaml
    environment:
      - CONFIG_FILE=/app/config.yaml
    restart: unless-stopped

⁠Logs & Troubleshooting

  • Logs output to console by default.
  • For common issues (MQTT, camera access, AI API, permissions), check config, connectivity, and container logs.
  • Monitor <basetopic>/online for health/status.

⁠License

BSD 3-Clause License


For configuration samples and advanced usage, visit the project GitHub⁠.

Tag summary

Content type

Image

Digest

sha256:58efa6720…

Size

660.3 MB

Last updated

about 1 year ago

docker pull kosdk/mqtt-camera-ai-monitor